sqlar is an ORM for SQL databases at version 0.1.20, providing a TypeScript-first interface with type-safe query building and model mapping. It supports PostgreSQL, MySQL, SQLite, and others via a plugin architecture. Released frequently as a young project, it focuses on simplicity and type inference, differentiating from heavier ORMs like Sequelize or TypeORM. As of early 2025, it is in active development with breaking changes expected between minor versions.
npm install sqlarNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic setup with SQLite, defining a model, syncing schema, inserting a record, and querying all records.
Update to use static class properties instead of decorators.
Replace sqlar.raw with new QueryBuilder pattern.
Use import syntax or dynamic import; set type: module in package.json.
Check types match runtime version; use tslib if needed.
Install @types/sqlar if not bundled, or ensure tsconfig.json has 'moduleResolution': 'node' and 'esModuleInterop': true.
Use import sqlar from 'sqlar' and ensure package.json has 'type': 'module'.
Call await db.sync() before performing CRUD operations.
No dependency data recorded yet.