From 6547525889d4e54cca8292a300230ebd61139eaf Mon Sep 17 00:00:00 2001 From: boxdot Date: Wed, 26 Jun 2024 17:23:32 +0200 Subject: [PATCH] make sqlite the default storage (#295) --- src/config.rs | 1 + src/storage/sql/storage.rs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/config.rs b/src/config.rs index f350473..e69f480 100644 --- a/src/config.rs +++ b/src/config.rs @@ -137,6 +137,7 @@ impl Config { #[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize)] pub struct SqliteConfig { + #[serde(default = "default_true")] pub enabled: bool, #[serde(default = "SqliteConfig::default_db_url")] pub url: Url, diff --git a/src/storage/sql/storage.rs b/src/storage/sql/storage.rs index 04054d8..2c89ad4 100644 --- a/src/storage/sql/storage.rs +++ b/src/storage/sql/storage.rs @@ -9,7 +9,7 @@ use sqlx::sqlite::{SqliteConnectOptions, SqliteJournalMode, SqliteSynchronous}; use sqlx::{ConnectOptions, Connection, SqliteConnection}; use thread_local::ThreadLocal; use tokio::runtime::Runtime; -use tracing::{instrument, trace}; +use tracing::{info, instrument, trace}; use url::Url; use uuid::Uuid; @@ -56,6 +56,7 @@ impl SqliteStorage { passphrase: Option, preserve_unencrypted: bool, ) -> anyhow::Result { + info!("loading app data from: {}", url); let db = if let Some(passphrase) = passphrase { match is_sqlite_encrypted_heuristics(url) { // encrypted or does not exist