A TypeScript library (v0.3.0) providing a templated SQL tag and database wrapper for Cloudflare Durable Objects SQLite storage. It simplifies parameterized queries with `sql` tagged templates, includes a migration system with schema versioning and automatic column alterations, and offers safe helpers (queryOne, queryMany, run, etc.) that guard against injection and common mistakes. Active development with weekly releases on npm.
npm install durable-objects-sql-tagNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Complete Durable Object class using wrapDatabase with migrations and basic queries.
Use queryNoneOrOne when expecting 0-1 rows.
Use run() for statements that may return rows, or ensure only non-SELECT statements are passed.
Always pass ctx.storage from DurableObject constructor.
Wrap this.db.migrate(migrations) inside ctx.blockConcurrencyWhile(() => this.db.migrate(migrations)).
Use import syntax or set your project to ESM.
Ensure this.db.migrate(migrations) is called and awaited inside ctx.blockConcurrencyWhile in the constructor.
Use queryNoneOrOne if the row may not exist, or check data.
No dependency data recorded yet.