Class: Barthes::Client::Mysql

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

Instance Method Summary collapse

Methods inherited from Rdb

#action

Constructor Details

#initialize(env) ⇒ Mysql

Returns a new instance of Mysql.



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

def initialize(env)
	@client = Mysql2::Client.new(
	  host: env['host'],
	  username: env['user'],
	  password: env['password'],
	  database: env['database']
	)
end

Instance Method Details

#execute_query(query) ⇒ Object



14
15
16
# File 'lib/barthes/client/mysql.rb', line 14

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