summaryrefslogtreecommitdiff
path: root/src/db
diff options
context:
space:
mode:
Diffstat (limited to 'src/db')
-rw-r--r--src/db/game.rs4
-rw-r--r--src/db/product.rs2
-rw-r--r--src/db/story.rs3
-rw-r--r--src/db/tool.rs4
4 files changed, 13 insertions, 0 deletions
diff --git a/src/db/game.rs b/src/db/game.rs
index 6afbbec..0620314 100644
--- a/src/db/game.rs
+++ b/src/db/game.rs
@@ -1,6 +1,10 @@
+use super::product::ProductMarker;
+
#[derive(Debug, serde::Serialize, sqlx::FromRow)]
pub struct Game {
pub id: i64,
pub repolink: String,
pub pid: i64,
}
+
+impl ProductMarker for Game {}
diff --git a/src/db/product.rs b/src/db/product.rs
index e112679..09b0dff 100644
--- a/src/db/product.rs
+++ b/src/db/product.rs
@@ -6,3 +6,5 @@ pub struct Product {
pub uploaddate: i64,
pub updatedate: i64,
}
+
+pub trait ProductMarker {}
diff --git a/src/db/story.rs b/src/db/story.rs
index 5acc818..ee79e4f 100644
--- a/src/db/story.rs
+++ b/src/db/story.rs
@@ -4,6 +4,7 @@ use sqlx::SqlitePool;
use crate::error::AppError;
use crate::db::product::Product;
+use super::product::ProductMarker;
use super::ProductDatabaseHandler;
@@ -16,6 +17,8 @@ pub struct Story {
pub pid: i64,
}
+impl ProductMarker for Story {}
+
#[async_trait]
impl ProductDatabaseHandler for Story {
async fn get_all(pool: SqlitePool) -> Result<Vec<Self>, AppError>
diff --git a/src/db/tool.rs b/src/db/tool.rs
index 5e6ea0a..5f23f54 100644
--- a/src/db/tool.rs
+++ b/src/db/tool.rs
@@ -1,6 +1,10 @@
+use super::product::ProductMarker;
+
#[derive(Debug, serde::Serialize, sqlx::FromRow)]
pub struct Tool {
pub id: i64,
pub repolink: String,
pub pid: i64,
}
+
+impl ProductMarker for Tool {}