Skip to content

Commit

Permalink
a bit more readme cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
reidnimz committed Nov 29, 2023
1 parent f017603 commit 40b9c7a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ This library is implemented in ruby and while it leverages some libraries that h

# Usage

## Create a client

Add to your Gemfile or use `gem install rb-snowflake-client`
```ruby
gem "rb-snowflake-client"
Expand Down Expand Up @@ -55,6 +57,8 @@ Available ENV variables (see below in the config section for details)
- `SNOWFLAKE_THREAD_SCALE_FACTOR`
- `SNOWFLAKE_HTTP_RETRIES`

## Make quieries

Once you have a client, make queries
```ruby
# will get all data in memory
Expand All @@ -66,7 +70,11 @@ result.each do |row|
puts row["name"] # or case insensitive strings
puts row.to_h # and can produce a hash with keys/values
end
```

## Stream results

```ruby
# You can also stream results and not hold them all in memory.
# The client will prefetch the next data partition only. If you
# have some IO in your processing there should usually be data
Expand All @@ -77,6 +85,14 @@ result.each do |row|
end
```

## Switching warehouses

Clients are not warehouse specific, you can override the default warehouse per query

```ruby
client.query("SELECT * FROM BIGTABLE", warehouse: "FAST_WH")
```

# Configuration Options

The client supports the following configuration options, each with their own getter/setter except connection pool options which must be set at construction. Additionally, all except logger can be configured with environment variables (see above, but the pattern is like: "SNOWFLAKE_HTTP_RETRIES".
Expand Down

0 comments on commit 40b9c7a

Please sign in to comment.