-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Instead of having multiple DB services traits for each route, we should implement a generic one following CRUD pattern. For example:
#[async_trait]
pub trait DBService<T, K>: Send + Sync + Clone + 'static
where
T: Send + Sync + 'static,
K: Send + Sync + 'static,
{
async fn get_all(&self) -> Result<Vec<T>, reject::Rejection>;
async fn get_by_id(&self, id: i64) -> Result<Option<T>, reject::Rejection>;
async fn create(&self, item: K) -> Result<T, reject::Rejection>;
async fn update(&self, id: i64, item: K) -> Result<T, reject::Rejection>;
async fn remove(&self, id: i64) -> Result<(), reject::Rejection>;
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request