Class ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter
In: lib/active_record/connection_adapters/abstract_mysql_adapter.rb
Parent: AbstractAdapter

Methods

Constants

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 }

External Aliases

remove_column -> remove_columns_sql

Public Class methods

FIXME: Make the first parameter more similar for the two adapters

Public Instance methods

Returns the database character set.

Returns the database collation strategy.

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 a table‘s primary key and belonging sequence.

Returns just a table‘s primary key

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

Drops the database specified on the name attribute and creates it again using the provided options.

Renames a table.

Example:

  rename_table('octopuses', 'octopi')

SHOW VARIABLES LIKE ‘name‘

Technically MySQL allows to create indexes with the sort order syntax but at the moment (5.5) it doesn‘t yet implement them

Returns true, since this connection adapter supports migrations.

Returns true, since this connection adapter supports savepoints.

Maps logical Rails types to MySQL-specific data types.

Protected Instance methods

[Validate]