diff options
| author | WriterV2 <primary-v2@protonmail.com> | 2024-10-30 18:16:07 +0100 |
|---|---|---|
| committer | WriterV2 <primary-v2@protonmail.com> | 2024-10-30 18:16:07 +0100 |
| commit | 6092e37e3a8e890cbe9d13305bcaf67daf410d93 (patch) | |
| tree | 7d7e65972ac88eeb4504ab92b87b3ceeaca2584f /src/db/mod.rs | |
| parent | 61f784a5fb437489d5dd3f629618d49279ff15a5 (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.rs | 11 |
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; } |
