Module: Bmg::Sql::WithExp

Extended by:
Forwardable
Includes:
Expr
Defined in:
lib/bmg/sql/nodes/with_exp.rb

Constant Summary collapse

WITH =
"WITH".freeze

Constants included from Expr

Expr::AND, Expr::AS, Expr::COMMA, Expr::DOT, Expr::EQUAL, Expr::EXISTS, Expr::FALSE, Expr::GREATER, Expr::GREATER_OR_EQUAL, Expr::IN, Expr::LEFT_PARENTHESE, Expr::LESS, Expr::LESS_OR_EQUAL, Expr::NOT, Expr::NOT_EQUAL, Expr::OR, Expr::QUOTE, Expr::RIGHT_PARENTHESE, Expr::SPACE, Expr::TRUE

Instance Method Summary collapse

Methods included from Expr

#each_child, #flatten, #group_by?, #join?, #limit_or_offset?, #order_by?, #ordering, #set_operator?, #with_insert, #with_push, #with_update

Instance Method Details

#select_expObject



17
18
19
# File 'lib/bmg/sql/nodes/with_exp.rb', line 17

def select_exp
  last
end

#to_sql(buffer, dialect) ⇒ Object

to_xxx



42
43
44
45
46
47
48
# File 'lib/bmg/sql/nodes/with_exp.rb', line 42

def to_sql(buffer, dialect)
  buffer << WITH << SPACE
  self[1].to_sql(buffer, dialect)
  buffer << SPACE
  self[2].to_sql(buffer, dialect, false)
  buffer
end

#with_exp?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/bmg/sql/nodes/with_exp.rb', line 9

def with_exp?
  true
end

#with_specObject



13
14
15
# File 'lib/bmg/sql/nodes/with_exp.rb', line 13

def with_spec
  self[1]
end