From deb87deb62d0d13da79bf04357f5e269fe6c8323 Mon Sep 17 00:00:00 2001 From: Micha de Vries Date: Mon, 20 Jan 2025 15:34:13 +0100 Subject: [PATCH] attempt with current surrealdb --- Cargo.lock | 118 +++++++++++++++++++++++++++++++++++++++++-------- Cargo.toml | 2 +- src/app/mod.rs | 2 +- 3 files changed, 102 insertions(+), 20 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 880f117..7d8d3e1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "Inflector" @@ -1430,7 +1430,7 @@ dependencies = [ "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows-core", + "windows-core 0.52.0", ] [[package]] @@ -1611,9 +1611,9 @@ dependencies = [ [[package]] name = "indxdb" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "817e28ebe3466175be7e66f4eadfb9e6a221537db2f78b6be04e14b7051a56af" +checksum = "f05476bd2d53144694df139c006908ceafa6f633a0112bbb8ec34b0ae9eb629e" dependencies = [ "js-sys", "rexie", @@ -2012,6 +2012,15 @@ dependencies = [ "num-traits", ] +[[package]] +name = "ntapi" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8a3895c6391c39d7fe7ebc444a87eb2991b2a0bc718fdabd071eec617fc68e4" +dependencies = [ + "winapi", +] + [[package]] name = "num-bigint" version = "0.4.6" @@ -3233,9 +3242,8 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "surrealdb" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "945def13babba236bff2890a65d5195e3604f1c10b331df70933750511eb73ce" +version = "2.1.4" +source = "git+https://github.com/surrealdb/surrealdb#48eaf5ef5f8c677b2150fd6cc30d81bb003e22a1" dependencies = [ "arrayvec", "async-channel", @@ -3270,9 +3278,8 @@ dependencies = [ [[package]] name = "surrealdb-core" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d10fa06f72a550c35c82cbd7b4e9163f3ca1a7163e234ed0e1570145a6fa5951" +version = "2.1.4" +source = "git+https://github.com/surrealdb/surrealdb#48eaf5ef5f8c677b2150fd6cc30d81bb003e22a1" dependencies = [ "addr", "ahash 0.8.11", @@ -3313,6 +3320,7 @@ dependencies = [ "num-traits", "num_cpus", "object_store", + "parking_lot", "pbkdf2", "pharos", "phf", @@ -3343,6 +3351,7 @@ dependencies = [ "subtle", "surrealdb-derive", "surrealkv", + "sysinfo", "tempfile", "thiserror", "tokio", @@ -3352,7 +3361,7 @@ dependencies = [ "unicase", "url", "uuid", - "vart", + "vart 0.8.1", "wasm-bindgen-futures", "wasmtimer", "ws_stream_wasm", @@ -3392,9 +3401,9 @@ dependencies = [ [[package]] name = "surrealkv" -version = "0.6.1" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebb03cdc3e271798ab1a45e5eb7a2fe1e9579d5771b6226915ccf8f03b08397a" +checksum = "87b26b3b1ba4433ab3152304838b70b2798990ffdc739b8b551b4e3e64b8fe52" dependencies = [ "ahash 0.8.11", "async-channel", @@ -3408,7 +3417,7 @@ dependencies = [ "quick_cache 0.6.9", "revision", "tokio", - "vart", + "vart 0.9.0", "wasm-bindgen-futures", ] @@ -3454,6 +3463,20 @@ dependencies = [ "syn 2.0.89", ] +[[package]] +name = "sysinfo" +version = "0.33.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fc858248ea01b66f19d8e8a6d55f41deaf91e9d495246fd01368d99935c6c01" +dependencies = [ + "core-foundation-sys", + "libc", + "memchr", + "ntapi", + "rayon", + "windows", +] + [[package]] name = "tap" version = "1.0.1" @@ -3857,9 +3880,15 @@ dependencies = [ [[package]] name = "vart" -version = "0.7.0" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87782b74f898179396e93c0efabb38de0d58d50bbd47eae00c71b3a1144dbbae" + +[[package]] +name = "vart" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c92195d375eb94995afddeedfd7f246796eb60b85f727c538e42222c4c9b2d3" +checksum = "9486b23b6bec4be5205c9d696a8cc2bc82c51ee82a26e93ceabac56e535dfbcc" [[package]] name = "version_check" @@ -4062,6 +4091,16 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12342cb4d8e3b046f3d80effd474a7a02447231330ef77d71daa6fbc40681143" +dependencies = [ + "windows-core 0.57.0", + "windows-targets", +] + [[package]] name = "windows-core" version = "0.52.0" @@ -4071,17 +4110,60 @@ dependencies = [ "windows-targets", ] +[[package]] +name = "windows-core" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2ed2439a290666cd67ecce2b0ffaad89c2a56b976b736e6ece670297897832d" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-result 0.1.2", + "windows-targets", +] + +[[package]] +name = "windows-implement" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", +] + +[[package]] +name = "windows-interface" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", +] + [[package]] name = "windows-registry" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" dependencies = [ - "windows-result", + "windows-result 0.2.0", "windows-strings", "windows-targets", ] +[[package]] +name = "windows-result" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8" +dependencies = [ + "windows-targets", +] + [[package]] name = "windows-result" version = "0.2.0" @@ -4097,7 +4179,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" dependencies = [ - "windows-result", + "windows-result 0.2.0", "windows-targets", ] diff --git a/Cargo.toml b/Cargo.toml index 2d8d0a5..ca5c5b8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,7 +25,7 @@ kv-mem = ["surrealdb/kv-mem"] stack-traces = ["dep:console_error_panic_hook"] [dependencies] -surrealdb = { version = "2.1.1", default-features = false, features = ["http"] } +surrealdb = { git="https://github.com/surrealdb/surrealdb", default-features = false, features = ["http"] } ciborium = "0.2.2" console_error_panic_hook = { version = "0.1.7", optional = true } fern = "0.6.2" diff --git a/src/app/mod.rs b/src/app/mod.rs index d341433..5a91361 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -35,7 +35,7 @@ impl SurrealWasmEngine { let in_data = cbor::req(data.to_vec()).map_err(|e| e.to_string())?; let res = self .0 - .execute(Method::parse(in_data.method), in_data.params) + .execute_mutable(Method::parse(in_data.method), in_data.params) .await .map_err(|e| e.to_string())?; println!("{:?}", res);