agileplus_sqlite/lib.rs
1pub mod migrations;
2pub mod storage;
3
4use std::path::Path;
5
6pub use storage::{Note, Storage};
7
8/// Apply all pending migrations to the given SQLite database path.
9pub fn apply_migrations(db_path: impl AsRef<Path>) -> anyhow::Result<()> {
10 let storage = Storage::open(&db_path)?;
11 storage.migrate()?;
12 Ok(())
13}
14
15/// Returns the list of (id, sql) migration pairs in apply order.
16pub fn migration_files() -> &'static [(&'static str, &'static str)] {
17 migrations::ALL
18}