Skip to main content

Jetbase is a Python database migration tool

Project description

Welcome to Jetbase 🚀

Jetbase is a simple, lightweight database migration tool for Python projects.

Jetbase helps you manage database migrations in a simple, version-controlled way. Whether you're adding a new table, modifying columns, or need to undo a change, Jetbase makes it super easy!


Created and maintained by Jaz 🛠️


Key Features ✨

  • 📦 Simple Setup — Get started with just one command
  • ⬆️ Easy Upgrades — Apply pending migrations with confidence
  • ⬇️ Safe Rollbacks — Made a mistake? No problem, roll it back!
  • 📊 Clear Status — Always know which migrations have been applied and which are pending
  • 🔒 Migration Locking — Prevents conflicts when multiple processes try to migrate
  • ✅ Checksum Validation — Detects if migration files have been modified
  • 🔄 Repeatable Migrations — Support for migrations that run on every upgrade

📚 Full Documentation

Quick Start 🏃‍♂️

Installation

Using pip:

pip install jetbase

Using uv:

uv add jetbase

Note for Snowflake and Databricks Users:
To use Jetbase with Snowflake or Databricks, install the appropriate extras:

pip install "jetbase[snowflake]"
pip install "jetbase[databricks]"

Initialize Your Project

jetbase init
cd jetbase

This creates a jetbase/ directory with:

  • A migrations/ folder for your SQL files
  • An env.py configuration file

Configure Your Database

Edit jetbase/env.py with your database connection string (currently support for postgres, sqlite, and snowflake):

PostgreSQL example:

sqlalchemy_url = "postgresql+psycopg2://user:password@localhost:5432/mydb"

SQLite example:

sqlalchemy_url = "sqlite:///mydb.db"

Create Your First Migration

jetbase new "create users table" -v 1

This creates a new SQL file called V1__create_users_table.sql.

Tip:
You can also create migrations manually by adding SQL files in the jetbase/migrations directory, using the V<version>__<description>.sql naming convention (e.g., V1__add_users_table.sql, V2.4__add_users_table.sql).

Write Your Migration

Open the newly created file and add your SQL:

-- upgrade
CREATE TABLE users (
    id SERIAL PRIMARY KEY,
    name VARCHAR(100) NOT NULL,
    email VARCHAR(255) UNIQUE NOT NULL
);

CREATE TABLE items (
    id SERIAL PRIMARY KEY,
    name VARCHAR(100) NOT NULL
);

-- rollback
DROP TABLE items;
DROP TABLE users;

Apply the Migration

jetbase upgrade

That's it! Your database is now up to date. 🎉

Note:
Jetbase uses SQLAlchemy under the hood to manage database connections.
For any database other than SQLite, you must install the appropriate Python database driver.
For example, to use Jetbase with PostgreSQL:

pip install psycopg2

You can also use another compatible driver if you prefer (such as asyncpg, pg8000, etc.).

Supported Databases

Jetbase currently supports:

  • ✅ PostgreSQL
  • ✅ SQLite
  • ✅ Snowflake
  • ✅ Databricks
  • ✅ MySQL

Need Help?

Open an issue on GitHub!

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

jetbase-0.17.0.tar.gz (161.0 kB view details)

Uploaded Source

Built Distribution

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

jetbase-0.17.0-py3-none-any.whl (52.8 kB view details)

Uploaded Python 3

File details

Details for the file jetbase-0.17.0.tar.gz.

File metadata

  • Download URL: jetbase-0.17.0.tar.gz
  • Upload date:
  • Size: 161.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for jetbase-0.17.0.tar.gz
Algorithm Hash digest
SHA256 b8231851c23bfc4977d1aebc57e1329aa355094ad18a47cbbdea24faf0b4d357
MD5 e16f8a172906e83db8c0aea1cacb6f39
BLAKE2b-256 791436f3352c033c5ed2a2132c7eead7295cb36a86f17d5bba5894ec29eda001

See more details on using hashes here.

Provenance

The following attestation bundles were made for jetbase-0.17.0.tar.gz:

Publisher: publish.yml on jetbase-hq/jetbase

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file jetbase-0.17.0-py3-none-any.whl.

File metadata

  • Download URL: jetbase-0.17.0-py3-none-any.whl
  • Upload date:
  • Size: 52.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for jetbase-0.17.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9e7e802d35296a30d2eadbd61c4fa618f563e586da41aa4869ac4d67ff627a8c
MD5 30e9bdaf7f4d17572e356cf93b9698cb
BLAKE2b-256 03f4f8dc26e0f3b9d57ea821412c73c0a69a145936aea757cb5add7aba9bb26c

See more details on using hashes here.

Provenance

The following attestation bundles were made for jetbase-0.17.0-py3-none-any.whl:

Publisher: publish.yml on jetbase-hq/jetbase

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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