From 61f784a5fb437489d5dd3f629618d49279ff15a5 Mon Sep 17 00:00:00 2001 From: WriterV2 Date: Wed, 30 Oct 2024 17:04:26 +0100 Subject: Feat: Add db handler method to get all records from table + implement for story --- src/db/mod.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/db/mod.rs') diff --git a/src/db/mod.rs b/src/db/mod.rs index 01111d8..2f2aaeb 100644 --- a/src/db/mod.rs +++ b/src/db/mod.rs @@ -1,3 +1,8 @@ +use sqlx::SqlitePool; + +use crate::error::AppError; +use async_trait::async_trait; + pub mod game; pub mod gametag; pub mod product; @@ -6,3 +11,10 @@ pub mod storytag; pub mod tag; pub mod tool; pub mod tooltag; + +#[async_trait] +pub trait DatabaseHandler { + async fn get_all(pool: SqlitePool) -> Result, AppError> + where + Self: Sized; +} -- cgit v1.2.3