A simple forwards-only migration tool designed specifically for postgres.js. Version 0.1.0 provides a single function to run SQL migrations in order. It is lightweight, has no external dependencies beyond postgres.js, and follows the philosophy of the parent library. Ideal for projects already using postgres.js who want minimal migration overhead without the complexity of other tools.
npm install postgres-shiftNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Imports the shift function, connects to PostgreSQL using postgres.js, and runs migrations from a local directory.
Use import { shift } from 'postgres-shift' or dynamic import('postgres-shift') instead of require().Ensure you import and create a postgres.js instance with postgres(connectionString) and pass sql to shift.
Name migration files with a timestamp or sequential number (e.g., 001_create_users.sql, 002_add_email.sql).
Use import { shift } from 'postgres-shift' in your code, or if using CommonJS, use dynamic import: const { shift } = await import('postgres-shift');Ensure you have imported postgres from 'postgres' and created the sql object correctly: const sql = postgres(connectionString); Then pass sql to shift().