diff --git a/.gitignore b/.gitignore index 5d87a51..eb20bb0 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,4 @@ vite.config.js.timestamp-* vite.config.ts.timestamp-* /target -test.db \ No newline at end of file +test.db* \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 8d9f6f5..f6fded3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -91,60 +91,11 @@ dependencies = [ "libc", ] -[[package]] -name = "anstream" -version = "0.6.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" -dependencies = [ - "anstyle", - "anstyle-parse", - "anstyle-query", - "anstyle-wincon", - "colorchoice", - "is_terminal_polyfill", - "utf8parse", -] - -[[package]] -name = "anstyle" -version = "1.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" - -[[package]] -name = "anstyle-parse" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" -dependencies = [ - "utf8parse", -] - -[[package]] -name = "anstyle-query" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" -dependencies = [ - "windows-sys 0.59.0", -] - -[[package]] -name = "anstyle-wincon" -version = "3.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125" -dependencies = [ - "anstyle", - "windows-sys 0.59.0", -] - [[package]] name = "anyhow" -version = "1.0.92" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74f37166d7d48a0284b99dd824694c26119c700b53bf0d1540cdb147dbdaaf13" +checksum = "4c95c10ba0b00a02636238b814946408b1322d5ac4760326e6fb8ec956d85775" [[package]] name = "arrayvec" @@ -152,125 +103,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" -[[package]] -name = "async-attributes" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3203e79f4dd9bdda415ed03cf14dae5a2bf775c683a00f94e9cd1faf0f596e5" -dependencies = [ - "quote", - "syn 1.0.109", -] - -[[package]] -name = "async-channel" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" -dependencies = [ - "concurrent-queue", - "event-listener 2.5.3", - "futures-core", -] - -[[package]] -name = "async-channel" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" -dependencies = [ - "concurrent-queue", - "event-listener-strategy", - "futures-core", - "pin-project-lite", -] - -[[package]] -name = "async-executor" -version = "1.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ca9a001c1e8ba5149f91a74362376cc6bc5b919d92d988668657bd570bdcec" -dependencies = [ - "async-task", - "concurrent-queue", - "fastrand", - "futures-lite", - "slab", -] - -[[package]] -name = "async-global-executor" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" -dependencies = [ - "async-channel 2.3.1", - "async-executor", - "async-io", - "async-lock", - "blocking", - "futures-lite", - "once_cell", - "tokio", -] - -[[package]] -name = "async-io" -version = "2.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "444b0228950ee6501b3568d3c93bf1176a1fdbc3b758dcd9475046d30f4dc7e8" -dependencies = [ - "async-lock", - "cfg-if", - "concurrent-queue", - "futures-io", - "futures-lite", - "parking", - "polling", - "rustix", - "slab", - "tracing", - "windows-sys 0.59.0", -] - -[[package]] -name = "async-lock" -version = "3.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" -dependencies = [ - "event-listener 5.3.1", - "event-listener-strategy", - "pin-project-lite", -] - -[[package]] -name = "async-std" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c634475f29802fde2b8f0b505b1bd00dfe4df7d4a000f0b36f7671197d5c3615" -dependencies = [ - "async-attributes", - "async-channel 1.9.0", - "async-global-executor", - "async-io", - "async-lock", - "crossbeam-utils", - "futures-channel", - "futures-core", - "futures-io", - "futures-lite", - "gloo-timers", - "kv-log-macro", - "log", - "memchr", - "once_cell", - "pin-project-lite", - "pin-utils", - "slab", - "wasm-bindgen-futures", -] - [[package]] name = "async-stream" version = "0.3.6" @@ -293,12 +125,6 @@ dependencies = [ "syn 2.0.87", ] -[[package]] -name = "async-task" -version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" - [[package]] name = "async-trait" version = "0.1.83" @@ -499,19 +325,6 @@ dependencies = [ "objc2", ] -[[package]] -name = "blocking" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea" -dependencies = [ - "async-channel 2.3.1", - "async-task", - "futures-io", - "futures-lite", - "piper", -] - [[package]] name = "borsh" version = "1.3.0" @@ -740,46 +553,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "clap" -version = "4.5.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97f376d85a664d5837dbae44bf546e6477a679ff6610010f17276f686d867e8" -dependencies = [ - "clap_builder", - "clap_derive", -] - -[[package]] -name = "clap_builder" -version = "4.5.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54" -dependencies = [ - "anstream", - "anstyle", - "clap_lex", - "strsim", -] - -[[package]] -name = "clap_derive" -version = "4.5.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" -dependencies = [ - "heck 0.5.0", - "proc-macro2", - "quote", - "syn 2.0.87", -] - -[[package]] -name = "clap_lex" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" - [[package]] name = "cocoa" version = "0.26.0" @@ -810,12 +583,6 @@ dependencies = [ "objc", ] -[[package]] -name = "colorchoice" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" - [[package]] name = "combine" version = "4.6.7" @@ -1213,13 +980,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "entity" -version = "0.1.0" -dependencies = [ - "sea-orm", -] - [[package]] name = "equivalent" version = "1.0.1" @@ -1257,12 +1017,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "event-listener" -version = "2.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" - [[package]] name = "event-listener" version = "5.3.1" @@ -1274,16 +1028,6 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "event-listener-strategy" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" -dependencies = [ - "event-listener 5.3.1", - "pin-project-lite", -] - [[package]] name = "fastrand" version = "2.1.1" @@ -1461,19 +1205,6 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" -[[package]] -name = "futures-lite" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f1fa2f9765705486b33fd2acf1577f8ec449c2ba1f318ae5447697b7c08d210" -dependencies = [ - "fastrand", - "futures-core", - "futures-io", - "parking", - "pin-project-lite", -] - [[package]] name = "futures-macro" version = "0.3.31" @@ -1746,18 +1477,6 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" -[[package]] -name = "gloo-timers" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbb143cf96099802033e0d4f4963b19fd2e0b728bcf076cd9cf7f6634f092994" -dependencies = [ - "futures-channel", - "futures-core", - "js-sys", - "wasm-bindgen", -] - [[package]] name = "gobject-sys" version = "0.18.0" @@ -1892,12 +1611,6 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" -[[package]] -name = "hermit-abi" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" - [[package]] name = "hex" version = "0.4.3" @@ -2298,12 +2011,6 @@ dependencies = [ "once_cell", ] -[[package]] -name = "is_terminal_polyfill" -version = "1.70.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" - [[package]] name = "itertools" version = "0.12.1" @@ -2448,15 +2155,6 @@ dependencies = [ "selectors", ] -[[package]] -name = "kv-log-macro" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" -dependencies = [ - "log", -] - [[package]] name = "lazy_static" version = "1.5.0" @@ -2560,9 +2258,6 @@ name = "log" version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" -dependencies = [ - "value-bag", -] [[package]] name = "mac" @@ -2593,15 +2288,6 @@ dependencies = [ "tendril", ] -[[package]] -name = "matchers" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" -dependencies = [ - "regex-automata 0.1.10", -] - [[package]] name = "matches" version = "0.1.10" @@ -2639,14 +2325,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "migration" -version = "0.1.0" -dependencies = [ - "async-std", - "sea-orm-migration", -] - [[package]] name = "mime" version = "0.3.17" @@ -2675,7 +2353,7 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" dependencies = [ - "hermit-abi 0.3.9", + "hermit-abi", "libc", "wasi 0.11.0+wasi-snapshot-preview1", "windows-sys 0.52.0", @@ -3187,10 +2865,9 @@ dependencies = [ name = "panorama-core" version = "0.1.0" dependencies = [ - "entity", - "migration", + "anyhow", "prost", - "sea-orm", + "sqlx", "tonic", "tonic-build", ] @@ -3427,17 +3104,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "piper" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96c8c490f422ef9a4efd2cb5b42b76c8613d7e7dfc1caf667b8a3350a5acc066" -dependencies = [ - "atomic-waker", - "fastrand", - "futures-io", -] - [[package]] name = "pkcs1" version = "0.7.5" @@ -3491,21 +3157,6 @@ dependencies = [ "miniz_oxide", ] -[[package]] -name = "polling" -version = "3.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc2790cd301dec6cd3b7a025e4815cf825724a51c98dccfe6a3e55f05ffb6511" -dependencies = [ - "cfg-if", - "concurrent-queue", - "hermit-abi 0.4.0", - "pin-project-lite", - "rustix", - "tracing", - "windows-sys 0.59.0", -] - [[package]] name = "powerfmt" version = "0.2.0" @@ -3843,17 +3494,8 @@ checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.8", - "regex-syntax 0.8.5", -] - -[[package]] -name = "regex-automata" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" -dependencies = [ - "regex-syntax 0.6.29", + "regex-automata", + "regex-syntax", ] [[package]] @@ -3864,15 +3506,9 @@ checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.5", + "regex-syntax", ] -[[package]] -name = "regex-syntax" -version = "0.6.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" - [[package]] name = "regex-syntax" version = "0.8.5" @@ -4168,23 +3804,6 @@ dependencies = [ "uuid", ] -[[package]] -name = "sea-orm-cli" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70a157f42d291ccbd6e913b9d9b12dbe2ccbcf0472efc60c8715dd1254083aec" -dependencies = [ - "chrono", - "clap", - "dotenvy", - "glob", - "regex", - "sea-schema", - "tracing", - "tracing-subscriber", - "url", -] - [[package]] name = "sea-orm-macros" version = "1.1.1" @@ -4199,23 +3818,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "sea-orm-migration" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63ba07e9f2479cc671758fcb1edee42ff2e32c34b3e67ab41d0af1e41f73c74e" -dependencies = [ - "async-trait", - "clap", - "dotenvy", - "futures", - "sea-orm", - "sea-orm-cli", - "sea-schema", - "tracing", - "tracing-subscriber", -] - [[package]] name = "sea-query" version = "0.32.0" @@ -4227,7 +3829,6 @@ dependencies = [ "inherent", "ordered-float", "rust_decimal", - "sea-query-derive", "serde_json", "time", "uuid", @@ -4249,43 +3850,6 @@ dependencies = [ "uuid", ] -[[package]] -name = "sea-query-derive" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9834af2c4bd8c5162f00c89f1701fb6886119a88062cf76fe842ea9e232b9839" -dependencies = [ - "darling", - "heck 0.4.1", - "proc-macro2", - "quote", - "syn 2.0.87", - "thiserror", -] - -[[package]] -name = "sea-schema" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aab1592d17860a9a8584d9b549aebcd06f7bdc3ff615f71752486ba0b05b1e6e" -dependencies = [ - "futures", - "sea-query", - "sea-schema-derive", -] - -[[package]] -name = "sea-schema-derive" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "debdc8729c37fdbf88472f97fd470393089f997a909e535ff67c544d18cfccf0" -dependencies = [ - "heck 0.4.1", - "proc-macro2", - "quote", - "syn 2.0.87", -] - [[package]] name = "seahash" version = "4.1.0" @@ -4491,15 +4055,6 @@ dependencies = [ "digest", ] -[[package]] -name = "sharded-slab" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" -dependencies = [ - "lazy_static", -] - [[package]] name = "shared_child" version = "1.0.1" @@ -4676,7 +4231,7 @@ dependencies = [ "crc", "crossbeam-queue", "either", - "event-listener 5.3.1", + "event-listener", "futures-channel", "futures-core", "futures-intrusive", @@ -5370,16 +4925,6 @@ dependencies = [ "syn 2.0.87", ] -[[package]] -name = "thread_local" -version = "1.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" -dependencies = [ - "cfg-if", - "once_cell", -] - [[package]] name = "time" version = "0.3.36" @@ -5668,21 +5213,6 @@ dependencies = [ "once_cell", ] -[[package]] -name = "tracing-subscriber" -version = "0.3.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" -dependencies = [ - "matchers", - "once_cell", - "regex", - "sharded-slab", - "thread_local", - "tracing", - "tracing-core", -] - [[package]] name = "tray-icon" version = "0.19.1" @@ -5850,12 +5380,6 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" -[[package]] -name = "utf8parse" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" - [[package]] name = "uuid" version = "1.11.0" @@ -5866,12 +5390,6 @@ dependencies = [ "serde", ] -[[package]] -name = "value-bag" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ef4c4aa54d5d05a279399bfa921ec387b7aba77caf7a682ae8d86785b8fdad2" - [[package]] name = "vcpkg" version = "0.2.15" diff --git a/Cargo.toml b/Cargo.toml index 177d9a7..47049e5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,2 +1,2 @@ workspace.resolver = "2" -workspace.members = ["src-tauri", "core", "core/migration", "core/entity"] +workspace.members = ["src-tauri", "core"] diff --git a/bun.lockb b/bun.lockb index 1fa71e7..5251820 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/core/Cargo.toml b/core/Cargo.toml index 21e2028..d240b88 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -4,17 +4,10 @@ version = "0.1.0" edition = "2021" [dependencies] -entity = { path = "entity" } -migration = { path = "migration" } - +anyhow = "1.0.93" prost = "0.13.3" +sqlx = { version = "0.8.2", features = ["runtime-tokio", "sqlite"] } tonic = "0.12.3" -sea-orm = { version = "1.1.1", features = [ - "sqlx-sqlite", - "runtime-tokio-rustls", - "macros", -] } - [build-dependencies] tonic-build = "0.12.3" diff --git a/core/entity/Cargo.toml b/core/entity/Cargo.toml deleted file mode 100644 index 0955fbe..0000000 --- a/core/entity/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "entity" -version = "0.1.0" -edition = "2021" - -[dependencies] -sea-orm = { version = "1.1.1", features = [ - "sqlx-sqlite", - "runtime-tokio-rustls", - "macros", -] } diff --git a/core/entity/src/generated/mod.rs b/core/entity/src/generated/mod.rs deleted file mode 100644 index b21764a..0000000 --- a/core/entity/src/generated/mod.rs +++ /dev/null @@ -1,5 +0,0 @@ -//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.1 - -pub mod prelude; - -pub mod node; diff --git a/core/entity/src/generated/node.rs b/core/entity/src/generated/node.rs deleted file mode 100644 index d994275..0000000 --- a/core/entity/src/generated/node.rs +++ /dev/null @@ -1,19 +0,0 @@ -//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.1 - -use sea_orm::entity::prelude::*; - -#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)] -#[sea_orm(table_name = "node")] -pub struct Model { - #[sea_orm(primary_key, auto_increment = false, column_type = "Text")] - pub id: String, - #[sea_orm(column_type = "custom(\"datetime\")")] - pub created_at: String, - #[sea_orm(column_type = "custom(\"datetime\")")] - pub updated_at: String, -} - -#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] -pub enum Relation {} - -impl ActiveModelBehavior for ActiveModel {} diff --git a/core/entity/src/generated/prelude.rs b/core/entity/src/generated/prelude.rs deleted file mode 100644 index 9e933c6..0000000 --- a/core/entity/src/generated/prelude.rs +++ /dev/null @@ -1,3 +0,0 @@ -//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.1 - -pub use super::node::Entity as Node; diff --git a/core/entity/src/lib.rs b/core/entity/src/lib.rs deleted file mode 100644 index 9829951..0000000 --- a/core/entity/src/lib.rs +++ /dev/null @@ -1 +0,0 @@ -mod generated; diff --git a/core/migration/Cargo.toml b/core/migration/Cargo.toml deleted file mode 100644 index 08941dd..0000000 --- a/core/migration/Cargo.toml +++ /dev/null @@ -1,16 +0,0 @@ -[package] -name = "migration" -version = "0.1.0" -edition = "2021" -publish = false - -[lib] -name = "migration" -path = "src/lib.rs" - -[dependencies] -async-std = { version = "1", features = ["attributes", "tokio1"] } - -[dependencies.sea-orm-migration] -version = "1.1.0" -features = ["sqlx-sqlite", "runtime-tokio-rustls"] diff --git a/core/migration/src/lib.rs b/core/migration/src/lib.rs deleted file mode 100644 index 3ae60b4..0000000 --- a/core/migration/src/lib.rs +++ /dev/null @@ -1,10 +0,0 @@ -pub use sea_orm_migration::prelude::*; - -pub struct Migrator; - -#[async_trait::async_trait] -impl MigratorTrait for Migrator { - fn migrations() -> Vec> { - vec![] - } -} diff --git a/core/migration/src/main.rs b/core/migration/src/main.rs deleted file mode 100644 index c6b6e48..0000000 --- a/core/migration/src/main.rs +++ /dev/null @@ -1,6 +0,0 @@ -use sea_orm_migration::prelude::*; - -#[async_std::main] -async fn main() { - cli::run_cli(migration::Migrator).await; -} diff --git a/core/migrations/20241125030145_initial.down.sql b/core/migrations/20241125030145_initial.down.sql new file mode 100644 index 0000000..d4ceac7 --- /dev/null +++ b/core/migrations/20241125030145_initial.down.sql @@ -0,0 +1,4 @@ +DROP TABLE "mail_message"; +DROP TABLE "mail_mailbox"; +DROP TABLE "mail_account"; +DROP TABLE "node"; \ No newline at end of file diff --git a/core/migrations/20241125030145_initial.up.sql b/core/migrations/20241125030145_initial.up.sql new file mode 100644 index 0000000..67ae8d0 --- /dev/null +++ b/core/migrations/20241125030145_initial.up.sql @@ -0,0 +1,41 @@ +CREATE TABLE "node" ( + "id" TEXT NOT NULL PRIMARY KEY, + "name" TEXT, + + "created_at" DATETIME NOT NULL, + "updated_at" DATETIME NOT NULL +); + +CREATE TABLE "mail_account" ( + "node_id" TEXT NOT NULL PRIMARY KEY, + + "imap_server_host" TEXT, + "imap_server_port" INT, + "imap_server_auth_method" TEXT, + "imap_server_auth_username" TEXT, + "imap_server_auth_password" TEXT, + + "smtp_server_host" TEXT, + "smtp_server_port" INT, + + FOREIGN KEY ("node_id") REFERENCES "node"("id") +); + +CREATE TABLE "mail_mailbox" ( + "node_id" TEXT NOT NULL PRIMARY KEY, + "mail_account_id" TEXT NOT NULL, + "name" TEXT NOT NULL, + + FOREIGN KEY ("node_id") REFERENCES "node"("id"), + FOREIGN KEY ("mail_account_id") REFERENCES "mail_account"("node_id") +); + +CREATE TABLE "maiL_message" ( + "node_id" TEXT NOT NULL PRIMARY KEY, + "mail_account_id" TEXT NOT NULL, + "mail_mailbox_id" TEXT NOT NULL, + + FOREIGN KEY ("node_id") REFERENCES "node"("id"), + FOREIGN KEY ("mail_account_id") REFERENCES "mail_account"("node_id") + FOREIGN KEY ("mail_mailbox_id") REFERENCES "mail_mailbox"("node_id") +); \ No newline at end of file diff --git a/core/src/dal.rs b/core/src/dal.rs index 121636e..764ea75 100644 --- a/core/src/dal.rs +++ b/core/src/dal.rs @@ -1,5 +1,15 @@ -pub struct PanoramaDatabase(); +use anyhow::Result; +use sqlx::SqlitePool; + +pub struct PanoramaDatabase(SqlitePool); + +pub struct EnsureMailAccount { + imap_server_host: String, + imap_server_port: u16, +} impl PanoramaDatabase { - async fn ensure_mail_account() {} + pub async fn ensure_mail_account(&self) -> Result<()> { + Ok(()) + } } diff --git a/package.json b/package.json index cb6d8aa..4f6ac16 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "@iconify-json/mdi": "^1.2.1", "@iconify/json": "^2.2.267", "@iconify/svelte": "^4.0.2", + "@tanstack/svelte-query": "^5.61.3", "@tauri-apps/api": "^2", "@tauri-apps/plugin-shell": "^2", "@vanilla-extract/css": "^1.16.0", diff --git a/src/components/composite/sidebar/Sidebar.svelte b/src/components/composite/sidebar/Sidebar.svelte index 2de80dc..ebfcbb7 100644 --- a/src/components/composite/sidebar/Sidebar.svelte +++ b/src/components/composite/sidebar/Sidebar.svelte @@ -1,7 +1,4 @@ diff --git a/svelte.config.js b/svelte.config.js index 2d45f91..0e484bc 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -6,10 +6,11 @@ import { vitePreprocess } from "@sveltejs/vite-plugin-svelte"; /** @type {import('@sveltejs/kit').Config} */ const config = { - preprocess: vitePreprocess(), - kit: { - adapter: adapter(), - }, + preprocess: vitePreprocess(), + compilerOptions: { runes: true }, + kit: { + adapter: adapter(), + }, }; export default config;