Module: Bmg::Sql::NativeTableAs

Includes:
Expr
Defined in:
lib/bmg/sql/nodes/native_table_as.rb

Constant Summary

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

#as_nameObject



18
19
20
# File 'lib/bmg/sql/nodes/native_table_as.rb', line 18

def as_name
  self[2].last
end

#leftObject



6
7
8
# File 'lib/bmg/sql/nodes/native_table_as.rb', line 6

def left
  self[1]
end

#native_tableObject



14
15
16
# File 'lib/bmg/sql/nodes/native_table_as.rb', line 14

def native_table
  self[1].last
end

#rightObject



10
11
12
# File 'lib/bmg/sql/nodes/native_table_as.rb', line 10

def right
  self[2]
end

#to_sql(buffer, dialect) ⇒ Object



22
23
24
25
26
27
# File 'lib/bmg/sql/nodes/native_table_as.rb', line 22

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