Skip to main content

Version Control for Database Schemas

Project description

Datatrack - Version Control for Databases

Datatrack is a lightweight and open-source CLI tool that brings Git-like version control to your database schemas. Built for Data Engineers, Analytics Engineers, and Platform Teams, it automates: • Schema snapshots • Diffs across versions • Linting for naming and structure • Verification against custom rules • Exporting to JSON/YAML

Because in modern data systems, your schema is your contract—and when it breaks silently, everything else crumbles.

Features

  • Snapshot schemas from any SQL-compatible DB
  • Lint schema naming issues
  • Enforce verification rules
  • Compare schema snapshots (diff)
  • Export to JSON/YAML for auditing or CI
  • Full pipeline in one command

Installation

Option 1: Install from PyPI (production use)

pip install datatrack-core

This is the easiest and recommended way to use datatracker as a CLI tool in your workflows.

Option 2: Install from GitHub (for development)

git clone https://github.com/nrnavaneet/datatrack.git
cd datatrack
pip install -r requirements.txt
pip install -e .

This method is ideal if you want to contribute or modify the tool.

Helpful Commands

Datatrack comes with built-in help and guidance for every command. Use this to quickly learn syntax and options:

datatrack --help

How to Use

1. Initialize Tracking

datatrack init

Creates .datatrack/, .databases/, and optional initial files.

2. Connect to a Database

Save your DB connection for future use:

MySQL

datatrack connect mysql+pymysql://root:<password>@localhost:3306/<database-name>

PostgreSQL

datatrack connect postgresql+psycopg2://postgres:<password>@localhost:5432/<database-name>

SQLite

datatrack connect sqlite:///.databases/<database-name>

3. Take a Schema Snapshot

datatrack snapshot

Saves the current schema to .databases/exports/<db_name>/snapshots/.

4. Lint the Schema

datatrack lint

Detects issues in naming and structure.

5. Verify Schema Rules

datatrack verify

Validates schema against schema_rules.yaml.

6. View Schema Differences

datatrack diff

Shows table and column changes between the latest two snapshots.

7. Export Snapshots or Diffs

Export latest snapshot as YAML (default)

datatrack export

Explicitly export snapshot as YAML

datatrack export --type snapshot --format yaml

Export latest diff as JSON

datatrack export --type diff --format json

Output is saved in .databases/exports/<db_name>/.

8. View Snapshot History

datatrack history

Displays all snapshot timestamps and table counts.

9. Run the Full Pipeline

datatrack pipeline run

Runs lint, snapshot, verify, diff, and export together.

For advanced use cases and integration into CI/CD, visit:

https://github.com/nrnavaneet/datatrack

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

datatrack_core-0.1.2.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

datatrack_core-0.1.2-py3-none-any.whl (15.1 kB view details)

Uploaded Python 3

File details

Details for the file datatrack_core-0.1.2.tar.gz.

File metadata

  • Download URL: datatrack_core-0.1.2.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for datatrack_core-0.1.2.tar.gz
Algorithm Hash digest
SHA256 e5868866e7c7ededadd8254789b44250e360e33ed3b67db3e97f9ee467e618e8
MD5 093124b787931be7ec4e35c0c5b25f76
BLAKE2b-256 d345350763075b9183e30b6d466da9a62f3d3b2245cc1bfc5ea7b62b539c03a4

See more details on using hashes here.

File details

Details for the file datatrack_core-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: datatrack_core-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 15.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for datatrack_core-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4b19a2bb8ad857abe2e109cc4f9c8b564d829fbc0f69f3bc4da3b3a85a2c3cc7
MD5 ea5e49ac06efcf33f65c051c3d4c647c
BLAKE2b-256 6d9e171c3bdb5de1633166c3a8d4c49582815ba0d18948b4365b2fad967e053d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page