Class: ActiveRecord::ConnectionAdapters::MaterializeAdapter::StatementPool

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

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initialize(connection, max) ⇒ StatementPool

Returns a new instance of StatementPool.



164
165
166
167
168
# File 'lib/active_record/connection_adapters/materialize_adapter.rb', line 164

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

Instance Method Details

#[]=(sql, key) ⇒ Object



174
175
176
# File 'lib/active_record/connection_adapters/materialize_adapter.rb', line 174

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

#next_keyObject



170
171
172
# File 'lib/active_record/connection_adapters/materialize_adapter.rb', line 170

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