Class: ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::StatementPool

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

Overview

:nodoc:

Constant Summary

Constants inherited from StatementPool

StatementPool::DEFAULT_STATEMENT_LIMIT

Instance Method Summary collapse

Methods inherited from StatementPool

#[], #clear, #delete, #each, #key?, #length

Constructor Details

#initialize(connection, max) ⇒ StatementPool

Returns a new instance of StatementPool.



186
187
188
189
190
# File 'lib/active_record/connection_adapters/postgresql_adapter.rb', line 186

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

Instance Method Details

#[]=(sql, key) ⇒ Object



196
197
198
# File 'lib/active_record/connection_adapters/postgresql_adapter.rb', line 196

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

#next_keyObject



192
193
194
# File 'lib/active_record/connection_adapters/postgresql_adapter.rb', line 192

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