SQLite best practices for Node.js with better-sqlite3 — WAL mode, pragmas, foreign keys, STRICT tables, transactions, migrations, graceful shutdown, and query patterns
97
98%
Does it follow best practices?
Impact
96%
1.65xAverage score across 5 eval scenarios
Passed
No known issues
A community center needs an event booking backend built with Node.js, TypeScript, and Express. Use SQLite for the database (runs on a single on-premise server).
The system needs:
Produce:
src/db.ts — Database connection and schemasrc/bookings.ts — Booking logic (book seats, cancel, queries)src/events.ts — Event CRUD and dashboardsrc/index.ts — Express app with routespackage.json — With dependenciesComplete TypeScript, no placeholders.