Class: Barthes::Client::Pgsql

Inherits:
Rdb
  • Object
show all
Defined in:
lib/barthes/client/pgsql.rb

Instance Method Summary collapse

Methods inherited from Rdb

#action

Constructor Details

#initialize(env) ⇒ Pgsql

Returns a new instance of Pgsql.



5
6
7
8
9
10
11
12
13
# File 'lib/barthes/client/pgsql.rb', line 5

def initialize(env)
  @client = PG::connect(
    host: env['host'],
    user: env['user'],
    password: env['password'],
    dbname: env['database'],
    sslmode: 'disable'
  )
end

Instance Method Details

#execute_query(query) ⇒ Object



15
16
17
# File 'lib/barthes/client/pgsql.rb', line 15

def execute_query(query)
  @client.exec(query)
end