From 3877870688df64a161fd52d4134a6a9e6204bc2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?19=E5=B9=B4=E6=A2=A6=E9=86=92?= <3949379+getong@users.noreply.github.com> Date: Sat, 21 Sep 2024 11:14:03 +0800 Subject: [PATCH] update surrealdb to 2.0 version --- Cargo.lock | 974 ++++++++++++++++++++++++++++++++-- databases/surreal/Cargo.toml | 2 +- databases/surreal/src/lib.rs | 28 +- examples/surrealdb/Cargo.toml | 4 +- 4 files changed, 939 insertions(+), 69 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5aad320..8a9f897 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,16 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "Inflector" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" +dependencies = [ + "lazy_static", + "regex", +] + [[package]] name = "addr" version = "0.15.6" @@ -100,6 +110,19 @@ version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" +[[package]] +name = "ammonia" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ab99eae5ee58501ab236beb6f20f6ca39be615267b014899c89b2f0bc18a459" +dependencies = [ + "html5ever", + "maplit", + "once_cell", + "tendril", + "url", +] + [[package]] name = "android-tzdata" version = "0.1.1" @@ -175,11 +198,17 @@ dependencies = [ "password-hash", ] +[[package]] +name = "arrayref" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" + [[package]] name = "arrayvec" -version = "0.7.6" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "ascii-canvas" @@ -214,6 +243,78 @@ dependencies = [ "slab", ] +[[package]] +name = "async-graphql" +version = "7.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d37c3e9ba322eb00e9e5e997d58f08e8b6de037325b9367ac59bca8e3cd46af" +dependencies = [ + "async-graphql-derive", + "async-graphql-parser", + "async-graphql-value", + "async-stream", + "async-trait", + "base64 0.22.1", + "bytes", + "fnv", + "futures-timer", + "futures-util", + "http 1.1.0", + "indexmap 2.5.0", + "mime", + "multer", + "num-traits", + "once_cell", + "pin-project-lite", + "regex", + "serde", + "serde_json", + "serde_urlencoded", + "static_assertions_next", + "thiserror", +] + +[[package]] +name = "async-graphql-derive" +version = "7.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1141703c11c6ad4fa9b3b0e1e476dea01dbd18a44db00f949b804afaab2f344" +dependencies = [ + "Inflector", + "async-graphql-parser", + "darling", + "proc-macro-crate", + "proc-macro2", + "quote", + "strum", + "syn 2.0.77", + "thiserror", +] + +[[package]] +name = "async-graphql-parser" +version = "7.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f66edcce4c38c18f7eb181fdf561c3d3aa2d644ce7358fc7a928c00a4ffef17" +dependencies = [ + "async-graphql-value", + "pest", + "serde", + "serde_json", +] + +[[package]] +name = "async-graphql-value" +version = "7.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0206011cad065420c27988f17dd7fe201a0e056b20c262209b7bffcd6fa176" +dependencies = [ + "bytes", + "indexmap 2.5.0", + "serde", + "serde_json", +] + [[package]] name = "async-recursion" version = "1.1.1" @@ -225,6 +326,28 @@ dependencies = [ "syn 2.0.77", ] +[[package]] +name = "async-stream" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" +dependencies = [ + "async-stream-impl", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-stream-impl" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", +] + [[package]] name = "async-task" version = "4.7.1" @@ -453,7 +576,7 @@ dependencies = [ "async-trait", "axum_session 0.14.2 (registry+https://github.com/rust-lang/crates.io-index)", "chrono", - "surrealdb", + "surrealdb 2.0.1", ] [[package]] @@ -587,6 +710,19 @@ dependencies = [ "digest", ] +[[package]] +name = "blake3" +version = "1.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d82033247fd8e890df8f740e407ad4d038debb9eb1f40533fffb32e7d17dc6f7" +dependencies = [ + "arrayref", + "arrayvec", + "cc", + "cfg-if", + "constant_time_eq", +] + [[package]] name = "block-buffer" version = "0.10.4" @@ -696,6 +832,18 @@ name = "bytes" version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" +dependencies = [ + "serde", +] + +[[package]] +name = "castaway" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0abae9be0aaf9ea96a3b1b8b1b55c602ca751eba1b1500220cea4ecbafe7c0d5" +dependencies = [ + "rustversion", +] [[package]] name = "cc" @@ -862,6 +1010,12 @@ version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" +[[package]] +name = "constant_time_eq" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" + [[package]] name = "convert_case" version = "0.4.0" @@ -935,6 +1089,25 @@ version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f64009896348fc5af4222e9cf7d7d82a95a256c634ebcf61c53e4ea461422242" +[[package]] +name = "crossbeam-deque" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "crossbeam-queue" version = "0.3.11" @@ -1188,6 +1361,18 @@ dependencies = [ "tokio", ] +[[package]] +name = "echodb" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1eccc44ff21b80ca7e883ff57423a12610965a33637d5d0bef4adebcd81749" +dependencies = [ + "arc-swap", + "imbl", + "thiserror", + "tokio", +] + [[package]] name = "either" version = "1.13.0" @@ -1277,6 +1462,19 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "ext-sort" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcf73e44617eab501beba39234441a194cf138629d3b6447f81f573e1c3d0a13" +dependencies = [ + "log", + "rayon", + "rmp-serde", + "serde", + "tempfile", +] + [[package]] name = "fastbloom-rs" version = "0.5.9" @@ -1386,6 +1584,16 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" +[[package]] +name = "futf" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df420e2e84819663797d1ec6544b13c5be84629e7bb00dc960d6917db2987843" +dependencies = [ + "mac", + "new_debug_unreachable", +] + [[package]] name = "futures" version = "0.3.30" @@ -1522,6 +1730,12 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +[[package]] +name = "futures-timer" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" + [[package]] name = "futures-util" version = "0.3.30" @@ -1572,7 +1786,7 @@ dependencies = [ "log", "num-traits", "robust", - "rstar", + "rstar 0.11.0", "serde", ] @@ -1589,7 +1803,25 @@ dependencies = [ "log", "num-traits", "robust", - "rstar", + "rstar 0.11.0", + "serde", + "spade", +] + +[[package]] +name = "geo" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f811f663912a69249fa620dcd2a005db7254529da2d8a0b23942e81f47084501" +dependencies = [ + "earcutr", + "float_next_after", + "geo-types", + "geographiclib-rs", + "log", + "num-traits", + "robust", + "rstar 0.12.0", "serde", "spade", ] @@ -1603,7 +1835,8 @@ dependencies = [ "approx 0.5.1", "arbitrary", "num-traits", - "rstar", + "rstar 0.11.0", + "rstar 0.12.0", "serde", ] @@ -1694,6 +1927,15 @@ dependencies = [ "byteorder", ] +[[package]] +name = "hash32" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47d60b12902ba28e2730cd37e95b8c9223af2808df9e902d4df49588d1470606" +dependencies = [ + "byteorder", +] + [[package]] name = "hashbrown" version = "0.12.3" @@ -1711,7 +1953,6 @@ checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash 0.8.11", "allocator-api2", - "serde", ] [[package]] @@ -1730,12 +1971,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cdc6457c0eb62c71aac4bc17216026d8410337c4126773b9c5daba343f17964f" dependencies = [ "atomic-polyfill", - "hash32", + "hash32 0.2.1", "rustc_version", "spin 0.9.8", "stable_deref_trait", ] +[[package]] +name = "heapless" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" +dependencies = [ + "hash32 0.3.1", + "stable_deref_trait", +] + [[package]] name = "heck" version = "0.4.1" @@ -1843,6 +2094,20 @@ dependencies = [ "winapi", ] +[[package]] +name = "html5ever" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c13771afe0e6e846f1e67d038d4cb29998a6779f93c809212e4e9c32efd244d4" +dependencies = [ + "log", + "mac", + "markup5ever", + "proc-macro2", + "quote", + "syn 2.0.77", +] + [[package]] name = "http" version = "0.2.12" @@ -1958,6 +2223,7 @@ dependencies = [ "pin-project-lite", "smallvec", "tokio", + "want", ] [[package]] @@ -1971,7 +2237,25 @@ dependencies = [ "hyper 0.14.30", "rustls 0.21.12", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", +] + +[[package]] +name = "hyper-rustls" +version = "0.27.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" +dependencies = [ + "futures-util", + "http 1.1.0", + "hyper 1.4.1", + "hyper-util", + "rustls 0.23.13", + "rustls-pki-types", + "tokio", + "tokio-rustls 0.26.0", + "tower-service", + "webpki-roots 0.26.5", ] [[package]] @@ -1981,12 +2265,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da62f120a8a37763efb0cf8fdf264b884c7b8b9ac8660b900c8661030c00e6ba" dependencies = [ "bytes", + "futures-channel", "futures-util", "http 1.1.0", "http-body 1.0.1", "hyper 1.4.1", "pin-project-lite", + "socket2", "tokio", + "tower", + "tower-service", + "tracing", ] [[package]] @@ -2145,6 +2434,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.11" @@ -2160,6 +2458,21 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "jsonwebtoken" +version = "9.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9ae10193d25051e74945f1ea2d0b42e03cc3b890f7e4cc5faa44997d808193f" +dependencies = [ + "base64 0.21.7", + "js-sys", + "pem 3.0.4", + "ring 0.17.8", + "serde", + "serde_json", + "simple_asn1", +] + [[package]] name = "lalrpop" version = "0.20.2" @@ -2291,6 +2604,12 @@ dependencies = [ "linked-hash-map", ] +[[package]] +name = "mac" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4" + [[package]] name = "mac_address" version = "1.1.7" @@ -2301,6 +2620,26 @@ dependencies = [ "winapi", ] +[[package]] +name = "maplit" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" + +[[package]] +name = "markup5ever" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16ce3abbeba692c8b8441d036ef91aea6df8da2c6b6e21c7e14d3c18e526be45" +dependencies = [ + "log", + "phf", + "phf_codegen", + "string_cache", + "string_cache_codegen", + "tendril", +] + [[package]] name = "match_cfg" version = "0.1.0" @@ -2357,7 +2696,7 @@ dependencies = [ "axum_session 0.14.2 (registry+https://github.com/rust-lang/crates.io-index)", "axum_session_surreal", "hyper 1.4.1", - "surrealdb", + "surrealdb 1.3.1", "tokio", ] @@ -2468,7 +2807,7 @@ dependencies = [ "take_mut", "thiserror", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", "tokio-util", "typed-builder", "uuid", @@ -2487,15 +2826,32 @@ dependencies = [ ] [[package]] -name = "nanoid" -version = "0.4.0" +name = "multer" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ffa00dec017b5b1a8b7cf5e2c008bfda1aa7e0697ac1508b491fdf2622fb4d8" +checksum = "83e87776546dc87511aa5ee218730c92b666d7264ab6ed41f9d215af9cd5224b" dependencies = [ - "rand 0.8.5", -] - -[[package]] + "bytes", + "encoding_rs", + "futures-util", + "http 1.1.0", + "httparse", + "memchr", + "mime", + "spin 0.9.8", + "version_check", +] + +[[package]] +name = "nanoid" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ffa00dec017b5b1a8b7cf5e2c008bfda1aa7e0697ac1508b491fdf2622fb4d8" +dependencies = [ + "rand 0.8.5", +] + +[[package]] name = "nanorand" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2725,6 +3081,27 @@ dependencies = [ "walkdir", ] +[[package]] +name = "object_store" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6da452820c715ce78221e8202ccc599b4a52f3e1eb3eedb487b680c81a8e3f3" +dependencies = [ + "async-trait", + "bytes", + "chrono", + "futures", + "humantime", + "itertools 0.13.0", + "parking_lot", + "percent-encoding", + "snafu", + "tokio", + "tracing", + "url", + "walkdir", +] + [[package]] name = "once_cell" version = "1.20.0" @@ -2864,6 +3241,16 @@ dependencies = [ "serde", ] +[[package]] +name = "pem" +version = "3.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e459365e590736a54c3fa561947c84837534b8e9af6fc5bf781307e82658fae" +dependencies = [ + "base64 0.22.1", + "serde", +] + [[package]] name = "pem-rfc7468" version = "0.7.0" @@ -2879,6 +3266,17 @@ version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +[[package]] +name = "pest" +version = "2.7.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdbef9d1d47087a895abd220ed25eb4ad973a5e26f6a4367b038c25e28dfc2d9" +dependencies = [ + "memchr", + "thiserror", + "ucd-trie", +] + [[package]] name = "petgraph" version = "0.6.5" @@ -2899,6 +3297,60 @@ dependencies = [ "rustc_version", ] +[[package]] +name = "phf" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" +dependencies = [ + "phf_macros", + "phf_shared 0.11.2", +] + +[[package]] +name = "phf_codegen" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8d39688d359e6b34654d328e262234662d16cc0f60ec8dcbe5e718709342a5a" +dependencies = [ + "phf_generator 0.11.2", + "phf_shared 0.11.2", +] + +[[package]] +name = "phf_generator" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6" +dependencies = [ + "phf_shared 0.10.0", + "rand 0.8.5", +] + +[[package]] +name = "phf_generator" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" +dependencies = [ + "phf_shared 0.11.2", + "rand 0.8.5", +] + +[[package]] +name = "phf_macros" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" +dependencies = [ + "phf_generator 0.11.2", + "phf_shared 0.11.2", + "proc-macro2", + "quote", + "syn 2.0.77", + "unicase", +] + [[package]] name = "phf_shared" version = "0.10.0" @@ -2908,6 +3360,16 @@ dependencies = [ "siphasher", ] +[[package]] +name = "phf_shared" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" +dependencies = [ + "siphasher", + "unicase", +] + [[package]] name = "pico-args" version = "0.5.0" @@ -3113,6 +3575,66 @@ dependencies = [ "parking_lot", ] +[[package]] +name = "quick_cache" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb55a1aa7668676bb93926cd4e9cdfe60f03bb866553bcca9112554911b6d3dc" +dependencies = [ + "ahash 0.8.11", + "equivalent", + "hashbrown 0.14.5", + "parking_lot", +] + +[[package]] +name = "quinn" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls 0.23.13", + "socket2", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +dependencies = [ + "bytes", + "rand 0.8.5", + "ring 0.17.8", + "rustc-hash", + "rustls 0.23.13", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fe68c2e9e1a1234e218683dbdf9f9dfcb094113c5ac2b938dfcb9bab4c4140b" +dependencies = [ + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.59.0", +] + [[package]] name = "quote" version = "1.0.37" @@ -3225,11 +3747,31 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" +[[package]] +name = "rayon" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + [[package]] name = "reblessive" -version = "0.3.5" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4149deda5bd21e0f6ccaa2f907cd542541521dead5861bc51bebdf2af4acaf2a" +checksum = "568fde39e6aec674be99c9dd38b4c79040faf31038bd5a41ab1908db00c2319b" [[package]] name = "redis" @@ -3378,7 +3920,7 @@ dependencies = [ "http 0.2.12", "http-body 0.4.6", "hyper 0.14.30", - "hyper-rustls", + "hyper-rustls 0.24.2", "ipnet", "js-sys", "log", @@ -3395,7 +3937,7 @@ dependencies = [ "sync_wrapper 0.1.2", "system-configuration", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", "tokio-util", "tower-service", "url", @@ -3407,6 +3949,51 @@ dependencies = [ "winreg", ] +[[package]] +name = "reqwest" +version = "0.12.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8f4955649ef5c38cc7f9e8aa41761d48fb9677197daea9984dc54f56aad5e63" +dependencies = [ + "base64 0.22.1", + "bytes", + "futures-core", + "futures-util", + "http 1.1.0", + "http-body 1.0.1", + "http-body-util", + "hyper 1.4.1", + "hyper-rustls 0.27.3", + "hyper-util", + "ipnet", + "js-sys", + "log", + "mime", + "mime_guess", + "once_cell", + "percent-encoding", + "pin-project-lite", + "quinn", + "rustls 0.23.13", + "rustls-pemfile 2.1.3", + "rustls-pki-types", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper 1.0.1", + "tokio", + "tokio-rustls 0.26.0", + "tokio-util", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-streams", + "web-sys", + "webpki-roots 0.26.5", + "windows-registry", +] + [[package]] name = "resolv-conf" version = "0.7.0" @@ -3427,11 +4014,29 @@ dependencies = [ "axum_session_surreal", "http-body-util", "hyper 1.4.1", - "surrealdb", + "surrealdb 1.3.1", "tokio", "tower", ] +[[package]] +name = "revision" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87eb86913082f8976b06d07a59f17df9120e6f38b882cf3fc5a45b4499e224b6" +dependencies = [ + "bincode", + "chrono", + "geo 0.26.0", + "regex", + "revision-derive 0.5.0", + "roaring", + "rust_decimal", + "serde", + "thiserror", + "uuid", +] + [[package]] name = "revision" version = "0.7.1" @@ -3442,7 +4047,7 @@ dependencies = [ "chrono", "geo 0.26.0", "regex", - "revision-derive", + "revision-derive 0.7.0", "roaring", "rust_decimal", "serde", @@ -3450,6 +4055,34 @@ dependencies = [ "uuid", ] +[[package]] +name = "revision" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22f53179a035f881adad8c4d58a2c599c6b4a8325b989c68d178d7a34d1b1e4c" +dependencies = [ + "chrono", + "geo 0.28.0", + "regex", + "revision-derive 0.10.0", + "roaring", + "rust_decimal", + "uuid", +] + +[[package]] +name = "revision-derive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf996fc5f61f1dbec35799b5c00c6dda12e8862e8cb782ed24e10d0292e60ed3" +dependencies = [ + "darling", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.77", +] + [[package]] name = "revision-derive" version = "0.7.0" @@ -3463,6 +4096,17 @@ dependencies = [ "syn 2.0.77", ] +[[package]] +name = "revision-derive" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f0ec466e5d8dca9965eb6871879677bef5590cf7525ad96cae14376efb75073" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", +] + [[package]] name = "ring" version = "0.16.20" @@ -3533,6 +4177,17 @@ dependencies = [ "paste", ] +[[package]] +name = "rmp-serde" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52e599a477cf9840e92f2cde9a7189e67b42c57532749bf90aea6ec10facd4db" +dependencies = [ + "byteorder", + "rmp", + "serde", +] + [[package]] name = "rmpv" version = "1.3.0" @@ -3586,7 +4241,18 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73111312eb7a2287d229f06c00ff35b51ddee180f017ab6dec1f69d62ac098d6" dependencies = [ - "heapless", + "heapless 0.7.17", + "num-traits", + "smallvec", +] + +[[package]] +name = "rstar" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "133315eb94c7b1e8d0cb097e5a710d850263372fd028fff18969de708afc7008" +dependencies = [ + "heapless 0.8.0", "num-traits", "smallvec", ] @@ -3623,6 +4289,12 @@ version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" +[[package]] +name = "rustc-hash" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" + [[package]] name = "rustc_lexer" version = "0.1.0" @@ -3682,6 +4354,7 @@ version = "0.23.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2dabaac7466917e566adb06783a81ca48944c6898a1b08b9374106dd671f4c8" dependencies = [ + "log", "once_cell", "ring 0.17.8", "rustls-pki-types", @@ -3714,6 +4387,9 @@ name = "rustls-pki-types" version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" +dependencies = [ + "web-time", +] [[package]] name = "rustls-webpki" @@ -3856,6 +4532,15 @@ dependencies = [ "serde_derive", ] +[[package]] +name = "serde-content" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e255eaf9f3814135df4f959c9f404ebb2e67238bae0ed412da10518d0629e7c9" +dependencies = [ + "serde", +] + [[package]] name = "serde_bytes" version = "0.11.15" @@ -4419,6 +5104,12 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "static_assertions_next" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7beae5182595e9a8b683fa98c4317f956c9a2dec3b9716990d20023cc60c766" + [[package]] name = "storekey" version = "0.5.0" @@ -4440,8 +5131,21 @@ dependencies = [ "new_debug_unreachable", "once_cell", "parking_lot", - "phf_shared", + "phf_shared 0.10.0", "precomputed-hash", + "serde", +] + +[[package]] +name = "string_cache_codegen" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bb30289b722be4ff74a408c3cc27edeaad656e06cb1fe8fa9231fa59c728988" +dependencies = [ + "phf_generator 0.10.0", + "phf_shared 0.10.0", + "proc-macro2", + "quote", ] [[package]] @@ -4461,6 +5165,28 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +[[package]] +name = "strum" +version = "0.26.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" +dependencies = [ + "heck 0.5.0", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.77", +] + [[package]] name = "subtle" version = "2.6.1" @@ -4475,15 +5201,15 @@ dependencies = [ "axum", "axum_session 0.14.2 (registry+https://github.com/rust-lang/crates.io-index)", "axum_session_surreal", - "surrealdb", + "surrealdb 2.0.1", "tokio", ] [[package]] name = "surrealdb" -version = "1.5.5" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e21f01832ac4cc794b1d3959b6aa669c1eb720b4c8cc2c38f4495560f6587334" +checksum = "763696a1b2da764f1bbc0db79115f08a01a0eae87817f238395e668043be3b21" dependencies = [ "async-channel", "bincode", @@ -4497,8 +5223,8 @@ dependencies = [ "once_cell", "path-clean", "pharos", - "reqwest", - "revision", + "reqwest 0.11.27", + "revision 0.5.0", "ring 0.17.8", "rust_decimal", "rustls 0.21.12", @@ -4506,10 +5232,50 @@ dependencies = [ "serde", "serde_json", "surrealdb-core 1.5.3", - "surrealdb-core 2.0.0-1.5.5", "thiserror", "tokio", - "tokio-tungstenite", + "tokio-tungstenite 0.20.1", + "tracing", + "trice", + "url", + "uuid", + "wasm-bindgen-futures", + "wasmtimer", + "ws_stream_wasm", +] + +[[package]] +name = "surrealdb" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54a327b352feacd0e724399dcb6a673acd6fb2a88e0dc9c3fed7758d97dceef1" +dependencies = [ + "arrayvec", + "async-channel", + "bincode", + "chrono", + "dmp", + "futures", + "geo 0.28.0", + "indexmap 2.5.0", + "path-clean", + "pharos", + "reblessive", + "reqwest 0.12.7", + "revision 0.10.0", + "ring 0.17.8", + "rust_decimal", + "rustls 0.23.13", + "rustls-pki-types", + "semver", + "serde", + "serde-content", + "serde_json", + "surrealdb-core 2.0.1", + "thiserror", + "tokio", + "tokio-tungstenite 0.23.1", + "tokio-util", "tracing", "trice", "url", @@ -4539,7 +5305,7 @@ dependencies = [ "chrono", "deunicode", "dmp", - "echodb", + "echodb 0.4.0", "fst", "futures", "fuzzy-matcher", @@ -4552,16 +5318,16 @@ dependencies = [ "nanoid", "nom", "num_cpus", - "object_store", + "object_store 0.8.0", "once_cell", "pbkdf2 0.12.2", "pharos", "pin-project-lite", - "quick_cache", + "quick_cache 0.4.3", "radix_trie", "rand 0.8.5", "regex", - "revision", + "revision 0.7.1", "ring 0.17.8", "roaring", "rust-stemmers", @@ -4590,56 +5356,59 @@ dependencies = [ [[package]] name = "surrealdb-core" -version = "2.0.0-1.5.5" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3570cae3ad7606af000e820e6f2134729ccd565212a00c6bb36cfd71b3ef72" +checksum = "80433611bdf00df5ff59d52a708b60ac23598db3e3f9460cde625ea925c8f776" dependencies = [ "addr", "ahash 0.8.11", + "ammonia", "any_ascii", "argon2", "async-channel", "async-executor", - "async-recursion", + "async-graphql", "base64 0.21.7", "bcrypt", "bincode", + "blake3", "bytes", + "castaway", "cedar-policy", "chrono", "ciborium", "dashmap 5.5.3", "deunicode", "dmp", - "echodb", + "echodb 0.7.0", + "ext-sort", "fst", "futures", "fuzzy-matcher", - "geo 0.27.0", + "geo 0.28.0", "geo-types", - "hashbrown 0.14.5", "hex", "ipnet", + "jsonwebtoken", "lexicmp", "linfa-linalg", "md-5", "nanoid", "ndarray", "ndarray-stats", - "nom", "num-traits", "num_cpus", - "object_store", - "once_cell", + "object_store 0.10.2", "pbkdf2 0.12.2", "pharos", + "phf", "pin-project-lite", - "quick_cache", + "quick_cache 0.5.2", "radix_trie", "rand 0.8.5", "reblessive", "regex", - "revision", + "revision 0.10.0", "ring 0.17.8", "rmpv", "roaring", @@ -4648,18 +5417,21 @@ dependencies = [ "scrypt", "semver", "serde", + "serde-content", "serde_json", "sha1", "sha2", "snap", "storekey", + "subtle", "surrealdb-derive", - "surrealdb-jsonwebtoken", + "tempfile", "thiserror", "tokio", "tracing", "trice", "ulid", + "unicase", "url", "uuid", "wasm-bindgen-futures", @@ -4686,7 +5458,7 @@ dependencies = [ "base64 0.21.7", "getrandom 0.2.15", "hmac", - "pem", + "pem 2.0.1", "rand 0.8.5", "ring 0.16.20", "rsa", @@ -4741,6 +5513,9 @@ name = "sync_wrapper" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +dependencies = [ + "futures-core", +] [[package]] name = "system-configuration" @@ -4788,6 +5563,17 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "tendril" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d24a120c5fc464a3458240ee02c299ebcb9d67b5249c8848b09d639dca8d7bb0" +dependencies = [ + "futf", + "mac", + "utf-8", +] + [[package]] name = "term" version = "0.7.0" @@ -4924,6 +5710,17 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-rustls" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" +dependencies = [ + "rustls 0.23.13", + "rustls-pki-types", + "tokio", +] + [[package]] name = "tokio-stream" version = "0.1.16" @@ -4945,11 +5742,27 @@ dependencies = [ "log", "rustls 0.21.12", "tokio", - "tokio-rustls", - "tungstenite", + "tokio-rustls 0.24.1", + "tungstenite 0.20.1", "webpki-roots 0.25.4", ] +[[package]] +name = "tokio-tungstenite" +version = "0.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6989540ced10490aaf14e6bad2e3d33728a2813310a0c71d1574304c49631cd" +dependencies = [ + "futures-util", + "log", + "rustls 0.23.13", + "rustls-pki-types", + "tokio", + "tokio-rustls 0.26.0", + "tungstenite 0.23.0", + "webpki-roots 0.26.5", +] + [[package]] name = "tokio-util" version = "0.7.12" @@ -5078,6 +5891,27 @@ dependencies = [ "utf-8", ] +[[package]] +name = "tungstenite" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e2e2ce1e47ed2994fd43b04c8f618008d4cabdd5ee34027cf14f9d918edd9c8" +dependencies = [ + "byteorder", + "bytes", + "data-encoding", + "http 1.1.0", + "httparse", + "log", + "rand 0.8.5", + "rustls 0.23.13", + "rustls-pki-types", + "sha1", + "thiserror", + "url", + "utf-8", +] + [[package]] name = "typed-builder" version = "0.10.0" @@ -5095,6 +5929,12 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +[[package]] +name = "ucd-trie" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" + [[package]] name = "ulid" version = "1.1.3" @@ -5472,6 +6312,36 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-registry" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" +dependencies = [ + "windows-result", + "windows-strings", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result", + "windows-targets 0.52.6", +] + [[package]] name = "windows-sys" version = "0.48.0" diff --git a/databases/surreal/Cargo.toml b/databases/surreal/Cargo.toml index 87b727d..e2b668d 100644 --- a/databases/surreal/Cargo.toml +++ b/databases/surreal/Cargo.toml @@ -14,4 +14,4 @@ repository = "https://github.com/AscendingCreations/AxumSession" axum_session.workspace = true chrono.workspace = true async-trait.workspace = true -surrealdb = { version = "1.5.4"} +surrealdb = { version = "2.0"} diff --git a/databases/surreal/src/lib.rs b/databases/surreal/src/lib.rs index fa6f4a4..24ff8eb 100644 --- a/databases/surreal/src/lib.rs +++ b/databases/surreal/src/lib.rs @@ -67,7 +67,7 @@ impl DatabasePool for SessionSurrealPool { "SELECT sessionid FROM type::table($table_name) WHERE sessionexpires = NONE OR sessionexpires < $expires;", ) - .bind(("table_name", table_name)) + .bind(("table_name", table_name.to_string())) .await .map_err(|err| DatabaseError::GenericSelectError(err.to_string()))?; @@ -77,7 +77,7 @@ impl DatabasePool for SessionSurrealPool { self.connection .query("DELETE type::table($table_name) WHERE sessionexpires < $expires;") - .bind(("table_name", table_name)) + .bind(("table_name", table_name.to_string())) .bind(("expires", Utc::now().timestamp())) .await .map_err(|err| DatabaseError::GenericDeleteError(err.to_string()))?; @@ -89,7 +89,7 @@ impl DatabasePool for SessionSurrealPool { let mut res = self .connection .query("SELECT count() AS amount FROM type::table($table_name) GROUP BY amount;") - .bind(("table_name", table_name)) + .bind(("table_name", table_name.to_string())) .await .map_err(|err| DatabaseError::GenericSelectError(err.to_string()))?; @@ -114,10 +114,10 @@ impl DatabasePool for SessionSurrealPool { .query( "UPDATE type::thing($table_name, $session_id) SET sessionstore = $store, sessionexpires = $expire, sessionid = $session_id;", ) - .bind(("table_name", table_name)) + .bind(("table_name", table_name.to_string())) .bind(("session_id", id.to_string())) .bind(("expire", expires.to_string())) - .bind(("store", session)) + .bind(("store", session.to_string())) .await.map_err(|err| DatabaseError::GenericSelectError(err.to_string()))?; Ok(()) @@ -130,8 +130,8 @@ impl DatabasePool for SessionSurrealPool { "SELECT sessionstore FROM type::thing($table_name, $session_id) WHERE sessionexpires = NONE OR sessionexpires > $expires;", ) - .bind(("table_name", table_name)) - .bind(("session_id", id)) + .bind(("table_name", table_name.to_string())) + .bind(("session_id", id.to_string())) .bind(("expires", Utc::now().timestamp())) .await .map_err(|err| DatabaseError::GenericSelectError(err.to_string()))?; @@ -145,8 +145,8 @@ impl DatabasePool for SessionSurrealPool { async fn delete_one_by_id(&self, id: &str, table_name: &str) -> Result<(), DatabaseError> { self.connection .query("DELETE type::table($table_name) WHERE sessionid < $session_id;") - .bind(("table_name", table_name)) - .bind(("session_id", id)) + .bind(("table_name", table_name.to_string())) + .bind(("session_id", id.to_string())) .await .map_err(|err| DatabaseError::GenericDeleteError(err.to_string()))?; @@ -157,11 +157,11 @@ impl DatabasePool for SessionSurrealPool { let mut res = self .connection .query( - "SELECT count() AS amount FROM type::thing($table_name, $session_id) + "SELECT count() AS amount FROM type::thing($table_name, $session_id) WHERE sessionexpires = NONE OR sessionexpires > $expires GROUP BY amount;", ) - .bind(("table_name", table_name)) - .bind(("session_id", id)) + .bind(("table_name", table_name.to_string())) + .bind(("session_id", id.to_string())) .bind(("expires", Utc::now().timestamp())) .await .map_err(|err| DatabaseError::GenericSelectError(err.to_string()))?; @@ -175,7 +175,7 @@ impl DatabasePool for SessionSurrealPool { async fn delete_all(&self, table_name: &str) -> Result<(), DatabaseError> { self.connection .query("DELETE type::table($table_name);") - .bind(("table_name", table_name)) + .bind(("table_name", table_name.to_string())) .await .map_err(|err| DatabaseError::GenericDeleteError(err.to_string()))?; @@ -189,7 +189,7 @@ impl DatabasePool for SessionSurrealPool { "SELECT sessionid FROM type::table($table_name) WHERE sessionexpires = NONE OR sessionexpires > $expires;", ) - .bind(("table_name", table_name)) + .bind(("table_name", table_name.to_string())) .bind(("expires", Utc::now().timestamp())) .await .map_err(|err| DatabaseError::GenericSelectError(err.to_string()))?; diff --git a/examples/surrealdb/Cargo.toml b/examples/surrealdb/Cargo.toml index b019d3d..75dc8ad 100644 --- a/examples/surrealdb/Cargo.toml +++ b/examples/surrealdb/Cargo.toml @@ -9,5 +9,5 @@ axum.workspace = true tokio.workspace = true async-trait.workspace = true axum_session.workspace = true -surrealdb = { version = "1.0.0", features = ["kv-mem"] } -axum_session_surreal = { path = "../../databases/surreal" } \ No newline at end of file +surrealdb = { version = "2.0", features = ["kv-mem"] } +axum_session_surreal = { path = "../../databases/surreal" }