Skip to content
@dbwarden-org

DBWarden

DBWarden is a database migration system for Python/SQLAlchemy projects

DBWarden

DBWarden

Your models are the source code. SQL is the output.

Python PyPI License Documentation Codecov


DBWarden is a declarative schema compiler for SQLAlchemy. You declare the schema you want in your SQLAlchemy models, and DBWarden compiles everything else: migration SQL, rollbacks, snapshots, and safety checks. There are no migration scripts to write or maintain. Your models are the contract.

This organization is the home of the DBWarden project and its official plugins.


Quickstart

# install DBWarden
uv add dbwarden

# create a configuration
echo "
from dbwarden import DbwardenDatabase

class Primary(DbwardenDatabase):
    database_name = 'primary'
    database_type = 'postgresql'
    database_url_sync = 'postgresql://user:pass@localhost:5432/myapp'
    default = True
" > dbwarden.py

# generate your first migration
dbwarden make-migrations "create initial tables"

# apply it
dbwarden migrate

Official Plugins

Plugin Description
dbwarden-seeds Seed data management
dbwarden-fastapi FastAPI sessions, lifespan, and health routes
dbwarden-sandbox Safe declaration parsing without code execution
dbwarden-pgsql-rbac PostgreSQL roles, grants, and row-level security
dbwarden-pgsql-extensions PostgreSQL extension management
dbwarden-pgsql-types PostgreSQL custom types and sequences
dbwarden-ch-rbac ClickHouse access control

Browse community plugins on PyPI


Creating Plugins

Use the dbwarden-plugin-template to scaffold a new plugin: click Use this template, run one command, and you have a working, tested, publishable plugin with the standard layout.

Full plugin development guide: docs.dbwarden.org/plugins


Documentation

Full documentation with guides, cookbook, and API reference:
docs.dbwarden.org


Contributing

We welcome contributions to the core tool and to plugins.
Start with the core contribution guide or jump into any plugin’s issue tracker.


License

DBWarden and all official plugins are released under the MIT License.

Pinned Loading

  1. dbwarden dbwarden Public

    DBWarden is a database migration system for Python/SQLAlchemy projects

    Python 13 1

  2. dbwarden-plugin-template dbwarden-plugin-template Public template

    Template for building DBWarden plugins: project scaffolding, conformance suite, GitHub Actions CI, and PyPI publishing out of the box

    Python

  3. dbwarden-harness dbwarden-harness Public

    Standalone black-box validation harness for DBWarden releases, database backends, plugins, migrations, and schema convergence

    Python 1

  4. dbwarden-fastapi dbwarden-fastapi Public

    DBWarden plugin for FastAPI: session dependencies, health endpoints, migration routes, and lifespan management

    Python

  5. dbwarden-seeds dbwarden-seeds Public

    DBWarden plugin for seed data management: apply, rollback, and export seed data across environments

    Python

  6. dbwarden-pgsql-types dbwarden-pgsql-types Public

    DBWarden plugin for PostgreSQL custom types: ENUMs, domains, composite types, and sequences

    Python

Repositories

Showing 10 of 12 repositories

People

This organization has no public members. You must be a member to see who’s a part of this organization.

Top languages

Loading…

Most used topics

Loading…