Skip to content

Commit

Permalink
Snowflake docs (#3611)
Browse files Browse the repository at this point in the history
* Snowflake docs

* Snowflake docs

* Update docs/docs/deploy/credentials/snowflake.md

---------

Co-authored-by: Benjamin Egelund-Müller <b@egelund-muller.com>
  • Loading branch information
esevastyanov and begelundmuller authored Dec 5, 2023
1 parent f9d0ccf commit cd1222c
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/docs/deploy/credentials/credentials.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ For instructions on how to create a service account and set credentials in Rill
- [MotherDuck](./motherduck.md)
- [Amazon Athena](./athena.md)
- [BigQuery](./bigquery.md)
- [Snowflake](./snowflake.md)
30 changes: 30 additions & 0 deletions docs/docs/deploy/credentials/snowflake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
title: Snowflake
description: Connect to data in Snowflake
sidebar_label: Snowflake
sidebar_position: 60
---

<!-- WARNING: There are links to this page in source code. If you move it, find and replace the links and consider adding a redirect in docusaurus.config.js. -->

## How to configure credentials in Rill

How you configure access to Snowflake depends on whether you are developing a project locally using `rill start` or are setting up a deployment using `rill deploy`.

### Configure credentials for local development

When developing a project locally, Rill uses the credentials passed via a source config `dsn` (Snowflake connection string) field or via `--env connector.snowflake.dsn=...` while running `rill start`.
Rill uses the following [format](https://pkg.go.dev/github.com/snowflakedb/gosnowflake#hdr-Connection_String) of Snowflake connection string:
```
my_user_name:my_password@ac123456/my_database/my_schema?warehouse=my_warehouse&role=my_user_role
```

### Configure credentials for deployments on Rill Cloud

Similarly to the local development, when deploying a project to Rill Cloud, credentials might be passed via Snowflake connection string as a source config `dsn` field.

Alternatively, you can pass/update the credentials used by Rill Cloud by running:
```
rill env configure
```
Note that you must `cd` into the Git repository that your project was deployed from before running `rill env configure`.
6 changes: 5 additions & 1 deletion docs/docs/reference/project-files/sources.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ In your Rill project directory, create a `<source_name>.yaml` file in the `sourc
- _`athena`_ - a data store defined in Amazon Athena
- _`postgres`_ - data stored in Postgres
- _`sqlite`_ - data stored in SQLite
- _`snowflake`_ - data stored in Snowflake
- _`bigquery`_ - data stored in BigQuery

**`uri`**
— the URI of the remote connector you are using for the source _(required for type: http, s3, gcs)_. Rill also supports glob patterns as part of the URI for S3 and GCS.
Expand All @@ -31,7 +33,7 @@ In your Rill project directory, create a `<source_name>.yaml` file in the `sourc
- _`/path/to/file.csv`_ — the path to your file

**`sql`**
- Optionally sets the SQL query to extract data from a SQL source (DuckDB/Motherduck/Athena/BigQuery/Postrgres/SQLite)
- Optionally sets the SQL query to extract data from a SQL source (DuckDB/Motherduck/Athena/BigQuery/Postrgres/SQLite/Snowflake)

**`region`**
— Optionally sets the cloud region of the bucket or Athena you want to connect to. Only available for S3 and Athena.
Expand Down Expand Up @@ -93,3 +95,5 @@ duckdb:
delim: "'|'"
columns: "columns={'FlightDate': 'DATE', 'UniqueCarrier': 'VARCHAR', 'OriginCityName': 'VARCHAR', 'DestCityName': 'VARCHAR'}"
```
**`dsn`** - Optionally set Snowflake connection string. Refer Snowflake [docs](https://pkg.go.dev/github.com/snowflakedb/gosnowflake#hdr-Connection_String) for format
4 changes: 2 additions & 2 deletions runtime/drivers/snowflake/snowflake.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ var spec = drivers.Spec{
DisplayName: "Snowflake Connection String",
Type: drivers.StringPropertyType,
Required: false,
Href: "https://pkg.go.dev/github.com/snowflakedb/gosnowflake#hdr-Connection_Parameters",
Placeholder: "my_user_name:my_password@ac123456/my_database/my_schema?my_warehouse=inventory_warehouse&role=my_user_role",
Href: "https://pkg.go.dev/github.com/snowflakedb/gosnowflake#hdr-Connection_String",
Placeholder: "my_user_name:my_password@ac123456/my_database/my_schema?warehouse=my_warehouse&role=my_user_role",
Hint: "Either set this or pass --env connector.snowflake.dsn=... to rill start",
},
},
Expand Down

0 comments on commit cd1222c

Please sign in to comment.