Skip to content

Latest commit

 

History

History
48 lines (27 loc) · 1.05 KB

README.md

File metadata and controls

48 lines (27 loc) · 1.05 KB

Olaf

Gem Version CircleCI

Olaf is a small Ruby wrapper for Snowflake queries.

Olaf

Dependencies

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

Installation

If you don't have Olaf, try this:

$ gem install olaf

Getting started

Olaf helps developers to represent Snowflake queries as objects, to have more control in the code and in tests.

Example

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'>]