Olaf is a small Ruby wrapper for Snowflake queries.
olaf
requires Ruby 2.6 or later, sequel
and odbc
driver to connect with DBs.
Install dependencies using bundler
is easy as run:
bundle install
If you don't have Olaf, try this:
$ gem install olaf
Olaf helps developers to represent Snowflake queries as objects, to have more control in the code and in tests.
class FetchUsers
include Olaf::QueryDefinition
template './snowflake/users_in_department.sql'
argument :department_id
row_object User
end
query = FetchUsers.prepare(department_id: 1337)
Olaf.execute(query)
=> [#<User id: 41, department_id: 1337, name: 'Ian'>]