Class: SqlStmt::InsertSelect

Inherits:
FromQuery show all
Includes:
ValueUtil
Defined in:
lib/sqlstmt/insert_select.rb

Instance Attribute Summary

Attributes inherited from Query

#fields, #joins, #tables, #wheres

Instance Method Summary collapse

Methods included from ValueUtil

#field, #fieldq

Methods inherited from FromQuery

#group_by, #having, #order_by

Methods inherited from Query

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

Constructor Details

#initializeInsertSelect

Returns a new instance of InsertSelect.



10
11
12
13
14
15
# File 'lib/sqlstmt/insert_select.rb', line 10

def initialize
  super
  @values = []
  @distinct = @ignore = false
  @into_table = nil
end

Instance Method Details

#distinctObject



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

def distinct
  @distinct = true
  self
end

#ignoreObject



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

def ignore
  @ignore = true
  self
end

#insert_into(table) ⇒ Object



27
28
29
30
# File 'lib/sqlstmt/insert_select.rb', line 27

def insert_into(table)
  @into_table = table
  self
end