Repository navigation
Eighteen fixes to the schema gate and the where-clause compiler, and four
changes that make a previously-accepted call fail loudly. A minor bump rather
than a patch: a caller on 0.4.2 can meet a throw where a call used to return.
Full detail in CHANGELOG.md.
Breaking in practice
- A
likeoperand that is not a string is refused.LIKE NULLisNULL
for every row, so the filter answered nothing and an empty answer is
indistinguishable from a truthful "no rows" (#16). - A schema whose fields are not one readable shape is refused at
store.collection(...)rather than skipped — a union of object schemas or
an intersection.{ enforceDefaults: false }is the way past it, which makes
the exception a caller's decision rather than an accident of spelling. - A conflicting
idFieldreopen is refused across connections, not only
within one process. The convention is read back off a stored row, so the check
answers on files that already exist and needs no migration
(#1). in/notIncontainingnullname the rows that have no value.
in: [null]meanseq: null,notIn: [null]meansne: null, so the list
form and the singleton form of the same question now agree.
Fixed
neandnotInno longer drop the rows whose value isNULL.- The declared-default guard walks a schema all the way down, and both
collection guards see through Zod wrappers (#2, #7, #11). - Two index declarations can no longer collapse onto one name, silently
dropping aunique: true(#6); a redefinition is refused loudly, and a
file written by an earlier version keeps one index per declaration. - An
in/notInlist binds as one JSON array instead of a placeholder per
element, so the statement cache no longer holds one entry per distinct list
length (#3). - A
collection()call that fails on an option no longer poisons the store. - An operand that cannot be compared is refused, naming the operator or field,
and an operator object naming no operator narrows instead of throwing.
Install
bun add @binaryplease/zodstoreRequirements
Bun. The library imports bun:sqlite and has no Node compatibility path. Zod
is a peer dependency (^3.24.0 || ^4.3).
License
MIT — see LICENSE.