summaryrefslogtreecommitdiff
path: root/src/db/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/db/mod.rs')
-rw-r--r--src/db/mod.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/db/mod.rs b/src/db/mod.rs
index 2f2aaeb..1d64ed8 100644
--- a/src/db/mod.rs
+++ b/src/db/mod.rs
@@ -13,8 +13,17 @@ pub mod tool;
pub mod tooltag;
#[async_trait]
-pub trait DatabaseHandler {
+pub trait ProductDatabaseHandler {
async fn get_all(pool: SqlitePool) -> Result<Vec<Self>, AppError>
where
Self: Sized;
+
+ async fn post(
+ &self,
+ pool: &SqlitePool,
+ name: String,
+ description: String,
+ ) -> Result<Self, AppError>
+ where
+ Self: Sized;
}