Skip to content

fix: generate native SQLite registered query value types - #59

Merged
smiggleworth merged 1 commit into
developfrom
fix/native-result-types
Oct 12, 2026
Merged

smiggleworth merged 1 commit into
developfrom
fix/native-result-types

Conversation

@smiggleworth

Copy link
Copy Markdown
Contributor

Generated SQLite registered queries declared numeric/bigint results as strings and boolean results as JavaScript booleans, although the adapter returns native numbers. A real typed(n numeric,b bigint,flag boolean) query returns {n:1.25,b:42,flag:1}; the same columns also accept text, blobs, and null under SQLite's dynamic storage rules.

Generate SQLite row fields as number | string | Uint8Array | null, covering native adapter values for declared columns and expressions without adding runtime coercion. Document field narrowing and integer read limits, and retain PostgreSQL's standard parser mapping.

Validation:

  • Added a real SQLite generation/validation/no-op workflow and registered-query runtime test spanning numeric, bigint, boolean, text, integer, expression, and all storage classes. Its generated TypeScript consumer fails on the previous implementation and passes with the fix; rejection assertions exclude JavaScript boolean, bigint, and Date values.
  • npm run fmt -- --check and npm run check pass (71 unit tests; coverage, type checks, packed contracts, build, benchmark gate, publint, pack dry run).
  • npm run test:integration passes all 30 tests against an isolated local PostgreSQL 18.6 cluster, with explicit numeric-string/boolean parser parity coverage.

Callers must regenerate artifacts and narrow SQLite result fields before using one value type. This addresses generated registered-query rows; it does not change schema DSL decoding or opt into bigint reads.

@smiggleworth
smiggleworth merged commit 449742d into develop Oct 12, 2026
10 checks passed
smiggleworth added a commit that referenced this pull request Oct 13, 2026
* docs: require a changelog section with every version bump

* ci: drop the redundant main-branch check from the publish workflow (#52)

Publishing runs in the npm environment, which now only deploys from main, so
the workflow no longer needs its own GITHUB_REF check.

* Contract ORM API and preserve migration scripts and failed cleanup (#56)

* feat: contract ORM API and recover failed migration cleanup

* fix: guard migration lifetimes and load project entries by file URL

* ci: preserve the required package check across platform gates

* fix: qualify real PostgreSQL generation and validation (#57)

* fix: generate native SQLite registered query value types (#59)

* chore(release): prepare ORM 0.5.0 from current develop (#60)

* docs: refresh ORM 0.5.0 qualification status (#61)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant