Snowflake adapter for SQLIaC — a Terraform alternative for SQL databases without a state file.
Project description
sqliac-snowflake
Snowflake adapter for SQLIaC — a Terraform alternative for SQL databases that uses no state file.
This package provides the Snowflake database connector and credential handling so SQLIaC can query Snowflake's live state and execute DDL to reconcile your declared resource definitions.
Installation
pip install sqliac-snowflake
This also installs sqliac (the CLI and core engine) and snowflake-connector-python.
Quick Start
Credentials
SQLIaC looks for Snowflake credentials in two places, in order of precedence:
1. Environment variables (recommended)
export SNOWFLAKE_ACCOUNT="my_account"
export SNOWFLAKE_USER="my_user"
export SNOWFLAKE_PASSWORD="my_password"
export SNOWFLAKE_WAREHOUSE="my_warehouse"
# Optional:
export SNOWFLAKE_DATABASE="my_db"
export SNOWFLAKE_SCHEMA="my_schema"
export SNOWFLAKE_ROLE="my_role"
2. Configuration file .sqliac/provider/credentials.toml
[snowflake]
account = "my_account"
user = "my_user"
password = "my_password"
warehouse = "my_warehouse"
Environment variables take precedence. Run sqliac init to scaffold this file.
Private key authentication
Set SNOWFLAKE_PRIVATE_KEY_PATH (relative path inside .sqliac/provider/) or SNOWFLAKE_PRIVATE_KEY (PEM string), optionally with SNOWFLAKE_PRIVATE_KEY_PASSPHRASE:
export SNOWFLAKE_ACCOUNT="my_account"
export SNOWFLAKE_USER="my_user"
export SNOWFLAKE_PRIVATE_KEY_PATH="rsa_key.p8"
Using SQLIaC with Snowflake
# Scaffold a project with Snowflake examples
sqliac init
# Configure your credentials and edit definitions/
# then preview and apply:
sqliac apply --dry-run
sqliac apply
The init command creates Snowflake-ready example templates for database, schema, and table resources under .sqliac/provider/.
Provider config
The adapter is registered via the sqliac.adapters entry point group. Your .sqliac/provider/config.toml should start with a top-level [snowflake] section:
[snowflake.database.ddl_command]
create = "CREATE OR ALTER"
alter = "CREATE OR ALTER"
drop = "DROP"
[snowflake.database.ddl_context]
object_name = "MODELING"
transient = false
data_retention_time_in_days = 1
wait_time = 0
[snowflake.database.ddl_context.depends_on]
API
The adapter exposes three classes, all available from the top-level package:
from sqliac_snowflake import SnowflakeAdapter, SnowflakeCredentials, SnowflakeConnectionManager
| Class | Role |
|---|---|
SnowflakeAdapter |
Concrete BaseAdapter — executes queries and manages connections |
SnowflakeCredentials |
Frozen dataclass — validates and stores account, user, password, warehouse, etc. |
SnowflakeConnectionManager |
Thread-safe per-thread connection pool with keypair and password auth |
All three are registered via the entry point sqliac.adapters / snowflake and resolved automatically by the SQLIaC CLI. You don't need to import them directly unless building custom tooling.
Supported credential fields
| Field | Required | Env var |
|---|---|---|
account |
Yes | SNOWFLAKE_ACCOUNT |
user |
Yes | SNOWFLAKE_USER |
password |
(one of) | SNOWFLAKE_PASSWORD |
private_key_path |
(one of) | SNOWFLAKE_PRIVATE_KEY_PATH |
private_key |
(one of) | SNOWFLAKE_PRIVATE_KEY |
private_key_passphrase |
No | SNOWFLAKE_PRIVATE_KEY_PASSPHRASE |
warehouse |
No | SNOWFLAKE_WAREHOUSE |
database |
No | SNOWFLAKE_DATABASE |
schema |
No | SNOWFLAKE_SCHEMA |
role |
No | SNOWFLAKE_ROLE |
License
MIT — see the sqliac package for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sqliac_snowflake-0.1.8.tar.gz.
File metadata
- Download URL: sqliac_snowflake-0.1.8.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Pop!_OS","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5487201842b02890643e9624d7a1b8f1b743cbb0b459efabe0d297e5d833f06d
|
|
| MD5 |
ee28eeccc93bdb15dd8347eea999acdc
|
|
| BLAKE2b-256 |
194d94c59e6a6e0f4069834367b34df9cec1060d32996c8769ed482fb4997f80
|
File details
Details for the file sqliac_snowflake-0.1.8-py3-none-any.whl.
File metadata
- Download URL: sqliac_snowflake-0.1.8-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Pop!_OS","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b13698bd8633d15ffd225531a734010ef2690fa708676ccd9df95495da0bdb18
|
|
| MD5 |
e5ea3c99f326ae9f0680ae5c2b5b683b
|
|
| BLAKE2b-256 |
4cc650a6495fe0f7a88b357617768e75955e75e73d3290e52fe2fbb175f6e162
|