Skip to content

Commit 4e9d6a7

Browse files
authored
add notes on snowflake configuration (#703)
1 parent 06a1f9b commit 4e9d6a7

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

vignettes/develop.Rmd

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,39 @@ Sys.setenv("TNS_ADMIN" = getwd())
257257
con <- dbConnect(odbc::odbc(), "OracleODBC-19")
258258
```
259259

260+
## Snowflake
261+
262+
To obtain a Snowflake account:
263+
264+
* If you're a Posit employee, reach out to James Blair.
265+
* If you're not affiliated with Posit, sign up for a [free trial](https://signup.snowflake.com/).
266+
267+
Install drivers using the [instructions on the Snowflake documentation](https://docs.snowflake.com/en/developer-guide/odbc/odbc). For MacOS, feel free to ignore sections noting that iODBC is required.
268+
269+
On MacOS and Linux:
270+
271+
* Locate your `simba.snowflake.ini` file, likely in `opt/snowflake/`. You will need `sudo` access to edit it.
272+
* Change `DriverManagerEncoding` to `UTF-16`.
273+
* Change the uncommented `ODBCInstLib` entry to the [path of your unixODBC install](https://community.snowflake.com/s/article/R-Studio-to-Snowflake-fails-with-error-Unable-to-locate-SQLGetPrivateProfileString-function).
274+
* In the Snowflake UI, navigate to Worksheets, make a new worksheet using the blue "+" button in the top right-hand corner, and run the line `SELECT SYSTEM$ALLOWLIST()`. In the output, copy the URL corresponding to `"type":"SNOWFLAKE_DEPLOYMENT"`. This Deployment URL should look like a random string, an AWS region, and the snowflake API URL, e.g. `wmc39401.us-east-1.snowflakecomputing.com`.
275+
276+
The `odbc.ini` file should look like:
277+
278+
```ini
279+
[Snowflake]
280+
Driver = Snowflake
281+
Description =
282+
uid = <uid>
283+
server = <deployment-url>
284+
```
285+
286+
The above assumes `Driver = Snowflake` is configured in `odbcinst.ini`. Then, connect by supplying the password as an argument:
287+
288+
```
289+
con <- dbConnect(odbc(), dsn = "Snowflake", pwd = Sys.getenv("snowflakePass"))
290+
```
291+
292+
In the above, the password has been set as `Sys.setenv(snowflakePass = "actualPass")`.
260293

261294
## RODBC
262295

0 commit comments

Comments
 (0)