updated structs a bit
This commit is contained in:
3
src-tauri/Cargo.lock
generated
3
src-tauri/Cargo.lock
generated
@@ -496,8 +496,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "145052bdd345b87320e369255277e3fb5152762ad123a901ef5c262dd38fe8d2"
|
||||
dependencies = [
|
||||
"iana-time-zone",
|
||||
"js-sys",
|
||||
"num-traits",
|
||||
"serde",
|
||||
"wasm-bindgen",
|
||||
"windows-link 0.2.0",
|
||||
]
|
||||
|
||||
@@ -1030,6 +1032,7 @@ checksum = "7fd99930f64d146689264c637b5af2f0233a933bef0d8570e2526bf9e083192d"
|
||||
name = "flalingo"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"sqlx",
|
||||
|
||||
@@ -26,4 +26,5 @@ serde_json = "1"
|
||||
# SQLx und Tokio für asynchrone DB-Zugriffe
|
||||
sqlx = { version = "0.8.6", features = ["runtime-tokio-rustls", "sqlite", "macros", "migrate"] }
|
||||
tokio = { version = "1", features = ["full"] }
|
||||
chrono = "0.4.42"
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#[derive(Debug, sqlx::FromRow)]
|
||||
pub struct Node {
|
||||
id: u32,
|
||||
title: String,
|
||||
|
||||
@@ -1,12 +1,21 @@
|
||||
use chrono::{DateTime, Utc};
|
||||
use sqlx::sqlite::SqliteRow;
|
||||
use sqlx::Row;
|
||||
|
||||
#[derive(Debug, sqlx::FromRow)]
|
||||
use crate::models::node::Node;
|
||||
|
||||
#[derive(sqlx::FromRow, Debug)]
|
||||
pub struct Path {
|
||||
id: String,
|
||||
title: String,
|
||||
description: String,
|
||||
nodes: Vec<Node>,
|
||||
metadata: Metadata,
|
||||
}
|
||||
|
||||
pub struct PathVersions {
|
||||
path_id: String,
|
||||
version_number: String,
|
||||
#[derive(Debug, sqlx::FromRow)]
|
||||
pub struct Metadata {
|
||||
versions: Vec<String>,
|
||||
created_at: DateTime<Utc>,
|
||||
updated_at: DateTime<Utc>,
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use sqlx::{pool, sqlite::SqlitePool, FromRow};
|
||||
use sqlx::{sqlite::SqlitePool, FromRow};
|
||||
|
||||
use crate::models::path::Path;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
interface Path {
|
||||
id: number,
|
||||
id: string,
|
||||
title: string,
|
||||
description: string,
|
||||
nodes: Node[],
|
||||
@@ -8,4 +8,4 @@ interface Path {
|
||||
createdAt: Date,
|
||||
updatedAt: Date,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user