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
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ assert_matches = "1.5.0"
async-std = { version = "1.13.0", features = ["attributes"], default-features = false }
httpmock = { version = "0.7.0", default-features = false }
rstest = "0.23.0"
serde_json = "1.0.133"
tempfile = "3.14.0"
7 changes: 4 additions & 3 deletions src/db_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ use std::fmt;
use std::marker::PhantomData;
use std::path::Path;

use error::{ConfigurationError, NewConfigurationError};
pub use error::ConfigurationError;
use error::NewConfigurationError;
use sqlx::sqlite::{SqliteConnectOptions, SqliteRow};
use sqlx::{query_as, FromRow, QueryBuilder, Row, Sqlite, SqlitePool};
use tracing::{info, instrument, trace};
Expand Down Expand Up @@ -300,15 +301,15 @@ impl SqliteScanPathService {
}

#[cfg(test)]
async fn ro_memory() -> Self {
pub(crate) async fn ro_memory() -> Self {
let db = Self::memory().await;
db.pool
.set_connect_options(SqliteConnectOptions::new().read_only(true));
db
}

#[cfg(test)]
async fn memory() -> Self {
pub(crate) async fn memory() -> Self {
let pool = SqlitePool::connect(":memory:").await.unwrap();
sqlx::migrate!().run(&pool).await.unwrap();
Self { pool }
Expand Down
Loading
Loading