A library for SQLite table schema migration during development, allowing addition, removal, and type changes of columns automatically. Version 0.2.0. It provides a single function that takes an sqlite3 Database instance and a schema object, and ensures the tables match the definitions by using PRAGMA checks and automatic ALTER TABLE operations. Unlike ORMs, it focuses on rapid prototyping with minimal configuration, but does not support renaming columns. Ideal for iterative development where schema evolves frequently.
npm install sqlite-tables-handlerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates SQLite tables from a schema object, runs a query, and logs results.
Manually rename the column using SQLite ALTER TABLE, update the schema to reflect new name.
Use a locking mechanism like id-promise to ensure only one process migrates at a time (see README).
Ensure schema object includes all desired columns; to drop a column, simply remove it from the schema.
Backup database before altering schema; the library does not warn before dropping columns.
Use import sqliteHandler from 'sqlite-tables-handler';
npm install sqlite-tables-handler
Pass an instance of sqlite3.Database: const db = new sqlite3.Database(':memory:');