From c57ae0c9434b0b0c765b4e830775c9374fc5b5cc Mon Sep 17 00:00:00 2001 From: Bruno Damour Date: Mon, 25 May 2026 11:17:11 +0200 Subject: [PATCH] fix: allow compiling with sqlite backend only --- Cargo.toml | 6 ++++-- src/main.rs | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 4342168..ffd55c5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ exclude = [ [dependencies] clap = { version = "4.6.1", features = ["derive", "cargo"] } -chrono = { version = "~0.4.44", default-features = false, features = ["std", "serde"]} +chrono = { version = "~0.4.44", default-features = false, features = ["std", "serde"] } config-file = "~0.2.3" serde = "~1.0.228" diesel = { version = "2.3.9", features = ["sqlite", "r2d2", "chrono"] } @@ -39,11 +39,13 @@ features = ["json"] [dev-dependencies] mockall = "0.14.0" + [features] api=[] +sqlite = [] mysql = ["diesel/mysql"] postgres = ["diesel/postgres"] -default = ["api","mysql","postgres"] +default = ["api", "sqlite", "mysql", "postgres"] [profile.release] strip = "symbols" lto = true diff --git a/src/main.rs b/src/main.rs index f72eff8..1633d16 100644 --- a/src/main.rs +++ b/src/main.rs @@ -47,7 +47,7 @@ mod api; mod database; mod r#struct; -#[cfg(not(any(feature = "mysql", feature = "postgres")))] +#[cfg(not(any(feature = "sqlite", feature = "mysql", feature = "postgres")))] compile_error!("At least one database backend should be activated."); #[cfg(test)]