class ActiveRecord::ConnectionAdapters::Mysql2Adapter
Constants
- ADAPTER_NAME
Public Class Methods
# File activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb, line 42 def initialize(connection, logger, connection_options, config) super @prepared_statements = false unless config.key?(:prepared_statements) configure_connection end
Calls superclass method ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter.new
Public Instance Methods
# File activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb, line 92 def active? @connection.ping end
# File activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb, line 105 def disconnect! super @connection.close end
Disconnects from the database if already connected. Otherwise, this method does nothing.
Calls superclass method ActiveRecord::ConnectionAdapters::AbstractAdapter#disconnect!
# File activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb, line 76 def error_number(exception) exception.error_number if exception.respond_to?(:error_number) end
# File activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb, line 84 def quote_string(string) @connection.escape(string) end
# File activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb, line 96 def reconnect! super disconnect! connect end
Calls superclass method ActiveRecord::ConnectionAdapters::AbstractAdapter#reconnect!
Also aliased as: reset!
reset!()
Alias for: reconnect!
# File activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb, line 52 def supports_comments? true end
# File activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb, line 56 def supports_comments_in_create? true end
# File activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb, line 48 def supports_json? !mariadb? && version >= '5.7.8' end
# File activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb, line 60 def supports_savepoints? true end
© 2004–2018 David Heinemeier Hansson
Licensed under the MIT License.