A directory of tables: the JSONL logs, their index snapshots, the metadata catalog
(hayson.json) describing them, and one writer lock (lock::DirLock, ADR-hjxp/0006 — one
writer per database directory).
Absolute paths of everything a database keeps on disk, by role — the port of the TS Layout,
narrowed to the roles this engine actually writes (format 2 keeps no per-table schema files,
and its write queue stages in memory rather than in a pending/ directory).
The layout/metadataFile/manifest triple of OpenOptions, exactly as a caller passed it —
unresolved, because which of the two file names wins (and whether they even agree) is decided
by LayoutOptions::metadata_file, and the kind by [resolve_kind].
Whether the tables of this database catch up with foreign writes on their own — the port of the
TS OpenOptions.follow, which takes false, true or { intervalMs }.
Name of the metadata document a database keeps in its root when open() names none — the port
of the TS DEFAULT_MANIFEST_FILE (packages/hayson/src/database/layout.ts).
Copies a database directory into dest: the files the database accounts for (see
[owned_files]) plus a hayson-backup.json manifest listing them with their sizes.
Seals a plain database, unseals an encrypted one, or re-seals one under other keys, in place and
recoverably (the stage, verify, swap and roll-back of super::restore_database).
Packs a database directory into one zip archive at dest: the files the database accounts for,
stored without compression, plus the hayson-backup.json manifest and the caller’s extra entries.
Databases named in include travel in the same archive under their folder, each with a
<folder>/hayson-backup.json of its own; the main manifest lists their folders.
Unpacks an archive made by pack_database into dir, replacing the database that is there
(and the nested ones the archive carries), with the recoverable procedure of
super::restore_database (stage, verify, swap, roll back).
Checks a database directory without taking its lock or changing a byte, and reports what is
wrong with it instead of failing on it: every damaged, missing or unreadable file becomes a
Problem, never an Err and never a panic.