Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 81 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,9 @@ zeroize = { version = "1.8.1", features = ["derive"] }
itertools = "0.14.0"
rmp-serde = "1.3.0"
security-framework-sys = { version = "2.14.0", optional = true }
rusqlite = { version = "0.37.0", features = ["bundled"] }
rusqlite_migration = "2.3.0"
r2d2 = "0.8.10"
r2d2_sqlite = { version = "0.31.0", features = ["bundled"] }

[dev-dependencies]
color-eyre = "0.6.3"
Expand Down
3 changes: 3 additions & 0 deletions cSpell.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,13 @@
"rngs",
"robusta",
"rstest",
"rusqlite",
"rustup",
"securestore",
"serde",
"sodiumoxide",
"sqlite",
"Sqlite",
"Swatinem",
"Taskfile",
"thiserror",
Expand Down
11 changes: 6 additions & 5 deletions src/storage/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,13 +276,16 @@ pub(crate) enum StorageField {

#[cfg(test)]
mod test {
use super::*;

use std::sync::LazyLock;

use nanoid::nanoid;
use rstest::{fixture, rstest};

use crate::prelude::KeySpec;
use crate::{prelude::KeySpec, tests::TestStore};

use super::*;
static TEST_KV_STORE: LazyLock<TestStore> = LazyLock::new(TestStore::new);

const DUMMY_SPEC: Spec = Spec::KeySpec(KeySpec {
cipher: crate::prelude::Cipher::AesGcm256,
Expand All @@ -300,9 +303,7 @@ mod test {

#[fixture]
fn storage_manager() -> StorageManager {
let config = vec![AdditionalConfig::FileStoreConfig {
db_dir: "testfolder".to_owned(),
}];
let config = TEST_KV_STORE.impl_config().additional_config;
StorageManager::new(nanoid!(), &config).unwrap().unwrap()
}

Expand Down
5 changes: 2 additions & 3 deletions src/storage/storage_backend/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use crate::{
key::ScopedKey,
storage_backend::{
kv_store::KvStorageBackendError,
sqlite_store::{SqliteBackend, SqliteBackendError},
sqlite_store::{SqliteBackend, SqliteBackendError, SqliteBackendInitializationError},
},
StorageManagerInitializationError,
},
Expand All @@ -32,7 +32,7 @@ pub enum StorageBackendError {
#[derive(Debug, Error)]
pub enum StorageBackendInitializationError {
#[error(transparent)]
Sqlite(#[from] SqliteBackendError),
Sqlite(#[from] SqliteBackendInitializationError),
}

#[enum_dispatch]
Expand Down Expand Up @@ -142,7 +142,6 @@ mod test {
fn create_file_storage_backend() -> StorageBackendExplicit {
let mut db_dir = TEST_TMP_DIR.path().to_path_buf();
db_dir.push(&nanoid!());
std::fs::create_dir(&db_dir).expect("should be able to create dir");
let additional_configs = vec![AdditionalConfig::FileStoreConfig {
db_dir: db_dir.to_string_lossy().to_string(),
}];
Expand Down
Loading
Loading