refactor(workspace): enforce layered crate boundaries

This commit is contained in:
elky
2026-07-15 23:47:19 +08:00
parent a728c090a9
commit 8616fe6ee2
969 changed files with 40187 additions and 27240 deletions
@@ -0,0 +1,15 @@
use crate::DataLayerError;
pub(crate) fn postgres_error(error: impl std::fmt::Display) -> DataLayerError {
DataLayerError::postgres(error)
}
pub(crate) trait SqlxResultExt<T> {
fn map_postgres_err(self) -> Result<T, DataLayerError>;
}
impl<T> SqlxResultExt<T> for Result<T, sqlx::Error> {
fn map_postgres_err(self) -> Result<T, DataLayerError> {
self.map_err(postgres_error)
}
}