Module: Bmg::Sql::OffsetClause

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

Constant Summary collapse

OFFSET =
"OFFSET"

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

#offsetObject



8
9
10
# File 'lib/bmg/sql/nodes/offset_clause.rb', line 8

def offset
  last.to_i
end

#to_sql(buffer, dialect) ⇒ Object



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

def to_sql(buffer, dialect)
  buffer << OFFSET << SPACE << offset.to_s
  buffer
end