pinto/storage.rs
1//! Persistence layer.
2//!
3//! Read and write backlog items as Markdown (TOML frontmatter plus body), one item per file.
4//! Repository traits keep persistence separate from the domain layer and make backends replaceable
5//! in tests.
6//!
7//! Frontmatter is TOML between `+++` delimiters and uses the same serialization format as
8//! `config.toml`, keeping the data human-editable.
9
10mod atomic;
11mod backend;
12mod file_repository;
13mod git_repository;
14mod issued_ids;
15mod lock;
16mod markdown;
17mod repository;
18#[cfg(feature = "sqlite")]
19mod sqlite_repository;
20
21pub(crate) use atomic::atomic_write;
22pub(crate) use issued_ids::{path as item_issued_ids_path, record as record_issued_id};
23// The Markdown representation (`+++` frontmatter plus body) is the backend-independent editing
24// format used by `$EDITOR`. The facade re-exports it because the service layer uses it to build
25// edit templates and parse edited content; concrete paths remain backend-internal.
26pub use backend::Backend;
27pub use lock::BoardLock;
28pub use markdown::parse_item_markdown;
29pub(crate) use markdown::split_frontmatter as parse_frontmatter;
30pub(crate) use markdown::{from_markdown as item_from_markdown, to_markdown as item_to_markdown};
31// Re-export the backend type here because backend selection and migration use the persistence
32// facade's public API ([`Backend::open`] and [`crate::service::migrate_storage`]).
33pub use crate::config::StorageBackend;
34pub use file_repository::FileRepository;
35pub use git_repository::GitRepository;
36pub use repository::{BacklogItemRepository, SprintRepository};
37#[cfg(feature = "sqlite")]
38pub use sqlite_repository::SqliteRepository;