Added repositories into AppState

This commit is contained in:
micialware committed 2026-08-31 12:12:14 +03:00
1 parent 6c20561ede
commit 11d5144db5
9 files changed
+67 -23

No files matched your search

+9
View File
@@ -30,6 +30,7 @@ pub trait TableAccessQuerySet<T> {
fn update_params(entity: &T) -> impl Params;
}
#[derive(Clone)]
pub struct SqliteDbLayer<T, Q>
where
Q: TableAccessQuerySet<T>,
@@ -37,6 +38,14 @@ where
_phantom: PhantomData<(T, Q)>,
}
impl<T, Q: TableAccessQuerySet<T>> Default for SqliteDbLayer<T, Q>{
fn default() -> Self {
Self{
_phantom: PhantomData,
}
}
}
impl<T: EntityData, Q: TableAccessQuerySet<T>> DbLayer<T> for SqliteDbLayer<T, Q> {
fn write_entity(&self, entity: &T, connection: &Connection) -> MaybeError {
let time = Instant::now();