class MysqlAdapter
Ruby on Rails 2.2.3
Since v2.2.3 Last seen in v3.0.20The MySQL adapter will work with both Ruby/MySQL, which is a Ruby-based MySQL adapter that comes bundled with Active Record, and with the faster C-based MySQL/Ruby adapter (available both as a gem and from www.tmtm.org/en/mysql/ruby/).
Options:
-
:host- Defaults to “localhost”. -
:port- Defaults to 3306. -
:socket- Defaults to “/tmp/mysql.sock”. -
:username- Defaults to “root” -
:password- Defaults to nothing. -
:database- The name of the database. No default, must be provided. -
:encoding- (Optional) Sets the client encoding by executing “SET NAMES <encoding>” after connection. -
:reconnect- Defaults to false (See MySQL documentation: dev.mysql.com/doc/refman/5.0/en/auto-reconnect.html). -
:sslca- Necessary to use MySQL with an SSL connection. -
:sslkey- Necessary to use MySQL with an SSL connection. -
:sslcert- Necessary to use MySQL with an SSL connection. -
:sslcapath- Necessary to use MySQL with an SSL connection. -
:sslcipher- Necessary to use MySQL with an SSL connection.
By default, the MysqlAdapter will consider all columns of type tinyint(1) as boolean. If you wish to disable this emulation (which was the default behavior in versions 0.13.1 and earlier) you can add the following line to your environment.rb file:
ActiveRecord::ConnectionAdapters::MysqlAdapter.emulate_booleans = false
Inherits from
Constants
Methods (defined here)
- # active?
- # case_sensitive_equality_operator
- # change_column_null
- # charset
- # collation
- # create_database
- # current_database
- # disconnect!
- # drop_table
- # limited_update_conditions
- # quote
- # quoted_false
- # quoted_true
- # reconnect!
- # rename_table
- # reset!
- # select_rows
- # show_variable
- # type_to_sql
- self. new
Private methods
(6)
Implementation detail — not part of the public API.
- # column_for
- # configure_connection
- # connect
- # select
- # supports_views?
- # version
Methods (inherited)
From ActiveRecord::ConnectionAdapters::AbstractAdapter (20)
- # active?
- # adapter_name
- # decrement_open_transactions
- # disable_referential_integrity
- # disconnect!
- # format_log_entry
- # increment_open_transactions
- # log
- # log_info
- # open_transactions
- # prefetch_primary_key?
- # quote_table_name
- # raw_connection
- # reconnect!
- # requires_reloading?
- # reset!
- # supports_count_distinct?
- # supports_ddl_transactions?
- # supports_migrations?
- # verify!
From ActiveRecord::ConnectionAdapters::QueryCache (7)
- # cache
- # clear_query_cache
- # columns_with_query_cache
- # select_all_with_query_cache
- # uncached
- self. dirties_query_cache
- self. included
From ActiveSupport::Callbacks (2)
- # run_callbacks
- self. included
From Object (32)
- # acts_like?
- # app
- # blank?
- # class_eval
- # create
- # create_fixtures
- # duplicable?
- # edit
- # find_cmd
- # helper
- # index
- # instance_exec
- # instance_variable_defined?
- # instance_variable_names
- # message
- # metaclass
- # new_session
- # present?
- # reload!
- # returning
- # start_debugger
- # tail
- # to_json
- # to_param
- # to_query
- # unescape
- # update
- # with_options
- self. blank_slate_method_added
- self. find_hidden_method
- self. lookup_missing_generator
- self. method_added
From ActionController::Caching (3)
- # cache
- self. cache_configured?
- self. cache_store=
From ActionController::Cookies (2)
From ActionController::Flash (1)
- self. included
From ActionController::RecordIdentifier (5)
From ActionController::Rescue (7)
From ActionController::Streaming (2)
From ActionController::Translation (4)
From ActiveRecord::Callbacks (14)
From ActiveRecord::Dirty (4)
From ActiveRecord::Locking::Pessimistic (1)
- # lock!
From ActiveRecord::NamedScope (1)
- self. included
From ActiveRecord::Transactions (4)
From ActiveRecord::Validations (7)
From ActiveRecord::NamedScope::ClassMethods (2)
- # named_scope
- # scopes
From ActiveRecord::Validations::ClassMethods (13)
From ActiveSupport::Memoizable (1)
- # memoize