Skip to content

v0.5.0

Latest

Choose a tag to compare

@escherlies escherlies released this 17 Sep 21:14
v0.5.0
b3aeec5

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 like operand that is not a string is refused. LIKE NULL is NULL
    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 idField reopen 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/notIn containing null name the rows that have no value.
    in: [null] means eq: null, notIn: [null] means ne: null, so the list
    form and the singleton form of the same question now agree.

Fixed

  • ne and notIn no longer drop the rows whose value is NULL.
  • 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 a unique: true (#6); a redefinition is refused loudly, and a
    file written by an earlier version keeps one index per declaration.
  • An in/notIn list 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/zodstore

Requirements

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.