A CLI utility to export CockroachDB schemas in SQL, JSON, or YAML formats.
Project description
CRDB Schema Exporter
A CLI tool to export schema definitions (DDL) from CockroachDB into SQL, JSON, or YAML formats. Supports secure TLS connections, per-table output, schema diffing, and archive packaging.
Features
- Export tables, views, sequences, and user-defined types
- Output formats: SQL, JSON, YAML
- Optional: per-object files
- Optional: output archive (.tar.gz)
- Optional: schema diff
- Secure connection with TLS certificates
Installation
Install from source:
pip install .
Build and install from source distribution:
python -m build
pip install dist/crdb_schema_exporter-0.1.0-py3-none-any.whl
Install from PyPI:
pip install crdb-schema-exporter
⚠️ Note: You must install the CockroachDB dialect:
pip install sqlalchemy-cockroachdb
Usage
crdb-schema-exporter --db=mydb --host=localhost [options]
Options
--db(required) – CockroachDB database name--host– CRDB host (default: localhost)--certs-dir– Path to TLS certificate directory--tables– Comma-separated list of tables (db.table1,db.table2,...)--per-table– Output individual files per object--format– Output format: sql (default), json, yaml--archive– Package output directory into a .tar.gz file--diff– Compare exported schema against another SQL file--parallel– Enable parallel exports--verbose– Enable detailed debug logging--log-dir– Directory to store log files (default:logs/)
Output
By default, exported schema files are saved under:
crdb_schema_dumps/<db_name>/
For example:
crdb_schema_dumps/movr/movr_schema.sql
Example
crdb-schema-exporter --db=movr --per-table --format=yaml --archive --verbose
Project details
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 crdb_schema_exporter-0.1.1.tar.gz.
File metadata
- Download URL: crdb_schema_exporter-0.1.1.tar.gz
- Upload date:
- Size: 6.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
555727e03601912a00b1410b53b4e0ca193ac7d0d5266146d18f7c96b24e54df
|
|
| MD5 |
e3aa9ffff317e08b80d9fc51db80fc8c
|
|
| BLAKE2b-256 |
6c5ebcf47578dbdec7de738ab06b220221d6387633d92392d7a52a8ced01f5d1
|
File details
Details for the file crdb_schema_exporter-0.1.1-py3-none-any.whl.
File metadata
- Download URL: crdb_schema_exporter-0.1.1-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
69094f0fe73a80d80200363d26b502a1a06351783ee2305dd7f902c0c4306a1f
|
|
| MD5 |
69fb68d59b551af30ce016e4da1b8dec
|
|
| BLAKE2b-256 |
16cc1aa1eff250bca167a53be0de542cf9d2148463d35dd4c4afce930a934731
|