Class: ActiveRecord::ConnectionAdapters::RedshiftAdapter::StatementPool

Inherits:
ConnectionAdapters::StatementPool
  • Object
show all
Defined in:
lib/active_record/connection_adapters/redshift_7_0_adapter.rb,
lib/active_record/connection_adapters/redshift_7_1_adapter.rb

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initialize(connection, max) ⇒ StatementPool

Returns a new instance of StatementPool.



140
141
142
143
144
# File 'lib/active_record/connection_adapters/redshift_7_0_adapter.rb', line 140

def initialize(connection, max)
  super(max)
  @connection = connection
  @counter = 0
end

Instance Method Details

#[]=(sql, key) ⇒ Object



150
151
152
# File 'lib/active_record/connection_adapters/redshift_7_0_adapter.rb', line 150

def []=(sql, key)
  super.tap { @counter += 1 }
end

#next_keyObject



146
147
148
# File 'lib/active_record/connection_adapters/redshift_7_0_adapter.rb', line 146

def next_key
  "a#{@counter + 1}"
end