Class: SqlStmt::Select

Inherits:
FromQuery show all
Defined in:
lib/sqlstmt/select.rb

Instance Attribute Summary

Attributes inherited from Query

#fields, #joins, #tables, #wheres

Instance Method Summary collapse

Methods inherited from FromQuery

#group_by, #having, #limit, #order_by

Methods inherited from Query

#includes_table?, #join, #join_using, #left_join, #left_join_using, #no_where, #optional_join, #optional_where, #table, #to_s, #where

Constructor Details

#initializeSelect

Returns a new instance of Select.



6
7
8
9
10
# File 'lib/sqlstmt/select.rb', line 6

def initialize
  super
  @distinct = false
  @into = nil
end

Instance Method Details

#distinctObject



17
18
19
20
# File 'lib/sqlstmt/select.rb', line 17

def distinct
  @distinct = true
  self
end

#field(*field_exprs) ⇒ Object



12
13
14
15
# File 'lib/sqlstmt/select.rb', line 12

def field(*field_exprs)
  @fields.concat(field_exprs)
  self
end

#into_outfile(str) ⇒ Object



22
23
24
25
# File 'lib/sqlstmt/select.rb', line 22

def into_outfile(str)
  @into = "OUTFILE #{str}"
  self
end