Class: Olaf::Snowflake

Inherits:
Object
  • Object
show all
Defined in:
lib/olaf/drivers/snowflake.rb

Constant Summary collapse

WRAPPED_ERRORS =
[Sequel::DatabaseError].freeze

Instance Method Summary collapse

Constructor Details

#initialize(**config) ⇒ Snowflake

Returns a new instance of Snowflake.



7
8
9
# File 'lib/olaf/drivers/snowflake.rb', line 7

def initialize(**config)
  @config = config
end

Instance Method Details

#fetch(olaf_query) ⇒ Object



11
12
13
14
15
# File 'lib/olaf/drivers/snowflake.rb', line 11

def fetch(olaf_query)
  conn.fetch(olaf_query.sql_template, **olaf_query.variables).all
rescue *WRAPPED_ERRORS => error
  raise QueryExecutionError.new(error.message, olaf_query)
end