1 require 'arel/visitors/compat'
5 class Derby < Arel::Visitors::ToSql
6 def visit_Arel_Nodes_SelectStatement o
8 o.cores.map { |x| visit_Arel_Nodes_SelectCore x }.join,
9 ("ORDER BY #{o.orders.map { |x| visit x }.join(', ')}" unless o.orders.empty?),
10 ("FETCH FIRST #{limit_for(o.limit)} ROWS ONLY" if o.limit),
11 (visit(o.offset) if o.offset),
12 (visit(o.lock) if o.lock),
16 def visit_Arel_Nodes_Offset o
17 "OFFSET #{visit o.value} ROWS"