Module: Alf::Sql::WithExp

Extended by:
Forwardable
Includes:
Expr
Defined in:
lib/alf/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, #join?, #limit_or_offset?, #ordering, #set_operator?, #with_insert, #with_push, #with_update

Instance Method Details

#select_expObject



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

def select_exp
  last
end

#to_sql(buffer = "") ⇒ Object

to_xxx



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

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

#with_exp?Boolean

Returns:

  • (Boolean)


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

def with_exp?
  true
end

#with_specObject



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

def with_spec
  self[1]
end