Class: ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::StatementPool
- Inherits:
-
StatementPool
- Object
- StatementPool
- ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::StatementPool
- 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
- #[]=(sql, key) ⇒ Object
-
#initialize(connection, max) ⇒ StatementPool
constructor
A new instance of StatementPool.
- #next_key ⇒ Object
Methods inherited from StatementPool
#[], #clear, #delete, #each, #key?, #length
Constructor Details
#initialize(connection, max) ⇒ StatementPool
Returns a new instance of StatementPool.
219 220 221 222 223 |
# File 'lib/active_record/connection_adapters/postgresql_adapter.rb', line 219 def initialize(connection, max) super(max) @connection = connection @counter = 0 end |
Instance Method Details
#[]=(sql, key) ⇒ Object
229 230 231 |
# File 'lib/active_record/connection_adapters/postgresql_adapter.rb', line 229 def []=(sql, key) super.tap { @counter += 1 } end |
#next_key ⇒ Object
225 226 227 |
# File 'lib/active_record/connection_adapters/postgresql_adapter.rb', line 225 def next_key "a#{@counter + 1}" end |