A minimal migration helper for bun:sqlite. Version 1.0.2 provides a single function to apply SQL file migrations in sorted order and tracks progress via PRAGMA user_version. Designed exclusively for Bun's built-in SQLite driver, it is not compatible with other SQLite libraries. Works only in the Bun runtime with TypeScript peer dependency ^5.0.0. No other dependencies. Simpler than alternatives like Knex or Umzug, but limited to file-based migrations and numeric versioning via file name order.
npm install bun-sqlite-migrationsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to create a bun:sqlite Database, read migrations from a folder, and apply them using migrate().
Name files like '0001_init.sql', '0002_add_users.sql' to ensure correct order.
Do not exceed 9,223,372,036,854,775,807 migrations.
Wrap each migration in a transaction manually, or use a library with rollback support.
Ensure files contain valid SQL. Use migrate() to apply only new ones.
Run with 'bun run script.ts' instead of 'node script.ts'.
Use ESM import: import { migrate } from 'bun-sqlite-migrations'Create the folder or provide a correct absolute/relative path to getMigrations().
No dependency data recorded yet.