Module: Remi::DataSubject::Postgres

Included in:
Remi::DataSource::Postgres, Remi::DataTarget::Postgres
Defined in:
lib/remi/data_subject/postgres.rb

Instance Method Summary collapse

Instance Method Details

#connectionObject



3
4
5
6
7
8
9
10
11
12
# File 'lib/remi/data_subject/postgres.rb', line 3

def connection
  @connection ||= PG.connect(
    host:     @credentials[:host] || 'localhost',
    port:     @credentials[:port] || 5432,
    dbname:   @credentials[:dbname],
    user:     @credentials[:user] || `whoami`.chomp,
    password: @credentials[:password],
    sslmode:  @credentials[:sslmode] || 'allow'
  )
end