Module: Simple::SQL::Connection

Defined in:
lib/simple/sql/connection.rb

Overview

private

Defined Under Namespace

Modules: ActiveRecordConnection Classes: PgConnection

Constant Summary collapse

Logging =
::Simple::SQL::Logging

Class Method Summary collapse

Class Method Details

.active_record_connectionObject



7
8
9
# File 'lib/simple/sql/connection.rb', line 7

def self.active_record_connection
  ActiveRecordConnection
end

.pg_connection(database_url) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/simple/sql/connection.rb', line 11

def self.pg_connection(database_url)
  config = ::Simple::SQL::Config.parse_url(database_url)

  Logging.info "Connecting to #{database_url}"

  raw_connection = PG::Connection.new(config)
  PgConnection.new(raw_connection)
end