Class ActiveRecord::ConnectionAdapters::Mysql2Adapter
In: lib/active_record/connection_adapters/mysql2_adapter.rb
Parent: AbstractAdapter

Methods

Constants

ADAPTER_NAME = 'Mysql2'
PRIMARY = "PRIMARY"
LOST_CONNECTION_ERROR_MESSAGES = [ "Server shutdown in progress", "Broken pipe", "Lost connection to MySQL server during query", "MySQL server has gone away" ]
QUOTED_FALSE = '1', '0'
NATIVE_DATABASE_TYPES = { :primary_key => "int(11) DEFAULT NULL auto_increment PRIMARY KEY", :string => { :name => "varchar", :limit => 255 }, :text => { :name => "text" }, :integer => { :name => "int", :limit => 4 }, :float => { :name => "float" }, :decimal => { :name => "decimal" }, :datetime => { :name => "datetime" }, :timestamp => { :name => "datetime" }, :time => { :name => "time" }, :date => { :name => "date" }, :binary => { :name => "blob" }, :boolean => { :name => "tinyint", :limit => 1 }

Public Class methods

Public Instance methods

CONNECTION MANAGEMENT ====================================

Returns the database character set.

Returns the database collation strategy.

create(sql, name = nil, pk = nil, id_value = nil, sequence_name = nil)

Alias for insert_sql

Create a new MySQL database with optional :charset and :collation. Charset defaults to utf8.

Example:

  create_database 'charset_test', :charset => 'latin1', :collation => 'latin1_bin'
  create_database 'matt_development'
  create_database 'matt_development', :charset => :big5

Executes the SQL statement in the context of this connection.

Returns just a table‘s primary key

QUOTING ==================================================

this is set to true in 2.3, but we don‘t want it to be

Returns an array of arrays containing the field values. Order is the same as that returned by columns.

SCHEMA STATEMENTS ========================================

Maps logical Rails types to MySQL-specific data types.

Protected Instance methods

[Validate]