A lightweight PostgreSQL migration tool for Bun, inspired by postgres-migrations but using Bun's built-in SQL client instead of the pg package. Current stable version is 1.0.9, released occasionally with no fixed cadence. Key differentiators: leverages Bun's native PostgreSQL client for faster startup and smaller dependencies, supports SQL-only migrations with sequential integer IDs, no rollbacks, file hash integrity checks, and PostgreSQL advisory locks for concurrency. Ideal for Bun-based projects needing simple, forward-only database migrations.
npm install bun-migrateNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to import and call the migrate function with a connection string and default migration directory.
Ensure user/password are URL-encoded if they contain special characters (e.g., %23 for #).
Use Bun instead of Node.js to run this package. Install via `curl -fsSL https://bun.sh/install | bash`.
Run `bun add bun-migrate` and ensure import statement is correct: `import { migrate } from 'bun-migrate';`Change `import migrate from 'bun-migrate'` to `import { migrate } from 'bun-migrate'`.Ensure PostgreSQL is running and the connection string is correct. Use `process.env.DATABASE_URL ?? 'postgres://...'`