Files

SQLExporter::Exporter_mysql

MySQL dialect translator class.

Constants

DELETE_SYNTAX

The main rule for the MySQL DELETE query syntax

INSERT_SYNTAX
SELECT_SYNTAX

The main rule for the MySQL SELECT query syntax

UPDATE_SYNTAX

Attributes

dialect[R]

Public Class Methods

new( tidy ) click to toggle source
# File lib/dialects/mysql-exporter.rb, line 67
def initialize ( tidy )
    @tidy = tidy
    @dialect = 'mysql'
    super tidy   # ha ha, "super tidy" :)
end

Public Instance Methods

attr_from( obj ) click to toggle source

Forms a string for the FROM clause from the objects attributes @attr_from and @attr_index_hints

# File lib/dialects/mysql-exporter.rb, line 77
def attr_from ( obj )
    result = ""
    if obj.attr_from
        result = "FROM " + to_sWithAliasesIndexes( obj, obj.attr_from.val )
    end
    return result
end

Private Instance Methods

to_sWithAliasesIndexes( obj, list ) click to toggle source

Returns a string of objects in list merged with indexes of obj

# File lib/dialects/mysql-exporter.rb, line 92
def to_sWithAliasesIndexes ( obj, list )
    list = [ list ]  if ! [ Array, SQLValList, SQLAliasedList ].include? list.class
    arr  = [ ]
    list.each_with_index do |item,i|
        _alias = item.alias ? " " + item.alias.to_s : ""
        str = item.to_s + _alias
        if obj.attr_index_hints
            index_hash = obj.attr_index_hints[i]
            str += " " + index_hash[:type] + " " + index_hash[:list].to_s
        end
        arr << str
    end
    return arr.join ','
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.