Sha256: f5c27c128bc01667090ae1ecf31b31f1e64a2f271054081f46c053dacee1fd53

Contents?: true

Size: 691 Bytes

Versions: 5

Compression:

Stored size: 691 Bytes

Contents

module Alf
  module Sql
    class Processor
      class Where < Processor

        def initialize(predicate, builder)
          super(builder)
          @predicate = predicate
        end

        def on_select_exp(sexpr)
          pred = @predicate.rename(sexpr.desaliaser).sexpr
          if sexpr.where_clause
            anded = [:and, sexpr.where_clause.predicate, pred ]
            anded = Alf::Predicate::Grammar.sexpr(anded)
            sexpr.with_update(:where_clause, [ :where_clause, anded ])
          else
            sexpr.with_insert(4, [ :where_clause, pred ])
          end
        end

      end # class Where
    end # class Processor
  end # module Sql
end # module Alf

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
alf-sql-0.16.3 lib/alf/sql/processor/where.rb
alf-sql-0.16.2 lib/alf/sql/processor/where.rb
alf-sql-0.16.1 lib/alf/sql/processor/where.rb
alf-sql-0.16.0 lib/alf/sql/processor/where.rb
alf-sql-0.15.0 lib/alf/sql/processor/where.rb