db.utils
Some helper utilities for working with databases.
Module Contents
Functions
API
emtellipro.db.utils.snowflake_connect
Connect to Snowflake and return an SQLAlchemy engine. This handles private key parsing and usage.
For the specifics on which parameters are supported see the Snowflake documentation.
Parameters:
The connection URL; this is sent directly to create_engine.
The format is described in the Snowflake documentation.
The path to the private key, if used.
If using a private key, this is the passphrase to decrypt it. This
parameter is optional, and if it’s not set, the passphrase will be
read from either the SNOWFLAKE_PRIVATE_KEY_PASSPHRASE or
SNOWSQL_PRIVATE_KEY_PASSPHRASE environment variables.
These are passed to create_engine if private key path is
not set.
Returns:
The SQLAlchemy engine that can be used to connect to Snowflake.
Return type: Engine

