Module RR::ConnectionExtenders
In: lib/rubyrep/connection_extenders/jdbc_extender.rb
lib/rubyrep/connection_extenders/connection_extenders.rb
lib/rubyrep/connection_extenders/mysql_extender.rb
lib/rubyrep/connection_extenders/postgresql_extender.rb

Connection extenders provide additional database specific functionality not coming in the ActiveRecord library. This module itself only provides functionality to register and retrieve such connection extenders.

Methods

Classes and Modules

Module RR::ConnectionExtenders::JdbcSQLExtender
Module RR::ConnectionExtenders::MysqlExtender
Module RR::ConnectionExtenders::PostgreSQLExtender
Class RR::ConnectionExtenders::DummyActiveRecord

Public Class methods

Free up all cached connections

Returns the connection cache hash.

Sets a new connection cache

Creates database connections by calling db_connect_without_cache with the provided config configuration hash. A new database connection is created only if no according cached connection is available.

Creates an ActiveRecord database connection according to the provided config connection hash. Possible values of this parameter are described in ActiveRecord::Base#establish_connection. The database connection is extended with the correct ConnectionExtenders module.

ActiveRecord only allows one database connection per class. (It disconnects the existing database connection if a new connection is established.) To go around this, we delete ActiveRecord‘s memory of the existing database connection as soon as it is created.

Returns a Hash of currently registered connection extenders. (Empty Hash if no connection extenders were defined.)

Installs the configured logger (if any) into the database connection.

  • db_connection: database connection (as produced by db_connect)
  • config: database configuration (as provided to db_connect)

Registers one or multiple connection extender. extender is a Hash with

  key::   The adapter symbol as used by ActiveRecord::Connection Adapters, e. g. :postgresql
  value:: Name of the module implementing the connection extender

Returns the current cache status (true if caching is used; false otherwise).

If status == true: enable the cache. If status == false: don’ use cache Returns the old connection caching status

[Validate]