added database models and models for continous use. Also changed get all paths according to that. Nothing is testet yet!
This commit is contained in:
7
src-tauri/src/models/db_models/exercise_db.rs
Normal file
7
src-tauri/src/models/db_models/exercise_db.rs
Normal file
@@ -0,0 +1,7 @@
|
||||
#[derive(Debug, sqlx::FromRow)]
|
||||
pub struct ExerciseDb {
|
||||
pub id: u16,
|
||||
pub node_id: u32,
|
||||
pub ex_type: String,
|
||||
pub content: String,
|
||||
}
|
||||
3
src-tauri/src/models/db_models/mod.rs
Normal file
3
src-tauri/src/models/db_models/mod.rs
Normal file
@@ -0,0 +1,3 @@
|
||||
pub mod path_db;
|
||||
pub mod node_db;
|
||||
pub mod exercise_db;
|
||||
7
src-tauri/src/models/db_models/node_db.rs
Normal file
7
src-tauri/src/models/db_models/node_db.rs
Normal file
@@ -0,0 +1,7 @@
|
||||
#[derive(Debug, sqlx::FromRow)]
|
||||
pub struct NodeDb {
|
||||
pub id: u32,
|
||||
pub title: String,
|
||||
pub description: String,
|
||||
pub path_id: String
|
||||
}
|
||||
17
src-tauri/src/models/db_models/path_db.rs
Normal file
17
src-tauri/src/models/db_models/path_db.rs
Normal file
@@ -0,0 +1,17 @@
|
||||
use chrono::{DateTime, Utc};
|
||||
|
||||
|
||||
#[derive(sqlx::FromRow, Debug)]
|
||||
pub struct PathDb {
|
||||
pub id: String,
|
||||
pub title: String,
|
||||
pub description: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, sqlx::FromRow)]
|
||||
pub struct MetadataDb {
|
||||
pub path_id : String,
|
||||
pub version: String,
|
||||
pub created_at: String,
|
||||
pub updated_at: String,
|
||||
}
|
||||
Reference in New Issue
Block a user