Class: ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::StatementPool
- Inherits:
-
StatementPool
- Object
- StatementPool
- ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::StatementPool
- Defined in:
- activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
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
Methods included from Enumerable
#as_json, #exclude?, #index_by, #many?, #pluck, #sum, #without
Constructor Details
#initialize(connection, max) ⇒ StatementPool
Returns a new instance of StatementPool.
170 171 172 173 174 |
# File 'activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb', line 170 def initialize(connection, max) super(max) @connection = connection @counter = 0 end |
Instance Method Details
#[]=(sql, key) ⇒ Object
180 181 182 |
# File 'activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb', line 180 def []=(sql, key) super.tap { @counter += 1 } end |
#next_key ⇒ Object
176 177 178 |
# File 'activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb', line 176 def next_key "a#{@counter + 1}" end |