A simple PostgreSQL migration tool using postgres.js (porsager/postgres). Version 0.9.1 (alpha) with CLI and programmatic API. Released as a spin-off from a larger project; WIP status and low release cadence. Supports up/down migrations, dry runs, pg-monitor integration. Differentiator: lightweight, no ORM, relies on postgres.js instead of pg. TypeScript types included.
npm install lean-pg-migrateNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows programmatic usage: connecting to PostgreSQL with postgres.js, then calling migrate() to run all pending migrations.
Use import syntax or dynamic import(). Ensure Node.js >=18.
Use 'rollback group' to rollback only the last batch unless you intend to reset the database.
Use 'migrate' and 'rollback' instead.
Always set PGPASSWORD environment variable or use --password.
Write migrations as CommonJS or ESM JS files exporting up and down functions.
Run: npm install postgres
Ensure Node.js >=18 and use import instead of require.
Create the directory or use --dir to specify an existing one.