Skip to content

Commit

Permalink
docs(snowflake): document using private key to connect to snowflake
Browse files Browse the repository at this point in the history
  • Loading branch information
gforsyth authored and cpcloud committed Aug 21, 2024
1 parent 88f78da commit c70f55a
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion docs/backends/snowflake.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,41 @@ con = ibis.snowflake.connect(

```python
con = ibis.connect(
f"snowflake://{user}@{account}/{database}?warehouse={warehouse}",
f"snowflake://{user}@{account}/{database}/{schema}?warehouse={warehouse}",
authenticator="externalbrowser",
)
```

### Authenticating with Key Pair Authentication

Ibis supports connecting to Snowflake warehouses using private keys.

You can use it in the explicit-parameters-style or in the URL-style connection
APIs.

#### Explicit

```python
con = ibis.snowflake.connect(
user="user",
account="safpqpq-sq55555",
database="my_database",
schema="my_schema",
warehouse="my_warehouse",
# extracted private key from .p8 file
private_key=os.getenv(SNOWFLAKE_PKEY),
)
```

#### URL

```python
con = ibis.connect(
f"snowflake://{user}@{account}/{database}/{schema}?warehouse={warehouse}",
private_key=os.getenv(SNOWFLAKE_PKEY),
)
```

### Looking up your Snowflake organization ID and user ID

A [Snowflake account
Expand Down

0 comments on commit c70f55a

Please sign in to comment.