Lightweight PostgreSQL migration tool for Bun v1.0.2. Uses Bun's built-in SQL client, no external drivers. Features timestamp-based migration files, transaction-safe up/down SQL, CLI commands (init, create, migrate, rollback, reset), and a programmatic API. Zero-config with DATABASE_URL. Minimal dependencies (pino for logging). Suitable for Bun projects that need simple, team-friendly schema migrations without heavy ORMs.
npm install bun-psql-migrationsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initialize, create, and run migrations programmatically using ESM imports.
Use only with Bun (bun run script.ts).
Install typescript@^5.8.3 as devDependency.
Run 'bunx bun-psql-migrations init' before any migrate/rollback.
Set DATABASE_URL in .env or prefix command: DATABASE_URL=postgres://... bunx ...
Replace const x = require(...) with import { x } from 'bun-psql-migrations' and run with bun.Run 'bunx bun-psql-migrations init' then create migration with 'bunx bun-psql-migrations create your_migration_name'.
Ensure PostgreSQL is running and set correct DATABASE_URL (e.g., postgres://user:pass@localhost:5432/dbname).
No dependency data recorded yet.