Snowflake

Installation

Use extras snowflake to install all required packages.

$ pip install mara-db[snowflake]

The official snowsql client is required. See the Installing SnowSQL page for installation details.

Configuration examples

import mara_db.dbs
mara_db.config.databases = lambda: {
    'dwh': mara_db.dbs.SnowflakeDB(
        account='kaXXXXX.regio.cloud',
        user='<user>',
        password='<my_strong_password>',
        database='dwh'),
}


API reference

This section contains database specific API in the module.

Configuration

class mara_db.dbs.SnowflakeDB(connection: Optional[str] = None, account: Optional[str] = None, user: Optional[str] = None, password: Optional[str] = None, database: Optional[str] = None, private_key_file: Optional[str] = None, private_key_passphrase: Optional[str] = None)

A database connection to a Snowflake database

__init__(connection: Optional[str] = None, account: Optional[str] = None, user: Optional[str] = None, password: Optional[str] = None, database: Optional[str] = None, private_key_file: Optional[str] = None, private_key_passphrase: Optional[str] = None) None

Connection information for a Snowflake database

Parameters
  • connection – The connection name definend in the snowsql configuration ~/.snowsql/config

  • account – The account identifier. See here: https://docs.snowflake.com/en/user-guide/admin-account-identifier.html

  • user – The user name

  • password – The password of the user

  • database – The database name

  • private_key_file – Path to private key file in PEM format used for key pair authentication. The private key file must be encrypted.

  • private_key_passphrase – The passphrase for the private key file.

property sqlalchemy_url

Returns the SQLAlchemy url for a database