Class: SQLExporter::Exporter_mysql
- Inherits:
-
Exporter_generic
- Object
- Exporter_generic
- SQLExporter::Exporter_mysql
- Defined in:
- lib/dialects/mysql-exporter.rb
Overview
MySQL dialect translator class.
Constant Summary collapse
- SELECT_SYNTAX =
The main rule for the MySQL SELECT query syntax
[ "SELECT", :attr_distinction, :attr_high_priority, :attr_straight_join, :attr_sql_result_size, :attr_sql_cache, :attr_sql_calc_found_rows, :attr_expression, :attr_from, :attr_joins, :attr_where, :attr_group_by, :attr_group_by_order, :attr_group_by_with_rollup, :attr_having, :attr_order_by, :attr_order_by_order, :attr_limit, :attr_unions ]
- DELETE_SYNTAX =
The main rule for the MySQL DELETE query syntax
[ "DELETE", :del_low_priority, :del_quick, :del_ignore, :attr_from, :attr_where, :attr_order_by, :attr_limit ]
- INSERT_SYNTAX =
[ "INSERT", :ins_priority, :ins_ignore, :ins_into, :ins_values, :ins_set, :ins_select, :ins_on_duplicate_key_update ]
- UPDATE_SYNTAX =
[ "UPDATE", :upd_low_priority, :upd_ignore, :upd_tables, :upd_set, :attr_where, :attr_order_by, :attr_limit ]
Instance Attribute Summary collapse
-
#dialect ⇒ Object
readonly
Returns the value of attribute dialect.
Attributes inherited from Exporter_generic
Instance Method Summary collapse
-
#attr_from(obj) ⇒ Object
Forms a string for the FROM clause from the objects attributes @attr_from and @attr_index_hints.
-
#initialize(tidy) ⇒ Exporter_mysql
constructor
A new instance of Exporter_mysql.
Methods inherited from Exporter_generic
#export, #gen_joins, #method_missing
Constructor Details
#initialize(tidy) ⇒ Exporter_mysql
Returns a new instance of Exporter_mysql.
67 68 69 70 71 |
# File 'lib/dialects/mysql-exporter.rb', line 67 def initialize ( tidy ) @tidy = tidy @dialect = 'mysql' super tidy # ha ha, "super tidy" :) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class SQLExporter::Exporter_generic
Instance Attribute Details
#dialect ⇒ Object (readonly)
Returns the value of attribute dialect.
7 8 9 |
# File 'lib/dialects/mysql-exporter.rb', line 7 def dialect @dialect end |
Instance Method Details
#attr_from(obj) ⇒ Object
Forms a string for the FROM clause from the objects attributes @attr_from
and @attr_index_hints
77 78 79 80 81 82 83 |
# 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 |