class ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::StatementPool
Public Class Methods
new(connection, max)
click to toggle source
Calls superclass method
Object::new
# File activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb, line 170 def initialize(connection, max) super(max) @connection = connection @counter = 0 end
Public Instance Methods
[]=(sql, key)
click to toggle source
Calls superclass method
# File activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb, line 180 def []=(sql, key) super.tap { @counter += 1 } end
next_key()
click to toggle source
# File activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb, line 176 def next_key "a#{@counter + 1}" end
Private Instance Methods
connection_active?()
click to toggle source
# File activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb, line 191 def connection_active? @connection.status == PG::CONNECTION_OK rescue PG::Error false end
dealloc(key)
click to toggle source
# File activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb, line 186 def dealloc(key) @connection.query "DEALLOCATE #{key}" if connection_active? rescue PG::Error end