ORM library for SQLite3 in TypeScript/JavaScript (v3.0.0). Uses ES decorators (@table, @id, @field) to map classes to database tables with automatic schema creation, connection pooling, and online backups. Provides type-safe queries with a filter syntax that eliminates SQL injection risks. Released under MIT, maintained with regular updates. Key differentiator: full control over schema naming, support for temporary tables, and partial model mapping. Also offers automatic upgrades and integration with NestJS via companion package @homeofthings/nestjs-sqlite3.
npm install sqlite3ormNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Define a User model class with decorators, create an in-memory database, create the schema, insert a record, and query all rows.
Update Node.js to v14+ and TypeScript to v4+.
Ensure all database columns are annotated with the appropriate decorator.
Always include at least one @id-decorated field in every @table class.
Use separate temporary table management instead of prefixing table names with 'temp.'
Add 'import "reflect-metadata";' at the top of your entry file.
Run 'npm install sqlite3orm' and ensure tsconfig.json includes 'node_modules/@types'.
Call 'await schema(db, [User]);' before executing any SQL against the table.