Class: SQLConstructor::BasicUpdate

Inherits:
GenericQuery show all
Defined in:
lib/sqlconstructor.rb

Overview

Internal class which represents a basic INSERT statement.

Direct Known Subclasses

BasicUpdate_mysql

Constant Summary collapse

METHODS =
{
                :tables => QAttr.new( :name => 'upd_tables', :text => '', :val => SQLObject ),
                :set    => QAttr.new( :name => 'upd_set', :text => 'SET', :val => SQLCondList ),
                :where => QAttr.new( :name => 'attr_where', :text => 'WHERE', :val => SQLConditional),
                :first  => QAttr.new( :name => 'attr_first', :text => 'FIRST', :val => SQLObject ),
                :skip   => QAttr.new( :name => 'attr_skip',  :text => 'SKIP',  :val => SQLObject ),
}

Instance Attribute Summary collapse

Attributes inherited from GenericQuery

#attr_index_hints, #caller, #child_caller, #dialect, #exporter, #string, #tidy, #type

Attributes inherited from SQLObject

#alias, #inline, #name, #separator

Instance Method Summary collapse

Methods inherited from GenericQuery

#_get, #_remove, #method_missing, #to_s, #to_str

Methods inherited from SQLObject

#_name, #_string, #_string=, get, #to_s

Constructor Details

#initialize(_caller, *list) ⇒ BasicUpdate

Class constructor.

_caller     - the caller object


682
683
684
685
686
# File 'lib/sqlconstructor.rb', line 682

def initialize ( _caller, *list )
    super _caller
    @upd_tables = QAttr.new( :name => 'upd_tables', :text => '',
                             :val  => SQLAliasedList.new( *list ) )
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class SQLConstructor::GenericQuery

Instance Attribute Details

#attr_firstObject

Returns the value of attribute attr_first.



668
669
670
# File 'lib/sqlconstructor.rb', line 668

def attr_first
  @attr_first
end

#attr_order_byObject

Returns the value of attribute attr_order_by.



668
669
670
# File 'lib/sqlconstructor.rb', line 668

def attr_order_by
  @attr_order_by
end

#attr_skipObject

Returns the value of attribute attr_skip.



668
669
670
# File 'lib/sqlconstructor.rb', line 668

def attr_skip
  @attr_skip
end

#attr_whereObject

Returns the value of attribute attr_where.



668
669
670
# File 'lib/sqlconstructor.rb', line 668

def attr_where
  @attr_where
end

#upd_setObject

Returns the value of attribute upd_set.



668
669
670
# File 'lib/sqlconstructor.rb', line 668

def upd_set
  @upd_set
end

#upd_tablesObject

Returns the value of attribute upd_tables.



668
669
670
# File 'lib/sqlconstructor.rb', line 668

def upd_tables
  @upd_tables
end

Instance Method Details

#update_more(*list) ⇒ Object

Add tables to UPDATE tables list ( @upd_tables )



691
692
693
# File 'lib/sqlconstructor.rb', line 691

def update_more ( *list )
    @upd_tables.val.push *list
end