A CLI for Snowflake project scaffolding, execution, and validation.
Project description
vdsnow ❄️
A powerful CLI for scaffolding, managing, and deploying Snowflake projects with a focus on developer experience and structured, database-as-code workflows.
vdsnow is a smart wrapper around the official Snowflake CLI (snowcli) designed to streamline the entire development lifecycle. It enforces a consistent project structure, automates script generation, and provides context-aware execution to prevent common errors and reduce boilerplate.
Key Features
- Interactive Project Scaffolding: Run
vdsnow setup initto generate a complete, standardized folder structure for your databases, schemas, and object types. - Automatic Script Generation: The
vdsnow setup refresh-scriptscommand scans your project and automatically creates or updates manifest files (setup.sql), ensuring your deployment scripts are always in sync with your source code. - Context-Aware Execution: Never write
USE SCHEMA ...again! Thevdsnow sql executecommand automatically determines the correct database and schema context from the file path you provide. - Sandbox Development Mode: Use the
--localflag or set theVDSNOW_ENV=localenvironment variable to seamlessly redirect all deployments to your personal development schema, keeping your main branches clean and your local testing safe. - Connection Management: Easily initialize your
config.tomland.envfiles for both local development (with a private key path) and CI/CD (headlessconnection with a raw private key). - Built-in Validation: Run
vdsnow check folder-structureto find broken links in your setup files or identify SQL files that haven't been included in any deployment script.
Installation
Ensure you have Python 3.8+ and the Snowflake CLI installed.
pip install vdsnow
Getting Started: A 5-Minute Tutorial
1. Initialize Your Project
This will create the snowflake_structure/ and setup/ directories.
vdsnow setup init
# Follow the prompts:
# Enter the database name: raw
# Enter a schema name: main
# Do you want to add another schema? [y/N]: n
2. Configure Your Connection
This creates config.toml and a .env file for your secrets.
vdsnow connection init
# Follow the prompts to enter your account, user, etc.
# These values will be saved to your .env file.
Action Required: You must now generate a private/public key pair for JWT authentication, assign the public key to your Snowflake user, and place the private key in a secure location (e.g., ~/.ssh/). Update the PRIVATE_KEY_PATH in your .env file if needed.
3. Test Your Connection
This command wraps snow connection test to confirm your credentials and keys are working.
vdsnow connection test
# Expected output: Connection local tested successfully.
4. Deploy to Your Sandbox
Let's deploy the initial project structure to your personal development schema. First, set your environment for local development.
# Tell vdsnow to always use your local sandbox context
export VDSNOW_ENV=local
# Now execute the main setup file
vdsnow sql execute -f setup/raw/setup.sql
# The tool will print a warning that --local mode is active
# and run the script against the DB/Schema from your .env file.
You now have a fully configured, deployable Snowflake project!
Command Reference
vdsnow setup
Commands for managing the project's folder structure.
init: Interactively scaffolds a new project.add-database: Adds a new database directory to the structure.add-schema: Adds a new schema directory to a specified database.refresh-scripts: Scans the entiresnowflake_structure/and intelligently updates allsetup/manifest files.recreate: Deletes the existing structure and re-initializes it. (Use with caution!)
vdsnow connection
Commands for managing connection configurations.
init: Creates or updatesconfig.tomland.envwith your connection details.test: Tests the default connection defined inconfig.toml.
vdsnow sql
Commands for executing SQL against Snowflake.
execute: Executes SQL with automatic context.-f, --file FILE_PATH: Executes a SQL file. Context is derived from the path (e.g.,setup/db/schema/...).-q, --query QUERY_STRING: Executes a raw SQL string. Context is taken from your default connection.--local: A powerful flag that forces the command to use the database and schema from your.envfile, overriding the context from the file path. This is ideal for testing in a personal sandbox.
vdsnow check
Commands for validating the project.
folder-structure: Checks for broken!sourcelinks in your setup files (errors) and for unreferenced.sqlfiles in your structure (warnings).version: Checks the installed version of the Snowflake CLI.
CI/CD and Headless Connections
The connection init command automatically adds a [connections.headless] section to your config.toml. This connection is configured to use private_key_raw, allowing you to pass the raw content of your private key as a CI/CD secret (e.g., a GitHub Actions secret) rather than relying on a file path.
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 vdsnow-0.1.0.tar.gz.
File metadata
- Download URL: vdsnow-0.1.0.tar.gz
- Upload date:
- Size: 62.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.26
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb20eab6bf5795a2d8d0eb351f96b006d1a897f0a4df278de6ae45543b179f33
|
|
| MD5 |
ec5e30915aa1872cb33d1d55f02602d1
|
|
| BLAKE2b-256 |
7ca4d8031737e8c53109b497fecafba48cba2b8845fc909351d419cfc0195616
|
File details
Details for the file vdsnow-0.1.0-py3-none-any.whl.
File metadata
- Download URL: vdsnow-0.1.0-py3-none-any.whl
- Upload date:
- Size: 15.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.26
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bfd87613c2b1ef98326b3c5f77883ef24139d9a8ed7a4cd5063b52fdc718e98d
|
|
| MD5 |
09ee0d99ef14f192c6080440c24b1f4f
|
|
| BLAKE2b-256 |
59c8b474283027bebda0a5e63eb11cffb0dc10d39ae4ce429d2fa45d98423779
|