diff options
| -rw-r--r-- | src/db/game.rs | 6 | ||||
| -rw-r--r-- | src/db/gametag.rs | 5 | ||||
| -rw-r--r-- | src/db/mod.rs | 8 | ||||
| -rw-r--r-- | src/db/product.rs | 8 | ||||
| -rw-r--r-- | src/db/story.rs | 8 | ||||
| -rw-r--r-- | src/db/storytag.rs | 5 | ||||
| -rw-r--r-- | src/db/tag.rs | 5 | ||||
| -rw-r--r-- | src/db/tool.rs | 6 | ||||
| -rw-r--r-- | src/db/tooltag.rs | 5 | ||||
| -rw-r--r-- | src/main.rs | 2 |
10 files changed, 58 insertions, 0 deletions
diff --git a/src/db/game.rs b/src/db/game.rs new file mode 100644 index 0000000..6afbbec --- /dev/null +++ b/src/db/game.rs @@ -0,0 +1,6 @@ +#[derive(Debug, serde::Serialize, sqlx::FromRow)] +pub struct Game { + pub id: i64, + pub repolink: String, + pub pid: i64, +} diff --git a/src/db/gametag.rs b/src/db/gametag.rs new file mode 100644 index 0000000..335d2a4 --- /dev/null +++ b/src/db/gametag.rs @@ -0,0 +1,5 @@ +#[derive(Debug, serde::Serialize, sqlx::FromRow)] +pub struct Gametag { + pub gid: i64, + pub tgid: i64, +} diff --git a/src/db/mod.rs b/src/db/mod.rs new file mode 100644 index 0000000..b5b1488 --- /dev/null +++ b/src/db/mod.rs @@ -0,0 +1,8 @@ +mod game; +mod gametag; +mod product; +mod story; +mod storytag; +mod tag; +mod tool; +mod tooltag; diff --git a/src/db/product.rs b/src/db/product.rs new file mode 100644 index 0000000..e112679 --- /dev/null +++ b/src/db/product.rs @@ -0,0 +1,8 @@ +#[derive(Debug, serde::Serialize, sqlx::FromRow)] +pub struct Product { + pub id: i64, + pub name: String, + pub description: String, + pub uploaddate: i64, + pub updatedate: i64, +} diff --git a/src/db/story.rs b/src/db/story.rs new file mode 100644 index 0000000..10fc49b --- /dev/null +++ b/src/db/story.rs @@ -0,0 +1,8 @@ +#[derive(Debug, serde::Serialize, sqlx::FromRow)] +pub struct Story { + pub id: i64, + pub language: String, + pub pdf: Vec<u8>, + pub epub: Vec<u8>, + pub pid: i64, +} diff --git a/src/db/storytag.rs b/src/db/storytag.rs new file mode 100644 index 0000000..0953fc2 --- /dev/null +++ b/src/db/storytag.rs @@ -0,0 +1,5 @@ +#[derive(Debug, serde::Serialize, sqlx::FromRow)] +pub struct Storytag { + pub sid: i64, + pub tgid: i64, +} diff --git a/src/db/tag.rs b/src/db/tag.rs new file mode 100644 index 0000000..df55a8a --- /dev/null +++ b/src/db/tag.rs @@ -0,0 +1,5 @@ +#[derive(Debug, serde::Serialize, sqlx::FromRow)] +pub struct Tag { + pub id: i64, + pub name: String, +} diff --git a/src/db/tool.rs b/src/db/tool.rs new file mode 100644 index 0000000..5e6ea0a --- /dev/null +++ b/src/db/tool.rs @@ -0,0 +1,6 @@ +#[derive(Debug, serde::Serialize, sqlx::FromRow)] +pub struct Tool { + pub id: i64, + pub repolink: String, + pub pid: i64, +} diff --git a/src/db/tooltag.rs b/src/db/tooltag.rs new file mode 100644 index 0000000..393e687 --- /dev/null +++ b/src/db/tooltag.rs @@ -0,0 +1,5 @@ +#[derive(Debug, serde::Serialize, sqlx::FromRow)] +pub struct Tooltag { + pub tid: i64, + pub tgid: i64, +} diff --git a/src/main.rs b/src/main.rs index d99fbe9..b8e1302 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,6 +9,8 @@ use maud::{html, Markup, DOCTYPE}; use sqlx::sqlite::SqlitePoolOptions; use tower_http::services::ServeDir; +mod db; + struct AppError(anyhow::Error); impl IntoResponse for AppError { |
