Class: Bmg::Sql::Processor::FromSelf

Inherits:
Bmg::Sql::Processor show all
Defined in:
lib/bmg/sql/processor/from_self.rb

Constant Summary

Constants inherited from Bmg::Sql::Processor

UnexpectedError

Instance Attribute Summary

Attributes inherited from Bmg::Sql::Processor

#builder

Instance Method Summary collapse

Methods inherited from Bmg::Sql::Processor

#initialize, #on_set_operator

Constructor Details

This class inherits a constructor from Bmg::Sql::Processor

Instance Method Details

#on_nonjoin_exp(sexpr) ⇒ Object Also known as: on_union, on_except, on_intersect, on_select_exp



14
15
16
17
18
19
20
# File 'lib/bmg/sql/processor/from_self.rb', line 14

def on_nonjoin_exp(sexpr)
  q = builder.next_qualifier!
  [ :with_exp,
    [:with_spec,
      builder.name_intro(q, sexpr)],
    builder.select_all(sexpr, q, q) ]
end

#on_with_exp(sexpr) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/bmg/sql/processor/from_self.rb', line 6

def on_with_exp(sexpr)
  q = builder.next_qualifier!
  name_intro = builder.name_intro(q, sexpr.select_exp)
  [ :with_exp,
    sexpr.with_spec.dup.push(name_intro),
    builder.select_all(sexpr.select_exp, q, q) ]
end