Metadata-Version: 2.4
Name: psmt
Version: 0.0.1
Summary: Python SQL Migration Tool
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: PyYAML>=6.0
Provides-Extra: postgresql
Requires-Dist: psycopg[binary]>=3.1; extra == "postgresql"
Provides-Extra: mysql
Requires-Dist: PyMySQL>=1.0; extra == "mysql"
Provides-Extra: mssql
Requires-Dist: pyodbc>=5.0; extra == "mssql"
Requires-Dist: azure-identity>=1.15; extra == "mssql"
Provides-Extra: oracle
Requires-Dist: oracledb>=2.0; extra == "oracle"
Provides-Extra: db2
Requires-Dist: ibm_db>=3.1; extra == "db2"
Provides-Extra: all
Requires-Dist: psycopg[binary]>=3.1; extra == "all"
Requires-Dist: PyMySQL>=1.0; extra == "all"
Requires-Dist: pyodbc>=5.0; extra == "all"
Requires-Dist: azure-identity>=1.15; extra == "all"
Requires-Dist: oracledb>=2.0; extra == "all"
Requires-Dist: ibm_db>=3.1; extra == "all"
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: pytest-cov>=5.0; extra == "dev"

# 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 `.sql` files — no DSL, no ORM.
- Engines: PostgreSQL, MySQL/MariaDB, SQL Server, SQLite, Oracle, DB2.
- In-process driver connections only (no subprocess delegation).

## Install

```sh
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

```sh
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

```sh
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](CONTRIBUTING.md) for development setup, the editable
install, and contribution guidelines. `spec/` contains the full design.
