class ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::StatementPool

Public Class Methods

new(connection, max) click to toggle source
Calls superclass method
# File lib/active_record/connection_adapters/postgresql_adapter.rb, line 180
def initialize(connection, max)
  super(max)
  @connection = connection
  @counter = 0
end

Public Instance Methods

[]=(sql, key) click to toggle source
Calls superclass method
# File lib/active_record/connection_adapters/postgresql_adapter.rb, line 190
def []=(sql, key)
  super.tap { @counter += 1 }
end
next_key() click to toggle source
# File lib/active_record/connection_adapters/postgresql_adapter.rb, line 186
def next_key
  "a#{@counter + 1}"
end

Private Instance Methods

connection_active?() click to toggle source
# File lib/active_record/connection_adapters/postgresql_adapter.rb, line 200
def connection_active?
  @connection.status == PGconn::CONNECTION_OK
rescue PGError
  false
end
dealloc(key) click to toggle source
# File lib/active_record/connection_adapters/postgresql_adapter.rb, line 196
def dealloc(key)
  @connection.query "DEALLOCATE #{key}" if connection_active?
end