fathomdb-schema
The on-disk schema and versioned migration registry for FathomDB, a local-first embedded retrieval engine built on SQLite.
Is this the crate you want?
Probably not, unless you are working on FathomDB rather than with it. Applications should depend
on fathomdb; the engine pulls this crate in and runs
migrations for you at Engine::open.
This crate is published separately because it is a leaf — it depends only on rusqlite — and
because it is the useful thing to reach for when you need to reason about a FathomDB database file
without opening an engine: inspecting a database's schema version, checking whether a file is at a
version your build understands, or writing tooling over the canonical tables.
Status: pre-1.0, beta
The 0.8.x line is under active development. The public surface can change between minor releases. The on-disk format is versioned and migrated forward, but there is no downgrade path: a database migrated by a newer build cannot be opened by an older one.
What it contains
SCHEMA_VERSION— the schema version this build migrates to, and the value it writes into SQLite'suser_versionpragma.MIGRATIONS— the ordered, append-only migration registry. Each entry is a named step; the registry is accretion-checked, so an already-released step cannot be edited in place.migrate,migrate_with_steps,migrate_with_event_sink— run pending migrations against arusqlite::Connection, returning aMigrationReport(per-step names and timings) or a typedMigrationError/MigrationFailureReport.bootstrap_stepsandCANONICAL_TABLES— the initial schema and the canonical table set.- File-suffix constants (
SQLITE_SUFFIX,WAL_SUFFIX,LOCK_SUFFIX,JOURNAL_SUFFIX) andPRAGMA_USER_VERSION, which together describe the on-disk footprint of one database.
Install
License
MIT. See the LICENSE file shipped in this crate.
Source, issues and full documentation: https://github.com/coreyt/fathomdb