class Arel::Visitors::HSQLDB
Public Instance Methods
visit_Arel_Nodes_SelectStatement(o, *)
click to toggle source
Calls superclass method
# File lib/arel/visitors/hsqldb.rb, line 6 def visit_Arel_Nodes_SelectStatement(o, *) o.limit ||= Arel::Nodes::Limit.new(0) if o.offset super end
Private Instance Methods
limit_offset(sql, o)
click to toggle source
# File lib/arel/visitors/hsqldb.rb, line 19 def limit_offset sql, o offset = o.offset || 0 offset = offset.expr unless (offset.nil? || offset == 0) if limit = o.limit "SELECT LIMIT #{offset} #{limit_for(limit)} #{sql[7..-1]}" elsif offset > 0 "SELECT LIMIT #{offset} 0 #{sql[7..-1]}" # removes "SELECT " else sql end end