Sha256: 6f9f54f803831f1cf42cf230decbb02331850508ef3dcc644613b83dd97a4f44

Contents?: true

Size: 979 Bytes

Versions: 136

Compression:

Stored size: 979 Bytes

Contents

# frozen_string_literal: true

module Arel # :nodoc: all
  module Visitors
    class SQLite < Arel::Visitors::ToSql
      private
        # Locks are not supported in SQLite
        def visit_Arel_Nodes_Lock(o, collector)
          collector
        end

        def visit_Arel_Nodes_SelectStatement(o, collector)
          o.limit = Arel::Nodes::Limit.new(-1) if o.offset && !o.limit
          super
        end

        def visit_Arel_Nodes_True(o, collector)
          collector << "1"
        end

        def visit_Arel_Nodes_False(o, collector)
          collector << "0"
        end

        def visit_Arel_Nodes_IsNotDistinctFrom(o, collector)
          collector = visit o.left, collector
          collector << " IS "
          visit o.right, collector
        end

        def visit_Arel_Nodes_IsDistinctFrom(o, collector)
          collector = visit o.left, collector
          collector << " IS NOT "
          visit o.right, collector
        end
    end
  end
end

Version data entries

136 entries across 131 versions & 11 rubygems

Version Path
activerecord-6.1.3.1 lib/arel/visitors/sqlite.rb
activerecord-6.0.3.6 lib/arel/visitors/sqlite.rb
activerecord-6.1.3 lib/arel/visitors/sqlite.rb
activerecord-6.1.2.1 lib/arel/visitors/sqlite.rb
activerecord-6.0.3.5 lib/arel/visitors/sqlite.rb
activerecord-6.1.2 lib/arel/visitors/sqlite.rb
activerecord-6.1.1 lib/arel/visitors/sqlite.rb
activerecord-6.1.0 lib/arel/visitors/sqlite.rb
activerecord-6.1.0.rc2 lib/arel/visitors/sqlite.rb
activerecord-6.1.0.rc1 lib/arel/visitors/sqlite.rb
activerecord-6.0.3.4 lib/arel/visitors/sqlite.rb
activerecord-6.0.3.3 lib/arel/visitors/sqlite.rb
activerecord-6.0.3.2 lib/arel/visitors/sqlite.rb
activerecord-6.0.3.1 lib/arel/visitors/sqlite.rb
activerecord-6.0.3 lib/arel/visitors/sqlite.rb
activerecord-6.0.3.rc1 lib/arel/visitors/sqlite.rb