Class: Bmg::Sql::Processor::Bind
- Inherits:
-
Bmg::Sql::Processor
- Object
- Sexpr::Rewriter
- Bmg::Sql::Processor
- Bmg::Sql::Processor::Bind
- Defined in:
- lib/bmg/sql/processor/bind.rb
Constant Summary
Constants inherited from Bmg::Sql::Processor
Instance Attribute Summary
Attributes inherited from Bmg::Sql::Processor
Instance Method Summary collapse
-
#initialize(binding, builder) ⇒ Bind
constructor
A new instance of Bind.
- #on_select_exp(sexpr) ⇒ Object
Methods inherited from Bmg::Sql::Processor
#on_set_operator, #on_with_exp
Constructor Details
#initialize(binding, builder) ⇒ Bind
Returns a new instance of Bind.
6 7 8 9 |
# File 'lib/bmg/sql/processor/bind.rb', line 6 def initialize(binding, builder) super(builder) @binding = binding end |
Instance Method Details
#on_select_exp(sexpr) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/bmg/sql/processor/bind.rb', line 11 def on_select_exp(sexpr) if w = sexpr.where_clause pred = Predicate::Grammar.sexpr(w.predicate.bind(@binding)) sexpr.with_update(:where_clause, [ :where_clause, pred ]) else sexpr end end |