kasl/db/mod.rs
1//! SQLite persistence layer: one module per entity, migrations on open.
2//!
3//! ```rust,no_run
4//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
5//! use kasl::db::{db::Db, tasks::Tasks, workdays::Workdays};
6//! use kasl::libs::task::Task;
7//!
8//! let db = Db::new()?;
9//! let mut tasks = Tasks::new()?;
10//! let task = Task::new("Review code", "Check PR #123", Some(75));
11//! tasks.insert(&task)?;
12//! # Ok(())
13//! # }
14//! ```
15//!
16//! ```rust,no_run
17//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
18//! use kasl::db::{tags::{Tags, Tag}, templates::{Templates, TaskTemplate}};
19//!
20//! let mut tags = Tags::new()?;
21//! let tag_id = tags.create(&Tag::new("urgent".to_string(), Some("red".to_string())))?;
22//!
23//! let mut templates = Templates::new()?;
24//! let template = TaskTemplate::new(
25//! "daily-standup".to_string(),
26//! "Attend daily standup meeting".to_string(),
27//! "Team sync and planning".to_string(),
28//! 100
29//! );
30//! templates.create(&template)?;
31//! # Ok(())
32//! # }
33//! ```
34
35/// Connection handling and schema bootstrap.
36#[allow(clippy::module_inception)] // kasl::db::db::Db is the established public path
37pub mod db;
38
39/// Versioned schema migrations.
40pub mod migrations;
41
42/// Local inbox of assigned open Jira issues.
43pub mod jira_inbox;
44
45/// Catalog of Jira status id → name pairs synced from issues.
46pub mod jira_statuses;
47
48/// Pause records detected by the monitor or entered by hand.
49pub mod pauses;
50
51/// Tags and their task associations.
52pub mod tags;
53
54/// Task CRUD and filtered queries.
55pub mod tasks;
56
57/// Days owed to kasl-server after a failed or skipped upload.
58pub mod server_outbox;
59
60/// Reusable task templates.
61pub mod templates;
62
63/// Workday start/end records.
64pub mod workdays;