updated structs a bit

This commit is contained in:
2025-10-28 20:34:10 +01:00
parent c53a4462cd
commit d02c1fa314
6 changed files with 21 additions and 7 deletions

3
src-tauri/Cargo.lock generated
View File

@@ -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",

View File

@@ -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"

View File

@@ -1,3 +1,4 @@
#[derive(Debug, sqlx::FromRow)]
pub struct Node {
id: u32,
title: String,

View File

@@ -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>,
}

View File

@@ -1,4 +1,4 @@
use sqlx::{pool, sqlite::SqlitePool, FromRow};
use sqlx::{sqlite::SqlitePool, FromRow};
use crate::models::path::Path;

View File

@@ -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,
}
}
}