Files

Class/Module Index [+]

Quicksearch

Arel::Visitors::Derby

Public Instance Methods

visit_Arel_Nodes_Limit(o) click to toggle source
# File lib/arel/visitors/derby.rb, line 16
def visit_Arel_Nodes_Limit o
  "FETCH FIRST #{limit_for(o)} ROWS ONLY"
end
visit_Arel_Nodes_Lock(o) click to toggle source

This generates SELECT...FOR UPDATE, but it will only work if the current transaction isolation level is set to SERIALIZABLE. Otherwise, locks aren't held for the entire transaction.

# File lib/arel/visitors/derby.rb, line 27
def visit_Arel_Nodes_Lock o
  visit o.expr
end
visit_Arel_Nodes_Offset(o) click to toggle source
# File lib/arel/visitors/derby.rb, line 20
def visit_Arel_Nodes_Offset o
  "OFFSET #{visit o.value} ROWS"
end
visit_Arel_Nodes_SelectStatement(o) click to toggle source
# File lib/arel/visitors/derby.rb, line 6
def visit_Arel_Nodes_SelectStatement o
  [
   o.cores.map { |x| visit(x) }.join,
   ("ORDER BY #{o.orders.map { |x| visit x }.join(', ')}" unless o.orders.empty?),
   (visit(o.offset) if o.offset),
   (visit(o.limit) if o.limit),
   (visit(o.lock) if o.lock),
  ].compact.join ' '
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.