Class: Snowflake::Client
- Inherits:
-
Object
- Object
- Snowflake::Client
- Defined in:
- lib/ruby_snowflake_client.rb
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
Instance Method Summary collapse
-
#connect(account: "", warehouse: "", database: "", schema: "", user: "", password: "", role: "") ⇒ Object
Wrap the private _connect method, as sending kwargs to Go would require wrapping the function in C as the current CGO has a limitation on accepting variadic arguments for functions.
- #fetch(sql) ⇒ Object
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
19 20 21 |
# File 'lib/ruby_snowflake_client.rb', line 19 def error @error end |
Instance Method Details
#connect(account: "", warehouse: "", database: "", schema: "", user: "", password: "", role: "") ⇒ Object
Wrap the private _connect method, as sending kwargs to Go would require wrapping the function in C as the current CGO has a limitation on accepting variadic arguments for functions.
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/ruby_snowflake_client.rb', line 23 def connect(account:"", warehouse:"", database:"", schema: "", user: "", password: "", role: "") @connection_details = { account: account, warehouse: warehouse, database: database, schema: schema, user: user, role: role } _connect(account.dup, warehouse.dup, database.dup, schema.dup, user.dup, password.dup, role.dup) if error != nil raise Error.new(@connection_details), error end true end |
#fetch(sql) ⇒ Object
40 41 42 43 44 |
# File 'lib/ruby_snowflake_client.rb', line 40 def fetch(sql) result = _fetch(sql) return result if result.valid? raise Error.new(@connection_details.merge(sql: sql)), result.error end |