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
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.pyconfiguration file
Configure Your Database
Edit jetbase/env.py with your database connection string (currently support for postgres, sqlite snowflake, databricks):
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 thejetbase/migrationsdirectory, using theV<version>__<description>.sqlnaming 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
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 jetbase-0.17.1.tar.gz.
File metadata
- Download URL: jetbase-0.17.1.tar.gz
- Upload date:
- Size: 161.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
54c6635aa1f159ef1f217888665835813509582c53d06a446838f6f8a7b2b868
|
|
| MD5 |
e1a4149d5fd452c35337422dc321938f
|
|
| BLAKE2b-256 |
bedba82c9a8c6c47cf56f8289981303a216b5f81c850b12201a6e21dc8c7177d
|
Provenance
The following attestation bundles were made for jetbase-0.17.1.tar.gz:
Publisher:
publish.yml on jetbase-hq/jetbase
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jetbase-0.17.1.tar.gz -
Subject digest:
54c6635aa1f159ef1f217888665835813509582c53d06a446838f6f8a7b2b868 - Sigstore transparency entry: 850268848
- Sigstore integration time:
-
Permalink:
jetbase-hq/jetbase@43d76e213c46cec26c143eb37f8455b09420a7b4 -
Branch / Tag:
refs/tags/0.17.1 - Owner: https://github.com/jetbase-hq
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@43d76e213c46cec26c143eb37f8455b09420a7b4 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file jetbase-0.17.1-py3-none-any.whl.
File metadata
- Download URL: jetbase-0.17.1-py3-none-any.whl
- Upload date:
- Size: 53.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
65689786ebfa49053a0f37b8b1e4e3b190578e00d74bc74fe871605a02986eb1
|
|
| MD5 |
ea01a120b16c544f2d524b2e7b1aefc6
|
|
| BLAKE2b-256 |
46d4181c3eeb1669164dca4237611855a19ece3073804859a2f78791a789256e
|
Provenance
The following attestation bundles were made for jetbase-0.17.1-py3-none-any.whl:
Publisher:
publish.yml on jetbase-hq/jetbase
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jetbase-0.17.1-py3-none-any.whl -
Subject digest:
65689786ebfa49053a0f37b8b1e4e3b190578e00d74bc74fe871605a02986eb1 - Sigstore transparency entry: 850268853
- Sigstore integration time:
-
Permalink:
jetbase-hq/jetbase@43d76e213c46cec26c143eb37f8455b09420a7b4 -
Branch / Tag:
refs/tags/0.17.1 - Owner: https://github.com/jetbase-hq
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@43d76e213c46cec26c143eb37f8455b09420a7b4 -
Trigger Event:
workflow_dispatch
-
Statement type: