Files

SQLConstructor::BasicSelect_mysql

MySQL dialect descendant of BasicSelect class

Constants

METHODS

Attributes

attr_group_by_with_rollup[R]
attr_high_priority[R]
attr_limit[R]
attr_sql_cache[R]
attr_sql_calc_found_rows[R]
attr_sql_result_size[R]
attr_straight_join[R]

Public Class Methods

new( _caller, *list ) click to toggle source

Class constructor. _caller - the caller object *list - list of sources for the FROM clause

# File lib/dialects/mysql-constructor.rb, line 41
def initialize ( _caller, *list )
    super
end

Public Instance Methods

method_missing( method, *args ) click to toggle source

Send missing methods calls to the @caller object, and also handle JOINs, UNIONs and INDEX hints

# File lib/dialects/mysql-constructor.rb, line 49
def method_missing ( method, *args )
     # Handle all [*_]join calls:
    return _addJoin( method, *args )  if method.to_s =~ /^[a-z_]*join$/
      # Handle all valid *_index/*_key calls:
    return _addIndexes( method, *args )  if VALID_INDEX_HINTS.include? method 
    super
end

Private Instance Methods

_addIndexes( type, *list ) click to toggle source

Adds a USE/FORCE/IGNORE INDEX clause for the last objects in for_vals argument.

# File lib/dialects/mysql-constructor.rb, line 65
def _addIndexes ( type, *list )
    type = type.to_s
    type.upcase!.gsub! /_/, ' '
    @attr_index_hints ||= [ ]
     # set the attr_index_hints for the last object in for_vals
    last_ind = @attr_from.val.length - 1
    @attr_index_hints[last_ind] = { :type => type, :list => SQLObject.get( list ) }
    @string = nil
    return self
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.