Class: RedshiftCsv::Connection
- Inherits:
-
Object
- Object
- RedshiftCsv::Connection
- Defined in:
- lib/redshift_csv/connection.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
-
#initialize ⇒ Connection
constructor
A new instance of Connection.
- #run(sql) ⇒ Object
Constructor Details
#initialize ⇒ Connection
Returns a new instance of Connection.
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/redshift_csv/connection.rb', line 5 def initialize @config = { dbname: RedshiftCsv.config.dbname, user: RedshiftCsv.config.user, password: RedshiftCsv.config.password, host: RedshiftCsv.config.host, sslmode: 'require', port: 5439 } end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
3 4 5 |
# File 'lib/redshift_csv/connection.rb', line 3 def config @config end |
Instance Method Details
#run(sql) ⇒ Object
16 17 18 |
# File 'lib/redshift_csv/connection.rb', line 16 def run(sql) connection.exec(sql) end |