Module: Rooq::Adapters::PostgreSQL

Defined in:
lib/rooq/adapters/postgresql.rb

Defined Under Namespace

Classes: ConnectionPool

Class Method Summary collapse

Class Method Details

.context(connection) ⇒ Rooq::Context

Create a Context configured for PostgreSQL.

Parameters:

  • connection (PG::Connection)

    a single connection

Returns:



105
106
107
# File 'lib/rooq/adapters/postgresql.rb', line 105

def self.context(connection)
  Rooq::Context.using(connection, dialect: Rooq::Dialect::PostgreSQL.new)
end

.pooled_context(pool) ⇒ Rooq::Context

Create a Context with a connection pool.

Parameters:

Returns:



112
113
114
# File 'lib/rooq/adapters/postgresql.rb', line 112

def self.pooled_context(pool)
  Rooq::Context.using_pool(pool, dialect: Rooq::Dialect::PostgreSQL.new)
end