2016-08-31 11:20:36 -04:00
|
|
|
# frozen_string_literal: true
|
2018-02-24 01:45:50 -05:00
|
|
|
|
2018-02-24 02:41:47 -05:00
|
|
|
module Arel # :nodoc: all
|
2010-10-20 20:16:18 -04:00
|
|
|
module Visitors
|
|
|
|
class SQLite < Arel::Visitors::ToSql
|
|
|
|
private
|
2011-08-26 13:01:00 -04:00
|
|
|
|
2018-02-24 01:45:50 -05:00
|
|
|
# Locks are not supported in SQLite
|
|
|
|
def visit_Arel_Nodes_Lock(o, collector)
|
|
|
|
collector
|
|
|
|
end
|
2016-03-01 16:21:47 -05:00
|
|
|
|
2018-02-24 01:45:50 -05:00
|
|
|
def visit_Arel_Nodes_SelectStatement(o, collector)
|
|
|
|
o.limit = Arel::Nodes::Limit.new(-1) if o.offset && !o.limit
|
|
|
|
super
|
|
|
|
end
|
2016-03-01 16:21:47 -05:00
|
|
|
|
2018-02-24 01:45:50 -05:00
|
|
|
def visit_Arel_Nodes_True(o, collector)
|
|
|
|
collector << "1"
|
|
|
|
end
|
2016-03-01 16:21:47 -05:00
|
|
|
|
2018-02-24 01:45:50 -05:00
|
|
|
def visit_Arel_Nodes_False(o, collector)
|
|
|
|
collector << "0"
|
|
|
|
end
|
2010-10-20 20:16:18 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|