Skip to content

Commit

Permalink
make sqlite the default storage (#295)
Browse files Browse the repository at this point in the history
  • Loading branch information
boxdot authored Jun 26, 2024
1 parent 594d7ad commit 6547525
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion src/storage/sql/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -56,6 +56,7 @@ impl SqliteStorage {
passphrase: Option<String>,
preserve_unencrypted: bool,
) -> anyhow::Result<Self> {
info!("loading app data from: {}", url);
let db = if let Some(passphrase) = passphrase {
match is_sqlite_encrypted_heuristics(url) {
// encrypted or does not exist
Expand Down

0 comments on commit 6547525

Please sign in to comment.