Class: ActiveRecord::ConnectionAdapters::AwsDataServiceMysqlAdapter

Inherits:
AbstractMysqlAdapter
  • Object
show all
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

Constructor Details

#initializeAwsDataServiceMysqlAdapter

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_transactionObject



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_transactionObject



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_transactionObject



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