Class: Infrataster::Contexts::MysqlQueryContext
- Inherits:
-
BaseContext
- Object
- BaseContext
- Infrataster::Contexts::MysqlQueryContext
- Defined in:
- lib/infrataster/contexts/mysql_query_context.rb
Instance Method Summary collapse
Instance Method Details
#results ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/infrataster/contexts/mysql_query_context.rb', line 7 def results = {port: 3306, user: 'root', password: ''} if server.[:mysql] = .merge(server.[:mysql]) end server.forward_port([:port]) do |address, new_port| client = Mysql2::Client.new( host: address, port: new_port, username: [:user], password: [:password], ) client.query(resource.query) end end |