Snowflake connection parameter configuration
snowflake_connection.Rd
Reads Snowflake connection parameters from the connections.toml
and
config.toml
files used by the Python Connector for Snowflake
and the Snowflake CLI,
or specifies them for a connection manually.
Arguments
- name
A named connection. Defaults to
$SNOWFLAKE_DEFAULT_CONNECTION_NAME
if set, thedefault_connection_name
from theconfig.toml
file (if present), and finally the[default]
section of theconnections.toml
file, if any. See Snowflake's documentation for details.- ...
Additional connection parameters. See Common parameters.
- .config_dir
The directory to search for a
connections.toml
andconfig.toml
file. Defaults to$SNOWFLAKE_HOME
or~/.snowflake
if that directory exists, otherwise it falls back to a platform-specific default. See Snowflake's documentation for details.
Common parameters
The following is a list of common connection parameters. A more complete list can be found in Snowflake's documentation for the Python Connector:
account
: A Snowflake account identifier.user
: A Snowflake username.role
: The role to use for the connection.schema
: The default schema to use for the connection.database
: The default database to use for the connection.warehouse
: The default warehouse to use for the connection.authenticator
: The authentication method to use for the connection.private_key
orprivate_key_file
: A path to a PEM-encoded private key for key-pair authentication.private_key_file_pwd
: The passphrase for the private key, if any.token
: The OAuth token to use for authentication.token_file_path
: A path to an OAuth token to use for authentication.password
: The user's Snowflake password.
Examples
if (FALSE) { # \dontrun{
# Read the default connection parameters from an existing
# connections.toml file:
conn <- snowflake_connection()
# Read a named connection from an existing connections.toml file:
conn <- snowflake_connection(name = "default")
# Override specific parameters for a connection:
conn <- snowflake_connection(
schema = "myschema",
warehouse = "mywarehouse"
)
} # }
if (FALSE) { # \dontrun{
# Pass connection parameters manually, which is useful if there is no
# connections.toml file. For example, to use key-pair authentication:
conn <- snowflake_connection(
account = "myaccount",
user = "me",
private_key = "rsa_key.p8"
)
} # }