Method: Remi::DataSource::Postgres#pg_conn

Defined in:
lib/remi/data_source/postgres.rb

#pg_connObject



24
25
26
27
28
29
30
31
32
33
# File 'lib/remi/data_source/postgres.rb', line 24

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