mirror of
https://github.com/spacedriveapp/spacedrive
synced 2024-07-02 10:03:28 +00:00
added sea_orm
This commit is contained in:
parent
c50728a4d6
commit
0c19a92f11
626
src-tauri/Cargo.lock
generated
626
src-tauri/Cargo.lock
generated
|
@ -70,6 +70,47 @@ version = "0.5.2"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b"
|
||||
|
||||
[[package]]
|
||||
name = "async-channel"
|
||||
version = "1.6.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2114d64672151c0c5eaa5e131ec84a74f06e1e559830dabba01ca30605d66319"
|
||||
dependencies = [
|
||||
"concurrent-queue",
|
||||
"event-listener",
|
||||
"futures-core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "async-executor"
|
||||
version = "1.4.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "871f9bb5e0a22eeb7e8cf16641feb87c9dc67032ccf8ff49e772eb9941d3a965"
|
||||
dependencies = [
|
||||
"async-task",
|
||||
"concurrent-queue",
|
||||
"fastrand",
|
||||
"futures-lite",
|
||||
"once_cell",
|
||||
"slab",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "async-global-executor"
|
||||
version = "2.0.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9586ec52317f36de58453159d48351bc244bc24ced3effc1fce22f3d48664af6"
|
||||
dependencies = [
|
||||
"async-channel",
|
||||
"async-executor",
|
||||
"async-io",
|
||||
"async-mutex",
|
||||
"blocking",
|
||||
"futures-lite",
|
||||
"num_cpus",
|
||||
"once_cell",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "async-io"
|
||||
version = "1.6.0"
|
||||
|
@ -89,6 +130,118 @@ dependencies = [
|
|||
"winapi 0.3.9",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "async-lock"
|
||||
version = "2.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e6a8ea61bf9947a1007c5cada31e647dbc77b103c679858150003ba697ea798b"
|
||||
dependencies = [
|
||||
"event-listener",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "async-mutex"
|
||||
version = "1.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "479db852db25d9dbf6204e6cb6253698f175c15726470f78af0d918e99d6156e"
|
||||
dependencies = [
|
||||
"event-listener",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "async-process"
|
||||
version = "1.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b21b63ab5a0db0369deb913540af2892750e42d949faacc7a61495ac418a1692"
|
||||
dependencies = [
|
||||
"async-io",
|
||||
"blocking",
|
||||
"cfg-if 1.0.0",
|
||||
"event-listener",
|
||||
"futures-lite",
|
||||
"libc",
|
||||
"once_cell",
|
||||
"signal-hook",
|
||||
"winapi 0.3.9",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "async-rustls"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9c86f33abd5a4f3e2d6d9251a9e0c6a7e52eb1113caf893dae8429bf4a53f378"
|
||||
dependencies = [
|
||||
"futures-lite",
|
||||
"rustls",
|
||||
"webpki",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "async-std"
|
||||
version = "1.10.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f8056f1455169ab86dd47b47391e4ab0cbd25410a70e9fe675544f49bafaf952"
|
||||
dependencies = [
|
||||
"async-channel",
|
||||
"async-global-executor",
|
||||
"async-io",
|
||||
"async-lock",
|
||||
"async-process",
|
||||
"crossbeam-utils",
|
||||
"futures-channel",
|
||||
"futures-core",
|
||||
"futures-io",
|
||||
"futures-lite",
|
||||
"gloo-timers",
|
||||
"kv-log-macro",
|
||||
"log",
|
||||
"memchr",
|
||||
"num_cpus",
|
||||
"once_cell",
|
||||
"pin-project-lite",
|
||||
"pin-utils",
|
||||
"slab",
|
||||
"wasm-bindgen-futures",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "async-stream"
|
||||
version = "0.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "171374e7e3b2504e0e5236e3b59260560f9fe94bfe9ac39ba5e4e929c5590625"
|
||||
dependencies = [
|
||||
"async-stream-impl",
|
||||
"futures-core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "async-stream-impl"
|
||||
version = "0.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "648ed8c8d2ce5409ccd57453d9d1b214b342a0d69376a6feda1fd6cae3299308"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote 1.0.9",
|
||||
"syn 1.0.74",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "async-task"
|
||||
version = "4.0.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e91831deabf0d6d7ec49552e489aed63b7456a7a3c46cff62adad428110b0af0"
|
||||
|
||||
[[package]]
|
||||
name = "async-trait"
|
||||
version = "0.1.51"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "44318e776df68115a881de9a8fd1b9e53368d7a4a5ce4cc48517da3393233a5e"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote 1.0.9",
|
||||
"syn 1.0.74",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "atk"
|
||||
version = "0.9.0"
|
||||
|
@ -115,6 +268,21 @@ dependencies = [
|
|||
"system-deps",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "atoi"
|
||||
version = "0.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "616896e05fc0e2649463a93a15183c6a16bf03413a7af88ef1285ddedfa9cda5"
|
||||
dependencies = [
|
||||
"num-traits",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "atomic-waker"
|
||||
version = "1.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "065374052e7df7ee4047b1160cca5e1467a12351a40b3da123c870ba0b8eda2a"
|
||||
|
||||
[[package]]
|
||||
name = "attohttpc"
|
||||
version = "0.17.0"
|
||||
|
@ -165,6 +333,19 @@ dependencies = [
|
|||
"rustc-demangle",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bae"
|
||||
version = "0.1.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ec107f431ee3d8a8e45e6dd117adab769556ef463959e77bf6a4888d5fd500cf"
|
||||
dependencies = [
|
||||
"heck",
|
||||
"proc-macro-error 0.4.12",
|
||||
"proc-macro2",
|
||||
"quote 1.0.9",
|
||||
"syn 1.0.74",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "base64"
|
||||
version = "0.13.0"
|
||||
|
@ -240,6 +421,20 @@ dependencies = [
|
|||
"generic-array",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "blocking"
|
||||
version = "1.0.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c5e170dbede1f740736619b776d7251cb1b9095c435c34d8ca9f57fcd2f335e9"
|
||||
dependencies = [
|
||||
"async-channel",
|
||||
"async-task",
|
||||
"atomic-waker",
|
||||
"fastrand",
|
||||
"futures-lite",
|
||||
"once_cell",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bstr"
|
||||
version = "0.2.16"
|
||||
|
@ -655,6 +850,21 @@ dependencies = [
|
|||
"smartstring",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crc"
|
||||
version = "2.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "10c2722795460108a7872e1cd933a85d6ec38abc4baecad51028f702da28889f"
|
||||
dependencies = [
|
||||
"crc-catalog",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crc-catalog"
|
||||
version = "1.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ccaeedb56da03b09f598226e25e80088cb4cd25f316e6e4df7d695f0feeb1403"
|
||||
|
||||
[[package]]
|
||||
name = "crc32fast"
|
||||
version = "1.2.1"
|
||||
|
@ -769,6 +979,16 @@ dependencies = [
|
|||
"syn 1.0.74",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ctor"
|
||||
version = "0.1.21"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ccc0a48a9b826acdf4028595adc9db92caea352f7af011a3034acd172a52a0aa"
|
||||
dependencies = [
|
||||
"quote 1.0.9",
|
||||
"syn 1.0.74",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "darling"
|
||||
version = "0.10.2"
|
||||
|
@ -901,6 +1121,12 @@ version = "0.2.0"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b"
|
||||
|
||||
[[package]]
|
||||
name = "dotenv"
|
||||
version = "0.15.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f"
|
||||
|
||||
[[package]]
|
||||
name = "dtoa"
|
||||
version = "0.4.8"
|
||||
|
@ -970,16 +1196,10 @@ dependencies = [
|
|||
]
|
||||
|
||||
[[package]]
|
||||
name = "fallible-iterator"
|
||||
version = "0.2.0"
|
||||
name = "event-listener"
|
||||
version = "2.5.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7"
|
||||
|
||||
[[package]]
|
||||
name = "fallible-streaming-iterator"
|
||||
version = "0.1.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a"
|
||||
checksum = "f7531096570974c3a9dcf9e4b8e1cede1ec26cf5046219fb3b9d897503b9be59"
|
||||
|
||||
[[package]]
|
||||
name = "fastrand"
|
||||
|
@ -1097,6 +1317,17 @@ dependencies = [
|
|||
"futures-util",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "futures-intrusive"
|
||||
version = "0.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "62007592ac46aa7c2b6416f7deb9a8a8f63a01e0f1d6e1787d5630170db2b63e"
|
||||
dependencies = [
|
||||
"futures-core",
|
||||
"lock_api",
|
||||
"parking_lot",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "futures-io"
|
||||
version = "0.3.16"
|
||||
|
@ -1367,7 +1598,7 @@ dependencies = [
|
|||
"heck",
|
||||
"itertools 0.9.0",
|
||||
"proc-macro-crate 0.1.5",
|
||||
"proc-macro-error",
|
||||
"proc-macro-error 1.0.4",
|
||||
"proc-macro2",
|
||||
"quote 1.0.9",
|
||||
"syn 1.0.74",
|
||||
|
@ -1402,6 +1633,19 @@ dependencies = [
|
|||
"regex",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gloo-timers"
|
||||
version = "0.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "47204a46aaff920a1ea58b11d03dec6f704287d27561724a4631e450654a891f"
|
||||
dependencies = [
|
||||
"futures-channel",
|
||||
"futures-core",
|
||||
"js-sys",
|
||||
"wasm-bindgen",
|
||||
"web-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gobject-sys"
|
||||
version = "0.10.0"
|
||||
|
@ -1746,6 +1990,15 @@ 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.4.0"
|
||||
|
@ -1778,6 +2031,7 @@ version = "0.22.2"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "290b64917f8b0cb885d9de0f9959fe1f775d7fa12f1da2db9001c1c8ab60f89d"
|
||||
dependencies = [
|
||||
"cc",
|
||||
"pkg-config",
|
||||
"vcpkg",
|
||||
]
|
||||
|
@ -1824,6 +2078,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710"
|
||||
dependencies = [
|
||||
"cfg-if 1.0.0",
|
||||
"value-bag",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -1907,6 +2162,12 @@ dependencies = [
|
|||
"autocfg",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "minimal-lexical"
|
||||
version = "0.1.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0c835948974f68e0bd58636fc6c5b1fbff7b297e3046f11b3b3c18bbac012c6d"
|
||||
|
||||
[[package]]
|
||||
name = "minisign-verify"
|
||||
version = "0.1.8"
|
||||
|
@ -2030,6 +2291,17 @@ version = "0.1.14"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb"
|
||||
|
||||
[[package]]
|
||||
name = "nom"
|
||||
version = "7.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7ffd9d26838a953b4af82cbeb9f1592c6798916983959be223a7124e992742c1"
|
||||
dependencies = [
|
||||
"memchr",
|
||||
"minimal-lexical",
|
||||
"version_check",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "notify-rust"
|
||||
version = "4.5.2"
|
||||
|
@ -2044,6 +2316,17 @@ dependencies = [
|
|||
"zvariant_derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num-bigint"
|
||||
version = "0.3.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5f6f7833f2cbf2360a6cfd58cd41a53aa7a90bd4c202f5b1c7dd2ed73c57b2c3"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
"num-integer",
|
||||
"num-traits",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num-integer"
|
||||
version = "0.1.44"
|
||||
|
@ -2508,19 +2791,45 @@ dependencies = [
|
|||
"toml",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro-error"
|
||||
version = "0.4.12"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "18f33027081eba0a6d8aba6d1b1c3a3be58cbb12106341c2d5759fcd9b5277e7"
|
||||
dependencies = [
|
||||
"proc-macro-error-attr 0.4.12",
|
||||
"proc-macro2",
|
||||
"quote 1.0.9",
|
||||
"syn 1.0.74",
|
||||
"version_check",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro-error"
|
||||
version = "1.0.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c"
|
||||
dependencies = [
|
||||
"proc-macro-error-attr",
|
||||
"proc-macro-error-attr 1.0.4",
|
||||
"proc-macro2",
|
||||
"quote 1.0.9",
|
||||
"syn 1.0.74",
|
||||
"version_check",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro-error-attr"
|
||||
version = "0.4.12"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8a5b4b77fdb63c1eca72173d68d24501c54ab1269409f6b672c85deb18af69de"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote 1.0.9",
|
||||
"syn 1.0.74",
|
||||
"syn-mid",
|
||||
"version_check",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro-error-attr"
|
||||
version = "1.0.4"
|
||||
|
@ -2830,32 +3139,6 @@ dependencies = [
|
|||
"winapi 0.3.9",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rusqlite"
|
||||
version = "0.25.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "57adcf67c8faaf96f3248c2a7b419a0dbc52ebe36ba83dd57fe83827c1ea4eb3"
|
||||
dependencies = [
|
||||
"bitflags 1.3.1",
|
||||
"chrono",
|
||||
"fallible-iterator",
|
||||
"fallible-streaming-iterator",
|
||||
"hashlink",
|
||||
"libsqlite3-sys",
|
||||
"memchr",
|
||||
"smallvec",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rusqlite_migration"
|
||||
version = "0.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2abaa6d2e015b59342d088590b0c0051ba1ed5508780f8c31315b2986ebbf5b6"
|
||||
dependencies = [
|
||||
"log",
|
||||
"rusqlite",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rust-argon2"
|
||||
version = "0.8.3"
|
||||
|
@ -2868,6 +3151,17 @@ dependencies = [
|
|||
"crossbeam-utils",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rust_decimal"
|
||||
version = "1.16.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e0f1028de22e436bb35fce070310ee57d57b5e59ae77b4e3f24ce4773312b813"
|
||||
dependencies = [
|
||||
"arrayvec",
|
||||
"num-traits",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustc-demangle"
|
||||
version = "0.1.21"
|
||||
|
@ -2963,11 +3257,11 @@ dependencies = [
|
|||
"chrono",
|
||||
"crossbeam",
|
||||
"data-encoding",
|
||||
"futures",
|
||||
"int-enum",
|
||||
"rebind",
|
||||
"ring 0.17.0-alpha.10",
|
||||
"rusqlite",
|
||||
"rusqlite_migration",
|
||||
"sea-orm",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"sha256",
|
||||
|
@ -2975,6 +3269,89 @@ dependencies = [
|
|||
"tauri-build",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sea-orm"
|
||||
version = "0.2.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dccf21195a4f7f744e3799fba57222e59b0134dcc88c38343bbce59e88af6b5b"
|
||||
dependencies = [
|
||||
"async-stream",
|
||||
"async-trait",
|
||||
"chrono",
|
||||
"futures",
|
||||
"futures-util",
|
||||
"rust_decimal",
|
||||
"sea-orm-macros",
|
||||
"sea-query",
|
||||
"sea-strum",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"sqlx",
|
||||
"uuid",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sea-orm-macros"
|
||||
version = "0.2.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a0cdadaa6fbb88f6cfffe1cb0cc842ad4bca9dc030438c9f826023ff71fb75ff"
|
||||
dependencies = [
|
||||
"bae",
|
||||
"convert_case",
|
||||
"heck",
|
||||
"proc-macro2",
|
||||
"quote 1.0.9",
|
||||
"syn 1.0.74",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sea-query"
|
||||
version = "0.16.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "815f011f82e0275869bff012440f395e5c046dd3b43fbf95fe27feb5de043462"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"rust_decimal",
|
||||
"sea-query-derive",
|
||||
"serde_json",
|
||||
"thiserror",
|
||||
"uuid",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sea-query-derive"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "34cdc022b4f606353fe5dc85b09713a04e433323b70163e81513b141c6ae6eb5"
|
||||
dependencies = [
|
||||
"heck",
|
||||
"proc-macro2",
|
||||
"quote 1.0.9",
|
||||
"syn 1.0.74",
|
||||
"thiserror",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sea-strum"
|
||||
version = "0.21.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6c77c6c6c8b3950fccb65edd5d04985b5377f4c8f669cb9a215553f0369ec001"
|
||||
dependencies = [
|
||||
"sea-strum_macros",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sea-strum_macros"
|
||||
version = "0.21.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "51c247af6c2c4ffd372fe97e9afa579b4438e4c306c9aa3f11cbf72f1e845180"
|
||||
dependencies = [
|
||||
"heck",
|
||||
"proc-macro2",
|
||||
"quote 1.0.9",
|
||||
"syn 1.0.74",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "security-framework"
|
||||
version = "2.3.1"
|
||||
|
@ -3071,6 +3448,7 @@ version = "1.0.66"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "336b10da19a12ad094b59d870ebde26a45402e5b470add4b5fd03c5048a32127"
|
||||
dependencies = [
|
||||
"indexmap",
|
||||
"itoa",
|
||||
"ryu",
|
||||
"serde",
|
||||
|
@ -3148,6 +3526,25 @@ dependencies = [
|
|||
"winapi 0.3.9",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "signal-hook"
|
||||
version = "0.3.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9c98891d737e271a2954825ef19e46bd16bdb98e2746f2eec4f7a4ef7946efd1"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"signal-hook-registry",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "signal-hook-registry"
|
||||
version = "1.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0"
|
||||
dependencies = [
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "siphasher"
|
||||
version = "0.3.6"
|
||||
|
@ -3243,6 +3640,107 @@ version = "0.5.2"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d"
|
||||
|
||||
[[package]]
|
||||
name = "sqlformat"
|
||||
version = "0.1.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b4b7922be017ee70900be125523f38bdd644f4f06a1b16e8fa5a8ee8c34bffd4"
|
||||
dependencies = [
|
||||
"itertools 0.10.1",
|
||||
"nom",
|
||||
"unicode_categories",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sqlx"
|
||||
version = "0.5.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0e4b94ab0f8c21ee4899b93b06451ef5d965f1a355982ee73684338228498440"
|
||||
dependencies = [
|
||||
"sqlx-core",
|
||||
"sqlx-macros",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sqlx-core"
|
||||
version = "0.5.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ec28b91a01e1fe286d6ba66f68289a2286df023fc97444e1fd86c2fd6d5dc026"
|
||||
dependencies = [
|
||||
"ahash",
|
||||
"atoi",
|
||||
"bitflags 1.3.1",
|
||||
"byteorder",
|
||||
"bytes",
|
||||
"chrono",
|
||||
"crc",
|
||||
"crossbeam-channel",
|
||||
"crossbeam-queue",
|
||||
"crossbeam-utils",
|
||||
"either",
|
||||
"futures-channel",
|
||||
"futures-core",
|
||||
"futures-intrusive",
|
||||
"futures-util",
|
||||
"hashlink",
|
||||
"hex",
|
||||
"itoa",
|
||||
"libc",
|
||||
"libsqlite3-sys",
|
||||
"log",
|
||||
"memchr",
|
||||
"num-bigint",
|
||||
"once_cell",
|
||||
"parking_lot",
|
||||
"percent-encoding",
|
||||
"rust_decimal",
|
||||
"rustls",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"sha2",
|
||||
"smallvec",
|
||||
"sqlformat",
|
||||
"sqlx-rt",
|
||||
"stringprep",
|
||||
"thiserror",
|
||||
"url",
|
||||
"uuid",
|
||||
"webpki",
|
||||
"webpki-roots",
|
||||
"whoami",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sqlx-macros"
|
||||
version = "0.5.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4dc33c35d54774eed73d54568d47a6ac099aed8af5e1556a017c131be88217d5"
|
||||
dependencies = [
|
||||
"dotenv",
|
||||
"either",
|
||||
"futures",
|
||||
"heck",
|
||||
"once_cell",
|
||||
"proc-macro2",
|
||||
"quote 1.0.9",
|
||||
"serde_json",
|
||||
"sha2",
|
||||
"sqlx-core",
|
||||
"sqlx-rt",
|
||||
"syn 1.0.74",
|
||||
"url",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sqlx-rt"
|
||||
version = "0.5.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "14302b678d9c76b28f2e60115211e25e0aabc938269991745a169753dc00e35c"
|
||||
dependencies = [
|
||||
"async-rustls",
|
||||
"async-std",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "stable_deref_trait"
|
||||
version = "1.2.0"
|
||||
|
@ -3289,6 +3787,16 @@ dependencies = [
|
|||
"quote 1.0.9",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "stringprep"
|
||||
version = "0.1.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8ee348cb74b87454fff4b551cbf727025810a004f88aeacae7f85b87f4e9a1c1"
|
||||
dependencies = [
|
||||
"unicode-bidi",
|
||||
"unicode-normalization",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "strsim"
|
||||
version = "0.8.0"
|
||||
|
@ -3319,7 +3827,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "134d838a2c9943ac3125cf6df165eda53493451b719f3255b2a26b85f772d0ba"
|
||||
dependencies = [
|
||||
"heck",
|
||||
"proc-macro-error",
|
||||
"proc-macro-error 1.0.4",
|
||||
"proc-macro2",
|
||||
"quote 1.0.9",
|
||||
"syn 1.0.74",
|
||||
|
@ -3397,6 +3905,17 @@ dependencies = [
|
|||
"unicode-xid 0.2.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "syn-mid"
|
||||
version = "0.5.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "baa8e7560a164edb1621a55d18a0c59abf49d360f47aa7b821061dd7eea7fac9"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote 1.0.9",
|
||||
"syn 1.0.74",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "synom"
|
||||
version = "0.11.3"
|
||||
|
@ -3810,6 +4329,12 @@ version = "0.2.2"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3"
|
||||
|
||||
[[package]]
|
||||
name = "unicode_categories"
|
||||
version = "0.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e"
|
||||
|
||||
[[package]]
|
||||
name = "untrusted"
|
||||
version = "0.7.1"
|
||||
|
@ -3862,6 +4387,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7"
|
||||
dependencies = [
|
||||
"getrandom 0.2.3",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "value-bag"
|
||||
version = "1.0.0-alpha.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dd320e1520f94261153e96f7534476ad869c14022aee1e59af7c778075d840ae"
|
||||
dependencies = [
|
||||
"ctor",
|
||||
"version_check",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -4100,6 +4636,16 @@ dependencies = [
|
|||
"cc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "whoami"
|
||||
version = "1.1.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "483a59fee1a93fec90eb08bc2eb4315ef10f4ebc478b3a5fadc969819cb66117"
|
||||
dependencies = [
|
||||
"wasm-bindgen",
|
||||
"web-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "widestring"
|
||||
version = "0.4.3"
|
||||
|
|
|
@ -9,8 +9,6 @@ default-run = "sd"
|
|||
edition = "2018"
|
||||
build = "src/build.rs"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[build-dependencies]
|
||||
tauri-build = { version = "1.0.0-beta.3" }
|
||||
|
||||
|
@ -18,16 +16,16 @@ tauri-build = { version = "1.0.0-beta.3" }
|
|||
tauri = { version = "1.0.0-beta.5", features = ["api-all", "menu"] }
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
futures = "0.3"
|
||||
rebind = "0.2.1"
|
||||
data-encoding = "2.3.2"
|
||||
ring = "0.17.0-alpha.10"
|
||||
rusqlite = { version = "0.25.3", features = ["chrono"] }
|
||||
chrono = { version = "0.4.0", features = ["serde"] }
|
||||
crossbeam = "0.8.1"
|
||||
cargo-edit = "0.8.0"
|
||||
sha256 = "1.0.2"
|
||||
int-enum = "0.4.0"
|
||||
rusqlite_migration = "0.5.0"
|
||||
sea-orm = { version = "^0", features = [ "sqlx-sqlite", "runtime-async-std-rustls", "macros" ], default-features = false }
|
||||
|
||||
[features]
|
||||
default = [ "custom-protocol" ]
|
||||
|
|
|
@ -10,7 +10,7 @@ pub async fn read_file_command(path: &str) -> Result<File, InvokeError> {
|
|||
.await
|
||||
.map_err(|error| InvokeError::from(format!("Failed to read file: {}", error)))?;
|
||||
|
||||
file::commit_file(&file).await;
|
||||
// file::commit_file(&file).await;
|
||||
|
||||
Ok(file)
|
||||
}
|
||||
|
@ -20,6 +20,6 @@ pub async fn generate_buffer_checksum(path: &str) -> Result<File, InvokeError> {
|
|||
.await
|
||||
.map_err(|error| InvokeError::from(format!("Failed to read file: {}", error)))?;
|
||||
|
||||
file.buffer_checksum = Some(checksum::create_hash(&file.uri).await.unwrap());
|
||||
// file.buffer_checksum = Some(checksum::create_hash(&file.uri).await.unwrap());
|
||||
Ok(file)
|
||||
}
|
||||
|
|
|
@ -10,13 +10,13 @@ pub enum Encryption {
|
|||
AES256 = 3,
|
||||
}
|
||||
|
||||
impl From<i64> for Encryption {
|
||||
fn from(val: i64) -> Self {
|
||||
match val {
|
||||
0 => Encryption::NONE,
|
||||
1 => Encryption::AES128,
|
||||
2 => Encryption::AES192,
|
||||
3 => Encryption::AES256,
|
||||
}
|
||||
}
|
||||
}
|
||||
// impl From<i8> for Encryption {
|
||||
// fn from(val: i8) -> Self {
|
||||
// match val {
|
||||
// 0 => Encryption::NONE,
|
||||
// 1 => Encryption::AES128,
|
||||
// 2 => Encryption::AES192,
|
||||
// 3 => Encryption::AES256,
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
|
|
@ -1,10 +1,21 @@
|
|||
use crate::app::config;
|
||||
use rusqlite;
|
||||
use tauri::InvokeError;
|
||||
use crate::filesystem::file;
|
||||
use sea_orm::{Database, DatabaseConnection, DbErr, Schema};
|
||||
|
||||
pub fn get_connection() -> Result<rusqlite::Connection, InvokeError> {
|
||||
pub async fn get_connection() -> Result<DatabaseConnection, DbErr> {
|
||||
let config = config::get_config();
|
||||
|
||||
rusqlite::Connection::open(config.primary_db)
|
||||
.map_err(|error| InvokeError::from("database_connection_failure"))
|
||||
// Database::connect(config.primary_db.to_str().unwrap_or("sqlite::memory:")).await?;
|
||||
// Connecting SQLite
|
||||
let db_url = format!("{}{}", "sqlite://", config.primary_db.to_str().unwrap());
|
||||
|
||||
let db = Database::connect(&db_url).await?;
|
||||
|
||||
// Derive schema from Entity
|
||||
let stmt = Schema::create_table_from_entity(file::Model);
|
||||
|
||||
// Execute create table statement
|
||||
let result = db.execute(db.get_database_backend().build(&stmt)).await;
|
||||
|
||||
Ok(db)
|
||||
}
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
pub(crate) trait ToVec<T> {
|
||||
fn to_vec(self) -> Vec<T>;
|
||||
}
|
||||
|
||||
pub(crate) type QueryMapper<T> = fn(&rusqlite::Row) -> rusqlite::Result<T>;
|
||||
|
||||
impl<T> ToVec<T> for rusqlite::MappedRows<'_, QueryMapper<T>> {
|
||||
fn to_vec(self) -> Vec<T> {
|
||||
let mut list = Vec::new();
|
||||
for row in self {
|
||||
list.push(row.unwrap());
|
||||
}
|
||||
list
|
||||
}
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
use rusqlite::Connection;
|
||||
use rusqlite_migration::{Migrations, M};
|
||||
|
||||
pub fn run_migrations(mut connection: Connection) {
|
||||
let migrations = Migrations::new(vec![M::up(
|
||||
"
|
||||
CREATE TABLE IF NOT EXISTS files (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
uri STRING NOT NULL,
|
||||
meta_checksum STRING NOT NULL,
|
||||
buffer_checksum STRING,
|
||||
name STRING,
|
||||
extension STRING,
|
||||
size_in_bytes INTEGER NOT NULL,
|
||||
encryption INTEGER DEFAULT 0,
|
||||
ipfs_id STRING,
|
||||
user_id STRING,
|
||||
storage_device_id STRING,
|
||||
capture_device_id STRING,
|
||||
parent_file_id STRING
|
||||
date_created TEXT NOT NULL,
|
||||
date_modified TEXT NOT NULL,
|
||||
date_indexed TEXT NOT NULL,
|
||||
);
|
||||
",
|
||||
)]);
|
||||
|
||||
migrations.to_latest(&mut connection).unwrap();
|
||||
}
|
|
@ -1,4 +1 @@
|
|||
pub mod connection;
|
||||
pub mod mapper;
|
||||
pub mod migrate;
|
||||
pub mod page;
|
||||
|
|
|
@ -1,49 +0,0 @@
|
|||
use serde::{Deserialize, Serialize};
|
||||
use std::fmt::{Display, Formatter};
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub(crate) struct PageRequest {
|
||||
#[serde(default)]
|
||||
pub(crate) page: i64,
|
||||
#[serde(default)]
|
||||
pub(crate) size: i64,
|
||||
#[serde(default)]
|
||||
pub(crate) sort_by: String,
|
||||
#[serde(default)]
|
||||
pub(crate) direction: SortDirection,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub(crate) enum SortDirection {
|
||||
ASC,
|
||||
DESC,
|
||||
}
|
||||
|
||||
impl Default for SortDirection {
|
||||
fn default() -> Self {
|
||||
SortDirection::ASC
|
||||
}
|
||||
}
|
||||
|
||||
impl Display for SortDirection {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
||||
write!(f, "{:?}", self)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub(crate) struct PageResponse<T> {
|
||||
content: Vec<T>,
|
||||
total_pages: i64,
|
||||
total_elements: i64,
|
||||
}
|
||||
|
||||
impl<T> PageResponse<T> {
|
||||
pub(crate) fn new(content: Vec<T>, total_pages: i64, total_elements: i64) -> Self {
|
||||
PageResponse {
|
||||
content,
|
||||
total_pages,
|
||||
total_elements,
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,78 +1,91 @@
|
|||
use crate::crypto;
|
||||
use crate::filesystem::checksum;
|
||||
use crate::util::time;
|
||||
use chrono::prelude::*;
|
||||
use rusqlite::named_params;
|
||||
use chrono::NaiveDateTime;
|
||||
use sea_orm::entity::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::ffi::OsStr;
|
||||
use std::fs;
|
||||
use std::io;
|
||||
use std::path;
|
||||
|
||||
use tauri::InvokeError;
|
||||
|
||||
use crate::db;
|
||||
// use crate::db::mapper::QueryMapper;
|
||||
use crate::filesystem::checksum;
|
||||
use crate::util::time;
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub struct File {
|
||||
// -------------------------------------
|
||||
// Entity: File
|
||||
// Represents an item discovered on the filesystem
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
|
||||
#[sea_orm(table_name = "files")]
|
||||
// -------------------------------------
|
||||
pub struct Model {
|
||||
// identity
|
||||
pub id: Option<u64>,
|
||||
pub buffer_checksum: Option<String>,
|
||||
#[sea_orm(primary_key)]
|
||||
pub id: u64,
|
||||
pub buffer_checksum: String,
|
||||
pub meta_checksum: String,
|
||||
pub uri: String,
|
||||
// metadata
|
||||
pub name: String,
|
||||
pub extension: String,
|
||||
pub size_in_bytes: u64,
|
||||
pub encryption: crypto::Encryption,
|
||||
// pub encryption: crypto::Encryption,
|
||||
#[sea_orm(nullable)]
|
||||
pub ipfs_id: Option<String>,
|
||||
// ownership
|
||||
#[sea_orm(nullable)]
|
||||
pub user_id: Option<u64>,
|
||||
#[sea_orm(nullable)]
|
||||
pub storage_device_id: Option<u64>,
|
||||
#[sea_orm(nullable)]
|
||||
pub capture_device_id: Option<u64>,
|
||||
#[sea_orm(nullable)]
|
||||
pub parent_file_id: Option<u64>,
|
||||
// date
|
||||
pub date_created: DateTime<Utc>,
|
||||
pub date_modified: DateTime<Utc>,
|
||||
pub date_indexed: DateTime<Utc>,
|
||||
pub date_created: NaiveDateTime,
|
||||
pub date_modified: NaiveDateTime,
|
||||
pub date_indexed: NaiveDateTime,
|
||||
}
|
||||
pub type File = Model;
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
|
||||
// Read a file from path returning the File struct
|
||||
// Generates meta checksum and extracts metadata
|
||||
pub async fn read_file(path: &str) -> io::Result<File> {
|
||||
let path_buff = path::PathBuf::from(path);
|
||||
let metadata = fs::metadata(&path)?;
|
||||
// pub async fn read_file(path: &str) -> io::Result<File> {
|
||||
// let path_buff = path::PathBuf::from(path);
|
||||
// let metadata = fs::metadata(&path)?;
|
||||
|
||||
if metadata.is_dir() {
|
||||
// return Err();
|
||||
}
|
||||
// if metadata.is_dir() {
|
||||
// // return Err();
|
||||
// }
|
||||
|
||||
let size = metadata.len();
|
||||
let meta_checksum = checksum::create_meta_hash(path.to_owned(), size)?;
|
||||
// let size = metadata.len();
|
||||
// let meta_checksum = checksum::create_meta_hash(path.to_owned(), size)?;
|
||||
|
||||
// assemble File struct with initial values
|
||||
let file = File {
|
||||
name: extract_name(path_buff.file_name()),
|
||||
extension: extract_name(path_buff.extension()),
|
||||
uri: path.to_owned(),
|
||||
size_in_bytes: size,
|
||||
date_created: time::system_time_to_date_time(metadata.created()).unwrap_or(Utc::now()),
|
||||
date_modified: time::system_time_to_date_time(metadata.created()).unwrap_or(Utc::now()),
|
||||
date_indexed: Utc::now(),
|
||||
encryption: crypto::Encryption::NONE,
|
||||
// this will be populated later, either by the database or other functions
|
||||
id: None,
|
||||
meta_checksum,
|
||||
buffer_checksum: None,
|
||||
ipfs_id: None,
|
||||
user_id: None,
|
||||
storage_device_id: None,
|
||||
capture_device_id: None,
|
||||
parent_file_id: None,
|
||||
};
|
||||
Ok(file)
|
||||
}
|
||||
// // assemble File struct with initial values
|
||||
// let file = File {
|
||||
// name: extract_name(path_buff.file_name()),
|
||||
// extension: extract_name(path_buff.extension()),
|
||||
// uri: path.to_owned(),
|
||||
// size_in_bytes: size,
|
||||
// date_created: time::system_time_to_date_time(metadata.created()).unwrap_or(Utc::now()),
|
||||
// date_modified: time::system_time_to_date_time(metadata.created()).unwrap_or(Utc::now()),
|
||||
// date_indexed: Utc::now(),
|
||||
// encryption: crypto::Encryption::NONE,
|
||||
// // this will be populated later, either by the database or other functions
|
||||
// id: None,
|
||||
// meta_checksum,
|
||||
// buffer_checksum: None,
|
||||
// ipfs_id: None,
|
||||
// user_id: None,
|
||||
// storage_device_id: None,
|
||||
// capture_device_id: None,
|
||||
// parent_file_id: None,
|
||||
// };
|
||||
// Ok(file)
|
||||
// }
|
||||
|
||||
// extract name from OsStr returned by PathBuff
|
||||
fn extract_name(os_string: Option<&OsStr>) -> String {
|
||||
|
@ -83,49 +96,7 @@ fn extract_name(os_string: Option<&OsStr>) -> String {
|
|||
.to_owned()
|
||||
}
|
||||
|
||||
pub async fn commit_file(file: &File) -> Result<(), InvokeError> {
|
||||
let connection = db::connection::get_connection()?;
|
||||
// pub async fn commit_file(file: &File) -> Result<(), InvokeError> {
|
||||
// let connection = db::connection::get_connection()?;
|
||||
|
||||
connection.execute("
|
||||
INSERT INTO files (uri, meta_checksum, buffer_checksum, name, extension, size_in_bytes, encryption, ipfs_id, user_id, storage_device_id, capture_device_id, parent_file_id, date_created, date_modified, date_indexed) VALUES (:uri, :meta_checksum, :buffer_checksum, :name, :extension, :size_in_bytes, :encryption, :ipfs_id, :user_id, :storage_device_id, :capture_device_id, :parent_file_id, :date_created, :date_modified, :date_indexed)
|
||||
", named_params! {
|
||||
":uri": &file.uri,
|
||||
":meta_checksum": &file.meta_checksum,
|
||||
":buffer_checksum": &file.buffer_checksum,
|
||||
":name": &file.name,
|
||||
":extension": &file.extension,
|
||||
":size_in_bytes": &file.size_in_bytes,
|
||||
":encryption": crypto::Encryption::NONE,
|
||||
":ipfs_id": &file.ipfs_id,
|
||||
":user_id": &file.user_id,
|
||||
":storage_device_id": &file.storage_device_id,
|
||||
":capture_device_id": &file.capture_device_id,
|
||||
":parent_file_id": &file.parent_file_id,
|
||||
":date_created": &file.date_created,
|
||||
":date_modified": &file.date_modified,
|
||||
":date_indexed": &file.date_indexed
|
||||
});
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
// const FILE_MAPPER: QueryMapper<File> = |row| {
|
||||
// Ok(File {
|
||||
// id: row.get(0)?,
|
||||
// buffer_checksum: row.get(1)?,
|
||||
// meta_checksum: row.get(2)?,
|
||||
// uri: row.get(3)?,
|
||||
// name: row.get(4)?,
|
||||
// extension: row.get(5)?,
|
||||
// size_in_bytes: row.get(6)?,
|
||||
// encryption: crypto::Encryption::from(row.get(7)?),
|
||||
// ipfs_id: row.get(8)?,
|
||||
// user_id: row.get(9)?,
|
||||
// storage_device_id: row.get(10)?,
|
||||
// capture_device_id: row.get(11)?,
|
||||
// parent_file_id: row.get(12)?,
|
||||
// date_created: chrono::DateTime::parse_from_str(row.get(13).unwrap(), "utc")?,
|
||||
// date_modified: row.get(14)?,
|
||||
// date_indexed: row.get(15)?,
|
||||
// })
|
||||
// };
|
||||
// });
|
||||
|
|
|
@ -4,23 +4,25 @@
|
|||
)]
|
||||
|
||||
mod app;
|
||||
mod commands;
|
||||
// mod commands;
|
||||
mod crypto;
|
||||
mod db;
|
||||
mod filesystem;
|
||||
mod util;
|
||||
use crate::app::menu;
|
||||
use futures::executor::block_on;
|
||||
|
||||
fn main() {
|
||||
let connection = db::connection::get_connection().unwrap();
|
||||
db::migrate::run_migrations(connection);
|
||||
let connection = db::connection::get_connection();
|
||||
let primary_db = block_on(connection).unwrap();
|
||||
// db::migrate::run_migrations(connection);
|
||||
|
||||
println!("primary database connected");
|
||||
println!("primary database connected {:?}", primary_db);
|
||||
|
||||
tauri::Builder::default()
|
||||
.invoke_handler(tauri::generate_handler![
|
||||
commands::read_file_command,
|
||||
commands::generate_buffer_checksum
|
||||
// commands::read_file_command,
|
||||
// commands::generate_buffer_checksum
|
||||
])
|
||||
.menu(menu::get_menu())
|
||||
.run(tauri::generate_context!())
|
||||
|
|
Loading…
Reference in a new issue