Methods
- A
- C
- D
- E
- I
- L
- N
- Q
- R
- S
Constants
ADAPTER_NAME | = | 'Mysql2' |
Class Public methods
Instance Public methods
CONNECTION MANAGEMENT ====================================
Disconnects from the database if already connected. Otherwise, this method does nothing.
Also aliased as: exec_update
Also aliased as: exec_without_stmt
Executes the SQL statement in the context of this connection.
# File activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb, line 206 def execute(sql, name = nil) # make sure we carry over any changes to ActiveRecord::Base.default_timezone that have been # made since we established the connection @connection.query_options[:database_timezone] = ActiveRecord::Base.default_timezone super end
DATABASE STATEMENTS ======================================
# File activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb, line 97 def explain(arel, binds = []) sql = "EXPLAIN #{to_sql(arel, binds.dup)}" start = Time.now result = exec_query(sql, 'EXPLAIN', binds) elapsed = Time.now - start ExplainPrettyPrinter.new.pp(result, elapsed) end
Also aliased as: create
QUOTING ==================================================
Returns an array of record hashes with the column names as keys and column values as values.
Returns an array of arrays containing the field values. Order is the same
as that returned by columns
.