Update sea-orm dependencies to use workspace configuration; add dead code annotations in service error handling and settings service
This commit is contained in:
@@ -12,3 +12,8 @@ resolver = "3"
|
|||||||
|
|
||||||
[workspace.lints.clippy]
|
[workspace.lints.clippy]
|
||||||
module_inception = "allow"
|
module_inception = "allow"
|
||||||
|
|
||||||
|
[workspace.dependencies]
|
||||||
|
sea-orm = "2.0.0-rc"
|
||||||
|
sea-orm-cli = "2.0.0-rc"
|
||||||
|
sea-orm-migration = "2.0.0-rc"
|
||||||
|
|||||||
@@ -17,4 +17,4 @@ tracing = { version = "0.1.41", features = ["std", "attributes"] }
|
|||||||
tracing-subscriber = { version = "0.3.20", features = ["smallvec", "fmt", "ansi", "tracing-log", "std", "chrono", "json", "serde", "serde_json", "time", "tracing"] }
|
tracing-subscriber = { version = "0.3.20", features = ["smallvec", "fmt", "ansi", "tracing-log", "std", "chrono", "json", "serde", "serde_json", "time", "tracing"] }
|
||||||
serde_json = { version = "1.0.145", features = ["std"] }
|
serde_json = { version = "1.0.145", features = ["std"] }
|
||||||
serde = { version = "1.0.228", features = ["std", "derive"] }
|
serde = { version = "1.0.228", features = ["std", "derive"] }
|
||||||
sea-orm = { version = "2.0.0-rc" }
|
sea-orm = { workspace = true }
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
pub type ServiceError = Box<dyn std::error::Error + Send + Sync>;
|
pub type ServiceError = Box<dyn std::error::Error + Send + Sync>;
|
||||||
|
|
||||||
|
#[allow(dead_code)] // TODO: remove when used
|
||||||
pub trait IntoServiceError {
|
pub trait IntoServiceError {
|
||||||
fn into_service_error(self) -> ServiceError;
|
fn into_service_error(self) -> ServiceError;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,9 +15,10 @@ pub struct AppState {
|
|||||||
pub service: Arc<AppService>,
|
pub service: Arc<AppService>,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub type ServiceState<T: ?Sized + Send + Sync> = Arc<T>;
|
pub type ServiceState<T> = Arc<T>;
|
||||||
|
|
||||||
pub struct AppService {
|
pub struct AppService {
|
||||||
|
#[allow(dead_code)] // TODO: remove when used
|
||||||
pub settings: ServiceState<dyn SettingsStore>,
|
pub settings: ServiceState<dyn SettingsStore>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,11 +11,14 @@ use crate::errors::service_error::{IntoServiceError, ServiceError};
|
|||||||
|
|
||||||
#[async_trait::async_trait]
|
#[async_trait::async_trait]
|
||||||
pub trait SettingsStore: Send + Sync {
|
pub trait SettingsStore: Send + Sync {
|
||||||
|
#[allow(dead_code)] // TODO: remove when used
|
||||||
async fn get_setting(&self, key: &str) -> Result<String, ServiceError>;
|
async fn get_setting(&self, key: &str) -> Result<String, ServiceError>;
|
||||||
|
#[allow(dead_code)] // TODO: remove when used
|
||||||
async fn set_setting(&self, key: &str, value: String) -> Result<(), ServiceError>;
|
async fn set_setting(&self, key: &str, value: String) -> Result<(), ServiceError>;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct SettingsService {
|
pub struct SettingsService {
|
||||||
|
#[allow(dead_code)] // TODO: remove when used
|
||||||
connection: Arc<DatabaseConnection>,
|
connection: Arc<DatabaseConnection>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ chrono = { version = "0.4", features = ["serde"] }
|
|||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
tokio = { version = "1.47.0", features = ["full"] }
|
tokio = { version = "1.47.0", features = ["full"] }
|
||||||
sea-orm = { version = "2.0.0-rc", features = [ "sqlx-postgres", "sqlx-mysql", "sqlx-sqlite", "runtime-tokio-rustls", "macros", "mock", "with-chrono", "with-json", "with-uuid", "sqlite-use-returning-for-3_35", "mariadb-use-returning" ] }
|
sea-orm = { workspace = true, features = [ "sqlx-postgres", "sqlx-mysql", "sqlx-sqlite", "runtime-tokio-rustls", "macros", "mock", "with-chrono", "with-json", "with-uuid", "sqlite-use-returning-for-3_35", "mariadb-use-returning" ] }
|
||||||
log = "0.4.28"
|
log = "0.4.28"
|
||||||
|
|
||||||
[lints]
|
[lints]
|
||||||
|
|||||||
@@ -11,11 +11,11 @@ path = "src/lib.rs"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
tokio = { version = "1", features = ["macros", "rt", "rt-multi-thread"] }
|
tokio = { version = "1", features = ["macros", "rt", "rt-multi-thread"] }
|
||||||
sea-orm-cli = { version = "2.0.0-rc", features = ["sqlx-postgres", "sqlx-mysql", "sqlx-sqlite", "runtime-tokio"] }
|
sea-orm-cli = { workspace = true, features = ["sqlx-postgres", "sqlx-mysql", "sqlx-sqlite", "runtime-tokio"] }
|
||||||
log = "0.4.28"
|
log = "0.4.28"
|
||||||
|
|
||||||
[dependencies.sea-orm-migration]
|
[dependencies.sea-orm-migration]
|
||||||
version = "2.0.0-rc"
|
workspace = true
|
||||||
features = [
|
features = [
|
||||||
"runtime-tokio-rustls", # `ASYNC_RUNTIME` feature
|
"runtime-tokio-rustls", # `ASYNC_RUNTIME` feature
|
||||||
"sqlx-postgres", "sqlx-mysql", "sqlx-sqlite" # `DATABASE_DRIVER` features
|
"sqlx-postgres", "sqlx-mysql", "sqlx-sqlite" # `DATABASE_DRIVER` features
|
||||||
|
|||||||
Reference in New Issue
Block a user