Convenience constructor for Snowflake connections. Uses the ODBC reader
under the hood with the Snowflake driver, and takes advantage of the
dedicated Snowflake handling in the ggsql Rust core:
Usage
snowflake_reader(
account = NULL,
warehouse = NULL,
database = NULL,
schema = NULL,
role = NULL,
user = NULL,
password = NULL,
authenticator = NULL,
connection_name = NULL,
driver = NULL,
...,
connection_string = NULL
)Arguments
- account
Snowflake account identifier (e.g.
"xy12345"or"xy12345.us-east-1"). Translated toServer={account}.snowflakecomputing.comin the connection string.- warehouse, database, schema, role
Snowflake session defaults.
- user, password
User credentials. Prefer a DSN,
connection_name, orauthenticator = "externalbrowser"over hard-coded passwords.- authenticator
Snowflake authenticator (e.g.
"externalbrowser","snowflake_jwt","oauth").- connection_name
Named entry in
~/.snowflake/connections.tomlwhose fields will fill in the remaining connection parameters.- driver
Override the ODBC driver name (defaults to
"Snowflake").- ...
Additional named
key = valueparameters appended to the connection string.- connection_string
A full raw connection string, bypassing the named arguments.
Driver={Snowflake};is prepended if it isn't already present.
Details
Special handling of Snowflake includes:
If
connection_nameis supplied (orConnectionName=appears in the connection string), it is resolved against~/.snowflake/connections.toml.When running inside Posit Workbench, an OAuth token is automatically injected if one is available.
Schema introspection uses Snowflake's
SHOW DATABASES / SCHEMAS / TABLEScommands rather thaninformation_schema.
Requires the Snowflake ODBC driver to be installed on the system.
See also
Other readers:
custom_reader(),
duckdb_reader(),
odbc_reader()
Examples
if (FALSE) { # \dontrun{
# Using a named connection from ~/.snowflake/connections.toml
reader <- snowflake_reader(connection_name = "my_workbench")
# Browser-based SSO
reader <- snowflake_reader(
account = "xy12345.us-east-1",
user = "alice@example.com",
authenticator = "externalbrowser",
warehouse = "COMPUTE_WH",
database = "ANALYTICS",
schema = "PUBLIC",
role = "ANALYST"
)
} # }
