Class: ActiveRecord::ConnectionAdapters::AwsDataServiceMysqlAdapter
- Inherits:
-
AbstractMysqlAdapter
- Object
- AbstractMysqlAdapter
- ActiveRecord::ConnectionAdapters::AwsDataServiceMysqlAdapter
- Includes:
- MySQL::DatabaseStatements
- Defined in:
- lib/active_record/connection_adapters/aws_data_service_mysql_adapter.rb
Constant Summary collapse
- ADAPTER_NAME =
'AwsDataServiceMysql'.freeze
Instance Method Summary collapse
- #begin_db_transaction ⇒ Object
- #commit_db_transaction ⇒ Object
- #each_hash(result) ⇒ Object
- #exec_rollback_db_transaction ⇒ Object
-
#initialize ⇒ AwsDataServiceMysqlAdapter
constructor
A new instance of AwsDataServiceMysqlAdapter.
Constructor Details
#initialize ⇒ AwsDataServiceMysqlAdapter
Returns a new instance of AwsDataServiceMysqlAdapter.
19 20 21 22 |
# File 'lib/active_record/connection_adapters/aws_data_service_mysql_adapter.rb', line 19 def initialize(*) super @prepared_statements = false end |
Instance Method Details
#begin_db_transaction ⇒ Object
34 35 36 37 38 39 40 |
# File 'lib/active_record/connection_adapters/aws_data_service_mysql_adapter.rb', line 34 def begin_db_transaction log('BEGIN') do ActiveSupport::Dependencies.interlock.permit_concurrent_loads do @connection.begin_db_transaction end end end |
#commit_db_transaction ⇒ Object
42 43 44 45 46 47 48 |
# File 'lib/active_record/connection_adapters/aws_data_service_mysql_adapter.rb', line 42 def commit_db_transaction log('COMMIT') do ActiveSupport::Dependencies.interlock.permit_concurrent_loads do @connection.commit_db_transaction end end end |
#each_hash(result) ⇒ Object
24 25 26 27 28 29 30 31 32 |
# File 'lib/active_record/connection_adapters/aws_data_service_mysql_adapter.rb', line 24 def each_hash(result) if block_given? result.each(as: :hash, symbolize_keys: true) do |row| yield row end else to_enum(:each_hash, result) end end |
#exec_rollback_db_transaction ⇒ Object
50 51 52 53 54 55 56 |
# File 'lib/active_record/connection_adapters/aws_data_service_mysql_adapter.rb', line 50 def exec_rollback_db_transaction log('ROLLBACK') do ActiveSupport::Dependencies.interlock.permit_concurrent_loads do @connection.exec_rollback_db_transaction end end end |