psmt — Python SQL Migration Tool
psmt is a lightweight, file-based SQL migration tool. It organizes raw SQL files
into versioned folders and tracks execution state in a _migration table inside
the target database.
- Plain
.sqlfiles — no DSL, no ORM. - Engines: PostgreSQL, MySQL/MariaDB, SQL Server, SQLite, Oracle, DB2.
- In-process driver connections only (no subprocess delegation).
Install
pip install psmt # core only (SQLite works out of the box)
pip install "psmt[all]" # everything, including all engine drivers
Per-engine extras: psmt[postgresql], psmt[mysql], psmt[mssql],
psmt[oracle], psmt[db2]. SQLite needs no extra driver.
Usage
psmt init
psmt generate migration default --summary "add user table"
psmt migrate
psmt rollback
psmt preview 20260103223344245:01
psmt versions
psmt check
psmt db create
psmt db destroy --force
Tests
pytest -m "not integration" # unit tests (no database needed)
docker compose -f docker/docker-compose.yml up -d # provision test databases
pytest -m integration # real-database tests (unreachable engines are skipped)
See CONTRIBUTING.md for development setup, the editable
install, and contribution guidelines. spec/ contains the full design.
Metadata
Release files for psmt 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| psmt-0.0.1.tar.gz | 22.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| psmt-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 53.4 kB
Release files / psmt-0.0.1.tar.gz
| Download URL | psmt-0.0.1.tar.gz |
|---|---|
| Size | 22.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
214d25ee739802ffc6913666d7fb2ffdb87da8b2e40d117d88850bf3c50dd2b8
|
|
BLAKE2b-256 checksum How to use checksums |
fc798780b6f0a224a81208b83c0e05a81baf84837fff21ca32f7e7e44c16fed6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 31, 2026.
Transparency logRelease files / psmt-0.0.1-py3-none-any.whl
| Download URL | psmt-0.0.1-py3-none-any.whl |
|---|---|
| Size | 30.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
97a2a389ab89fc67e63889e40326b38b62f86268c0c0fe9f4ee2ed49d9144599
|
|
BLAKE2b-256 checksum How to use checksums |
02473bd7682779c4a35aecbbab3d3ba9b3c09815717ee49c99bc4f832f6eb9d1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 31, 2026.
Transparency log