- isQueue table option adds queue columns and a (status, available_at)
index; BunSQLite.queue exposes add, claim, complete, fail and
release_stale with atomic claims
- Set busy_timeout on connections so workers in separate processes wait
instead of failing with SQLITE_BUSY
- Quote table and column names with backticks in generated SQL, so
reserved words (to, order, group) work and unknown columns error
instead of matching as string literals
- Tests for queue ops, multi-process claims and reserved-word names
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Append RETURNING * to generated INSERT/UPDATE SQL so the affected
record(s) are returned in payload/singleRes. Vector tables skip RETURNING
on update because SQLite does not support UPDATE ... RETURNING on virtual
tables, falling back to postInsertReturn.
postInsertReturn (affectedRows/insertId) is still populated for backwards
compatibility. Adds a returning?: boolean opt-out (default true) and tests.
- schema: add --dry-run (sync in a rolled-back transaction) and require
confirmation (or --yes) before dropping tables or columns; unapproved
destructive changes are refused
- only rebuild tables whose CREATE TABLE statement changed
- always AND targetId with the query, regardless of searchOperator
- empty IN / NOT IN lists become 1 = 0 / 1 = 1
- initialize lazily on first call so importing never throws
- read CLI version from package.json, chmod CLI on compile, pin @types/bun
- add SQL generator, value and schema guard tests
Co-Authored-By: Claude Opus 5.5 <[email protected]>
- init() loads config, schema and the SQLite client once into globals
- all CRUD queries go through lib/db-handler.ts (optional per-call config)
- split db-schema-manager.ts into lib/schema/* with FK-aware table ordering
- add bun:test tests for schema ordering, FK constraints and schema sync
- config/schema files can be .ts/.js/.json/.yaml/.yml; db_schema_file_name
is now optional (defaults to schema.* in db_dir)
- add export/import commands (database snapshot + schema archives)
- package exports map, type re-exports, hardened publish.sh
- validate table name in delete
Co-Authored-By: Claude Opus 5.5 <[email protected]>