Expand description
SQLite-backed bookmark store.
Layered on top of crate::storage (WAL + contention hardening) and
crate::migrator (forward-only schema versioning). All public
methods are blocking; callers wrap them in tokio::task::spawn_blocking
when they need an async surface.
Statements are prepared with prepare_cached and re-used by the
connection’s internal LRU cache. We do not hold on to
Statement<'_> objects (they borrow from the connection); the SQL is
the single source of truth.
§Schema ↔ domain mapping
Bookmark.created_at ↔ bookmarks.added_at (epoch seconds).
Bookmark.updated_at ↔ bookmarks.last_seen_at (epoch seconds).
Bookmark.source.kind ↔ bookmarks.source_kind (lowercase string).
Bookmark.source.external_id ↔ bookmarks.external_id.
Bookmark.source.imported_at is not persisted (kept on the source
only); the import timestamp on the SourceRef is reconstructed as
the epoch 0 on read.
Bookmark.source.raw ↔ bookmarks.raw (JSON string).
tags ↔ tags table (one row per (bookmark_id, tag)).
content_type is not persisted today; bridges that set it
currently do so to None.
Structs§
- Store
- The bookmark store. Wraps a single SQLite connection.
Functions§
- open
- Open (and migrate) a file-backed store.
- open_
in_ memory - Open an in-memory store. Used by tests and ephemeral tooling.