View source: R/driver-snowflake.R
snowflake | R Documentation |
Connect to a Snowflake account via the Snowflake ODBC driver.
In particular, the custom dbConnect()
method for the Snowflake ODBC driver
detects ambient OAuth credentials on platforms like Snowpark Container
Services or Posit Workbench.
snowflake()
## S4 method for signature 'Snowflake'
dbConnect(
drv,
account = Sys.getenv("SNOWFLAKE_ACCOUNT"),
driver = NULL,
warehouse = NULL,
database = NULL,
schema = NULL,
uid = NULL,
pwd = NULL,
...
)
drv |
an object that inherits from DBIDriver, or an existing DBIConnection object (in order to clone an existing connection). |
account |
A Snowflake account identifier,
e.g. |
driver |
The name of the Snowflake ODBC driver, or |
warehouse |
The name of a Snowflake compute warehouse, or |
database |
The name of a Snowflake database, or |
schema |
The name of a Snowflake database schema, or |
uid , pwd |
Manually specify a username and password for authentication. Specifying these options will disable ambient credential discovery. |
... |
Further arguments passed on to |
An OdbcConnection
object with an active connection to a Snowflake
account.
## Not run:
# Use ambient credentials.
DBI::dbConnect(odbc::snowflake())
# Use browser-based SSO (if configured). Only works on desktop.
DBI::dbConnect(
odbc::snowflake(),
account = "testorg-test_account",
authenticator = "externalbrowser"
)
# Use a traditional username & password.
DBI::dbConnect(
odbc::snowflake(),
account = "testorg-test_account",
uid = "me",
pwd = rstudioapi::askForPassword()
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.