Ruby on Rails 5.2 - ActiveRecord::ConnectionAdapters::Mysql2Adapter

वर्ग ActiveRecord :: ConnectionAdapters :: Mysql2Adapter




ruby

वर्ग ActiveRecord :: ConnectionAdapters :: Mysql2Adapter

जनक:
ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter
शामिल मॉड्यूल:
ActiveRecord::ConnectionAdapters::MySQL::DatabaseStatements

स्थिरांक

ADAPTER_NAME

पब्लिक क्लास के तरीके

नया (कनेक्शन, लकड़हारा, connection_options, config) स्रोत दिखाएँ
# File activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb, line 39
def initialize(connection, logger, connection_options, config)
  super
  @prepared_statements = false unless config.key?(:prepared_statements)
  configure_connection
end
सुपरक्लास विधि को कॉल करें ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter.new

सार्वजनिक प्रवृत्ति के तरीके

# File activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb, line 89
def active?
  @connection.ping
end
डिस्कनेक्ट! () स्रोत दिखाएं
# File activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb, line 102
def disconnect!
  super
  @connection.close
end

डेटाबेस से डिस्कनेक्ट यदि पहले से ही जुड़ा हुआ है। अन्यथा, यह विधि कुछ भी नहीं करती है।

Superclass पद्धति को कॉल करें ActiveRecord::ConnectionAdapters::AbstractAdapter#disconnect!
error_number (अपवाद) स्रोत दिखाएं
# File activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb, line 73
def error_number(exception)
  exception.error_number if exception.respond_to?(:error_number)
end
quot_string (स्ट्रिंग) स्रोत दिखाएं
# File activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb, line 81
def quote_string(string)
  @connection.escape(string)
end
फिर से कनेक्ट! () स्रोत दिखाएं
# File activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb, line 93
def reconnect!
  super
  disconnect!
  connect
end
सुपरक्लास विधि को कॉल करें ActiveRecord::ConnectionAdapters::AbstractAdapter#reconnect!
इसके अलावा उपनाम: reset!
रीसेट! ()
इसके लिए उपनाम: reconnect!
# File activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb, line 49
def supports_comments?
  true
end
supports_comments_in_create? () स्रोत दिखाएं
# File activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb, line 53
def supports_comments_in_create?
  true
end
# File activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb, line 45
def supports_json?
  !mariadb? && version >= "5.7.8"
end
supports_savepoints? () स्रोत दिखाएं
# File activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb, line 57
def supports_savepoints?
  true
end