summaryrefslogtreecommitdiff
path: root/src/db/mod.rs
diff options
context:
space:
mode:
authorWriterV2 <primary-v2@protonmail.com>2024-10-30 18:16:07 +0100
committerWriterV2 <primary-v2@protonmail.com>2024-10-30 18:16:07 +0100
commit6092e37e3a8e890cbe9d13305bcaf67daf410d93 (patch)
tree7d7e65972ac88eeb4504ab92b87b3ceeaca2584f /src/db/mod.rs
parent61f784a5fb437489d5dd3f629618d49279ff15a5 (diff)
Feat: Add product db handler method to post record + implement for story
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;
}