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