Skip to content

Commit

Permalink
lll
Browse files Browse the repository at this point in the history
  • Loading branch information
Eragonfr committed Mar 5, 2024
1 parent 07ba38f commit bd24d7c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion syncserver-db-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ thiserror.workspace=true

deadpool = { git = "https://github.com/mozilla-services/deadpool", tag = "deadpool-v0.7.0" }
diesel = { version = "1.4", features = ["mysql", "sqlite","r2d2"] }
diesel_migrations = { version = "1.4.0", features = ["mysql"] }
diesel_migrations = { version = "1.4.0", features = ["mysql", "sqlite"] }
syncserver-common = { path = "../syncserver-common" }
1 change: 1 addition & 0 deletions syncserver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,4 @@ no_auth = []
py_verifier = ["tokenserver-auth/py"]
mysql = ["syncstorage-db/mysql"]
spanner = ["syncstorage-db/spanner"]
sqlite = ["syncstorage-db/sqlite"]
6 changes: 6 additions & 0 deletions syncserver/src/db/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
pub mod mock;
pub mod mysql;
pub mod spanner;
pub mod sqlite;
#[cfg(test)]
mod tests;
pub mod transaction;
Expand Down Expand Up @@ -35,6 +36,11 @@ pub async fn pool_from_settings(
"spanner" => Box::new(
spanner::pool::SpannerDbPool::new(settings, metrics, blocking_threadpool).await?,
),
"sqlite" => Box::new(sqlite::pool::SqliteDbPool::new(
settings,
metrics,
blocking_threadpool,
)?),
_ => Err(DbErrorKind::InvalidUrl(settings.database_url.to_owned()))?,
})
}

0 comments on commit bd24d7c

Please sign in to comment.