als-sqlite is a lightweight ORM-like wrapper around better-sqlite3 inspired by Mongoose. It provides Schema definitions with types (text, integer, array, json), encryption support, and a Model class for CRUD operations (insert, find, update, delete) with methods like populate, count, and insertMany. The package is in early stages (v0.5.2, under active development) with frequent breaking changes. It is simpler than full ORMs like Sequelize or TypeORM but lacks mature features and community adoption. Database connectivity is managed via a single connect function.
npm install als-sqliteNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Complete example: define schema, connect to sqlite, create model, insert/find/update/delete records.
Upgrade to >=0.5.2 to avoid errors on dropping non-existent tables.
Update to use new Model.table(tableName, schema) if needed.
Be aware that string 'true'/'false' will be coerced to boolean after 0.4.1.
Pin exact version in package.json to avoid surprises.
Use require() and avoid import/export syntax.
const { Schema } = require('als-sqlite')npm install better-sqlite3
Set Model.db = connect(path) after requiring Model.