Sha256: 268cf7f7696a46bdf7e063dcc24655508a299ff0a282fd25758d2929f9f44da3
Contents?: true
Size: 763 Bytes
Versions: 19
Compression:
Stored size: 763 Bytes
Contents
require 'arel/visitors/compat' module Arel module Visitors class HSQLDB < Arel::Visitors::ToSql def visit_Arel_Nodes_SelectStatement o, a = nil sql = limit_offset(o.cores.map { |x| do_visit_select_core x, a }.join, o) sql << " ORDER BY #{o.orders.map { |x| do_visit x, a }.join(', ')}" unless o.orders.empty? sql end private 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 end end end
Version data entries
19 entries across 19 versions & 1 rubygems