Export Snowflake object definitions for use in a DCM project
Project description
dcmassist
Turn an existing Snowflake database into a DCM project in seconds.
You've decided to manage your Snowflake schema with Declarative Change Management. Now you need a DEFINE TABLE … block for every table, view, schema, stage, sequence, file format, and tag you already have. Hand-writing thousands of these is the wrong way to start.
Point dcmassist at your database and it produces a complete, ready-to-commit DCM project — manifest.yml, Makefile, definitions, optional macros, the lot.
dcmassist export --database MYDB --out-folder ./my-dcm-project
That's it. Commit, deploy, done.
Why dcmassist
- Zero-to-DCM in one command. No bespoke scripts, no copy-pasting from
GET_DDL, no fixing up identifier quoting by hand. - Multi-environment from day one. Database names are templated to
{{ database }}automatically, so the same project deploys to dev, staging, and prod. - Safe with secrets. Stage definitions are synthesized without credentials — credentials live on storage integrations, not in git. You won't accidentally commit AWS keys.
- Built for real Snowflake accounts. Paginates
SHOWpast the 10K-row cap. Quotes identifiers properly so leading-digit and lowercase names survive. Skips objects your role can't see instead of failing the run. - Predictable output. Per-type files, deterministic ordering, automatic chunking when a type grows beyond a threshold. Diffs stay readable as your project evolves.
- Optional Jinja macros. With
--use-macros, every definition is a one-line macro invocation, so a column rename touches one file instead of hundreds. - Observable runs. Live status panel while it works; a per-run log file you can tail when something looks wrong.
What you get
my-dcm-project/
├── manifest.yml # targets, configurations, templating defaults
├── Makefile # deploy, plan, sync, validate
├── dcmassist.log # per-run log of options + per-object results
└── sources/
├── definitions/
│ ├── schema.sql # one file per type
│ ├── table.sql # auto-chunked into table2.sql, table3.sql … past the threshold
│ ├── view.sql
│ ├── sequence.sql
│ ├── stage.sql # synthesized — no credentials
│ ├── file_format.sql
│ └── tag.sql
└── macros/ # only with --use-macros
└── <type>.sql
Install
Requires Python ≥ 3.10 and a configured snow CLI connection.
uv tool install dcmassist # recommended
# or
pipx install dcmassist
# or
pip install dcmassist
Quick examples
Export a whole database:
dcmassist export --database MYDB
Just tables and views from one schema, with macros, into a custom folder:
dcmassist export \
--database MYDB \
--schema PUBLIC \
--include Table --include View \
--use-macros \
--out-folder ./project
Multi-environment manifest with templated configurations:
dcmassist export \
--database MYDB \
--target dev --target prod \
--configuration STAGING \
--templating-default warehouse=COMPUTE_WH
Run dcmassist export --help for every option.
Type support
Implemented: Schema, Table, View, Sequence, Stage, File format, Tag.
Recognized but not yet exported: Dynamic table, Task, Alert, SQL function, Data metric function, SQL procedure, Role, Database role, Grant, Authentication policy. Including these in --include is accepted (they pass validation) but they produce no output yet — contributions welcome.
Database is intentionally never exported: DCM rejects DEFINE DATABASE for the project's own parent database.
Configuration
| Environment variable | Effect |
|---|---|
DCMASSIST_EXPORT_OBJECTS_PER_FILE |
Max objects per chunked SQL file (default: 100). Lower it if your DDL files grow uncomfortably large. |
DCMASSIST_NO_STATUS=1 |
Disable the live status panel (also auto-disabled on non-TTY and NO_COLOR=1). |
| Exit code | Meaning |
|---|---|
0 |
Success |
4 |
Ran to completion but exported nothing — every object failed (typically permission errors) |
5 |
Setup error — bad env var, or non-empty output folder without --force |
Project status
Pre-1.0. The output layout, CLI flags, and log format are stable enough to use; expect breaking changes between minor versions until 1.0. Issues and pull requests welcome at github.com/jamiekt/dcmassist.
License
MIT.
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 dcmassist-0.1.15.tar.gz.
File metadata
- Download URL: dcmassist-0.1.15.tar.gz
- Upload date:
- Size: 168.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cbd23e12fcfccf7d58d0868cff0ce578cfc88de12012e463cdecb381f6bf01c8
|
|
| MD5 |
61f35efe75ebf644c995a4b1d9fcd2d8
|
|
| BLAKE2b-256 |
0728de6c63dacb2f7ab644d5880f6976eb39a950e35f847b585dcd8d98ba334c
|
Provenance
The following attestation bundles were made for dcmassist-0.1.15.tar.gz:
Publisher:
ci.yml on jamiekt/dcmassist
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dcmassist-0.1.15.tar.gz -
Subject digest:
cbd23e12fcfccf7d58d0868cff0ce578cfc88de12012e463cdecb381f6bf01c8 - Sigstore transparency entry: 1622831023
- Sigstore integration time:
-
Permalink:
jamiekt/dcmassist@6297a1efb8a546b995ce710b9253a0912b14bc01 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/jamiekt
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@6297a1efb8a546b995ce710b9253a0912b14bc01 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file dcmassist-0.1.15-py3-none-any.whl.
File metadata
- Download URL: dcmassist-0.1.15-py3-none-any.whl
- Upload date:
- Size: 34.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
80deb55f2d325e5ea987b596fe51ef2e0fd881fc82d6f12e5f4a0a496ceed519
|
|
| MD5 |
347d61549a891fd3657d0492ad8e443f
|
|
| BLAKE2b-256 |
51fd7be2e617de464f425fcd2b57c76d6103cc57e282eb8554578ac921641668
|
Provenance
The following attestation bundles were made for dcmassist-0.1.15-py3-none-any.whl:
Publisher:
ci.yml on jamiekt/dcmassist
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dcmassist-0.1.15-py3-none-any.whl -
Subject digest:
80deb55f2d325e5ea987b596fe51ef2e0fd881fc82d6f12e5f4a0a496ceed519 - Sigstore transparency entry: 1622831153
- Sigstore integration time:
-
Permalink:
jamiekt/dcmassist@6297a1efb8a546b995ce710b9253a0912b14bc01 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/jamiekt
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@6297a1efb8a546b995ce710b9253a0912b14bc01 -
Trigger Event:
workflow_dispatch
-
Statement type: