Expand description
Catalog persistence.
The format is a JSON document whose every key is a “table”: it is the
mirror image of the relational schema described in schema.sql. Costly
conclusions are saved independently, so a catalog-format change does not
require recomputing them. SQLite remains deferred.
Writing is atomic (temporary file then rename): an interruption during saving cannot leave a half-written catalog behind.
Enums§
- Store
Error - What can go wrong when saving or loading a catalog.
Constants§
- ASSETS_
DIR - Where a picture goes when no single folder on disk can hold it.
- CATALOG_
FILE - Name of the catalog file inside the data folder.
- FORMAT_
VERSION - On-disk format version. Every incompatible change increments it.
Functions§
- analysis_
to_ json - An imported analysis, field for field.
- assets_
dir - The folder pictures without a home on disk are written into.
- catalog_
path - Builds the catalog path inside a data folder.
- default_
data_ dir - Default data location:
~/.local/share/aede, or$AEDE_HOMEif the variable is set. - from_
json - Rebuilds a catalog from its JSON document.
- load
- Loads a catalog without writing anything, including during legacy migration.
Returns
Ok(None)if the file does not exist yet. - load_
catalog_ only - Reads the catalog snapshot without loading independent conclusions.
- save
- Saves the catalog atomically, after preserving its independent conclusions.
- save_
catalog_ only - Writes only the rebuildable catalog, for a restore that handles each store independently.
- to_json
- Turns a catalog into its JSON document, one array per table.
- write_
new_ atomic - Writes a new sidecar through a temporary file, never replacing an existing one.