Skip to main content

Module store

Module store 

Source
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_atbookmarks.added_at (epoch seconds). Bookmark.updated_atbookmarks.last_seen_at (epoch seconds). Bookmark.source.kindbookmarks.source_kind (lowercase string). Bookmark.source.external_idbookmarks.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.rawbookmarks.raw (JSON string). tagstags 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.