Repository navigation
v0.4.2
The package is now @binaryplease/zodstore. The registry refused the
unscoped name zodstore as too similar to an existing zod-store, so no
version was ever published under it. This is the first release that reaches npm.
Nothing about the library changes from v0.4.1: the same modules, the same
exports, the same src/index.ts entry point. Only the specifier moves.
Install
bun add @binaryplease/zodstore zodimport { createStore, populate, ref } from "@binaryplease/zodstore";Zod is a peer dependency (^3.24.0 || ^4.3) — the consumer owns the Zod
version, so two copies of Zod never end up in one process.
What zodstore is
A native SQLite + Zod document store for Bun. Zod is the gatekeeper;
bun:sqlite is the synchronous, in-process engine. One fixed table per
collection, no migrations and no ORM — the shape lives in Zod, the rows live in
SQLite.
Carried over from 0.4.1
The published tarball is an allowlist. package.json declares
files: ["src", "README.md", "CHANGELOG.md", "LICENSE"], so an install brings
the library, its documentation and its licence and nothing else. npm packs the
working directory rather than git, and a denylist fails open on whatever nobody
thought to name; an allowlist fails closed.
A stored row that fails the schema no longer reports its own content. The
read path used to forward a ZodError's message verbatim, on the premise that
it names paths and types and carries no values. It does not — under Zod 3 the
issue carries the rejected value as received, so ordinary schema drift put
document content into the exception thrown by get(), find(), findByIds()
and findOne(). The issue list is now rendered rather than forwarded: each
issue reads "consents.<key>" (invalid_type, expected boolean). The ZodError
remains the cause. The write gate carried the same defect and takes the same
remedy.
Requirements
Bun. The library imports bun:sqlite and has no Node compatibility path.
License
MIT — see LICENSE.