Initial commit for SurrealCS (#4458)

Co-authored-by: Tobie Morgan Hitchcock <tobie@surrealdb.com>
Co-authored-by: Raphael Darley <raphael.darley@surrealdb.com>
This commit is contained in:
Maxwell Flitton 2024-09-04 14:53:37 +01:00 committed by GitHub
parent 29c6914b04
commit 0a1a99dc68
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
36 changed files with 1300 additions and 246 deletions

267
Cargo.lock generated
View file

@ -123,7 +123,7 @@ dependencies = [
"actix-utils", "actix-utils",
"futures-core", "futures-core",
"futures-util", "futures-util",
"mio", "mio 0.8.11",
"socket2", "socket2",
"tokio", "tokio",
"tracing", "tracing",
@ -538,7 +538,7 @@ dependencies = [
"http 1.1.0", "http 1.1.0",
"indexmap 2.2.6", "indexmap 2.2.6",
"mime", "mime",
"multer 3.1.0", "multer",
"num-traits", "num-traits",
"once_cell", "once_cell",
"pin-project-lite", "pin-project-lite",
@ -835,9 +835,9 @@ dependencies = [
[[package]] [[package]]
name = "axum-extra" name = "axum-extra"
version = "0.9.2" version = "0.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "895ff42f72016617773af68fb90da2a9677d89c62338ec09162d4909d86fdd8f" checksum = "0be6ea09c9b96cb5076af0de2e383bd2bc0c18f827cf1967bdd353e0b910d733"
dependencies = [ dependencies = [
"axum 0.7.5", "axum 0.7.5",
"axum-core 0.4.3", "axum-core 0.4.3",
@ -857,6 +857,7 @@ dependencies = [
"tower", "tower",
"tower-layer", "tower-layer",
"tower-service", "tower-service",
"tracing",
] ]
[[package]] [[package]]
@ -1015,6 +1016,30 @@ version = "0.6.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb"
[[package]]
name = "bitcode"
version = "0.6.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ee1bce7608560cd4bf0296a4262d0dbf13e6bcec5ff2105724c8ab88cc7fc784"
dependencies = [
"arrayvec",
"bitcode_derive",
"bytemuck",
"glam",
"serde",
]
[[package]]
name = "bitcode_derive"
version = "0.6.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a539389a13af092cd345a2b47ae7dec12deb306d660b2223d25cd3419b253ebe"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.77",
]
[[package]] [[package]]
name = "bitflags" name = "bitflags"
version = "1.3.2" version = "1.3.2"
@ -1325,7 +1350,7 @@ dependencies = [
"num-traits", "num-traits",
"serde", "serde",
"wasm-bindgen", "wasm-bindgen",
"windows-targets 0.52.4", "windows-targets 0.52.6",
] ]
[[package]] [[package]]
@ -2410,6 +2435,12 @@ version = "0.28.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253"
[[package]]
name = "glam"
version = "0.29.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c28091a37a5d09b555cb6628fd954da299b536433834f5b8e59eba78e0cbbf8a"
[[package]] [[package]]
name = "glob" name = "glob"
version = "0.3.1" version = "0.3.1"
@ -3133,7 +3164,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"windows-targets 0.52.4", "windows-targets 0.52.6",
] ]
[[package]] [[package]]
@ -3426,23 +3457,15 @@ dependencies = [
] ]
[[package]] [[package]]
name = "multer" name = "mio"
version = "2.1.0" version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "01acbdc23469fd8fe07ab135923371d5f5a422fbf9c522158677c8eb15bc51c2" checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec"
dependencies = [ dependencies = [
"bytes", "hermit-abi",
"encoding_rs", "libc",
"futures-util", "wasi 0.11.0+wasi-snapshot-preview1",
"http 0.2.12", "windows-sys 0.52.0",
"httparse",
"log",
"memchr",
"mime",
"spin 0.9.8",
"tokio",
"tokio-util",
"version_check",
] ]
[[package]] [[package]]
@ -3459,6 +3482,8 @@ dependencies = [
"memchr", "memchr",
"mime", "mime",
"spin 0.9.8", "spin 0.9.8",
"tokio",
"tokio-util",
"version_check", "version_check",
] ]
@ -3477,6 +3502,28 @@ dependencies = [
"rand 0.8.5", "rand 0.8.5",
] ]
[[package]]
name = "nanoservices-utils"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c6a95cdb2ba5dc6584099b1aac8da0a6f80e12ad5f9381a19d232c1fee714793"
dependencies = [
"actix-web",
"bincode",
"bitcode",
"bytes",
"chrono",
"futures",
"jsonwebtoken",
"paste",
"revision 0.7.1",
"serde",
"serde_json",
"thiserror",
"tokio",
"tokio-util",
]
[[package]] [[package]]
name = "native-tls" name = "native-tls"
version = "0.2.11" version = "0.2.11"
@ -4726,9 +4773,9 @@ dependencies = [
[[package]] [[package]]
name = "reqwest" name = "reqwest"
version = "0.12.5" version = "0.12.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c7d6d2a27d57148378eb5e111173f4276ad26340ecc5c49a4a2152167a2d6a37" checksum = "f8f4955649ef5c38cc7f9e8aa41761d48fb9677197daea9984dc54f56aad5e63"
dependencies = [ dependencies = [
"async-compression", "async-compression",
"base64 0.22.0", "base64 0.22.0",
@ -4772,7 +4819,7 @@ dependencies = [
"wasm-streams", "wasm-streams",
"web-sys", "web-sys",
"webpki-roots", "webpki-roots",
"winreg", "windows-registry",
] ]
[[package]] [[package]]
@ -4960,9 +5007,9 @@ checksum = "cbf4a6aa5f6d6888f39e980649f3ad6b666acdce1d78e95b8a2cb076e687ae30"
[[package]] [[package]]
name = "rocket" name = "rocket"
version = "0.5.0" version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9e7bb57ccb26670d73b6a47396c83139447b9e7878cab627fdfe9ea8da489150" checksum = "a516907296a31df7dc04310e7043b61d71954d703b603cc6867a026d7e72d73f"
dependencies = [ dependencies = [
"async-stream", "async-stream",
"async-trait", "async-trait",
@ -4975,7 +5022,7 @@ dependencies = [
"indexmap 2.2.6", "indexmap 2.2.6",
"log", "log",
"memchr", "memchr",
"multer 2.1.0", "multer",
"num_cpus", "num_cpus",
"parking_lot", "parking_lot",
"pin-project-lite", "pin-project-lite",
@ -5008,9 +5055,9 @@ dependencies = [
[[package]] [[package]]
name = "rocket_codegen" name = "rocket_codegen"
version = "0.5.0" version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a2238066abf75f21be6cd7dc1a09d5414a671f4246e384e49fe3f8a4936bd04c" checksum = "575d32d7ec1a9770108c879fc7c47815a80073f96ca07ff9525a94fcede1dd46"
dependencies = [ dependencies = [
"devise", "devise",
"glob", "glob",
@ -5025,9 +5072,9 @@ dependencies = [
[[package]] [[package]]
name = "rocket_http" name = "rocket_http"
version = "0.5.0" version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "37a1663694d059fe5f943ea5481363e48050acedd241d46deb2e27f71110389e" checksum = "e274915a20ee3065f611c044bd63c40757396b6dbc057d6046aec27f14f882b9"
dependencies = [ dependencies = [
"cookie 0.18.1", "cookie 0.18.1",
"either", "either",
@ -5943,6 +5990,41 @@ dependencies = [
"wiremock", "wiremock",
] ]
[[package]]
name = "surrealcs"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc1566e270e18469068b7bc38ae65f7e8eb7677f11fa98930444d1942152807f"
dependencies = [
"bincode",
"bytes",
"chrono",
"futures",
"nanoservices-utils",
"num_cpus",
"once_cell",
"serde",
"surrealcs-kernel",
"tokio",
"tokio-util",
"tracing",
"tracing-subscriber",
]
[[package]]
name = "surrealcs-kernel"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5922a9627477b9dd2b207b6f5d59fbcff772057f321a615740af51f9cf8e3148"
dependencies = [
"bincode",
"chrono",
"nanoservices-utils",
"serde",
"tokio",
"tracing",
]
[[package]] [[package]]
name = "surrealdb" name = "surrealdb"
version = "2.0.0" version = "2.0.0"
@ -6081,6 +6163,7 @@ dependencies = [
"snap", "snap",
"storekey", "storekey",
"subtle", "subtle",
"surrealcs",
"surrealdb-derive", "surrealdb-derive",
"surrealdb-tikv-client", "surrealdb-tikv-client",
"surrealkv", "surrealkv",
@ -6250,6 +6333,9 @@ name = "sync_wrapper"
version = "1.0.0" version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "384595c11a4e2969895cad5a8c4029115f5ab956a9e5ef4de79d11a426e5f20c" checksum = "384595c11a4e2969895cad5a8c4029115f5ab956a9e5ef4de79d11a426e5f20c"
dependencies = [
"futures-core",
]
[[package]] [[package]]
name = "take_mut" name = "take_mut"
@ -6468,21 +6554,20 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]] [[package]]
name = "tokio" name = "tokio"
version = "1.38.0" version = "1.40.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998"
dependencies = [ dependencies = [
"backtrace", "backtrace",
"bytes", "bytes",
"libc", "libc",
"mio", "mio 1.0.2",
"num_cpus",
"parking_lot", "parking_lot",
"pin-project-lite", "pin-project-lite",
"signal-hook-registry", "signal-hook-registry",
"socket2", "socket2",
"tokio-macros", "tokio-macros",
"windows-sys 0.48.0", "windows-sys 0.52.0",
] ]
[[package]] [[package]]
@ -6497,9 +6582,9 @@ dependencies = [
[[package]] [[package]]
name = "tokio-macros" name = "tokio-macros"
version = "2.3.0" version = "2.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -6580,9 +6665,9 @@ dependencies = [
[[package]] [[package]]
name = "tokio-util" name = "tokio-util"
version = "0.7.10" version = "0.7.11"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1"
dependencies = [ dependencies = [
"bytes", "bytes",
"futures-core", "futures-core",
@ -6590,7 +6675,6 @@ dependencies = [
"futures-sink", "futures-sink",
"pin-project-lite", "pin-project-lite",
"tokio", "tokio",
"tracing",
] ]
[[package]] [[package]]
@ -6763,9 +6847,9 @@ checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0"
[[package]] [[package]]
name = "tower-service" name = "tower-service"
version = "0.3.2" version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3"
[[package]] [[package]]
name = "tracing" name = "tracing"
@ -7344,7 +7428,37 @@ version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9"
dependencies = [ dependencies = [
"windows-targets 0.52.4", "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]] [[package]]
@ -7362,7 +7476,7 @@ version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
dependencies = [ dependencies = [
"windows-targets 0.52.4", "windows-targets 0.52.6",
] ]
[[package]] [[package]]
@ -7382,17 +7496,18 @@ dependencies = [
[[package]] [[package]]
name = "windows-targets" name = "windows-targets"
version = "0.52.4" version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
dependencies = [ dependencies = [
"windows_aarch64_gnullvm 0.52.4", "windows_aarch64_gnullvm 0.52.6",
"windows_aarch64_msvc 0.52.4", "windows_aarch64_msvc 0.52.6",
"windows_i686_gnu 0.52.4", "windows_i686_gnu 0.52.6",
"windows_i686_msvc 0.52.4", "windows_i686_gnullvm",
"windows_x86_64_gnu 0.52.4", "windows_i686_msvc 0.52.6",
"windows_x86_64_gnullvm 0.52.4", "windows_x86_64_gnu 0.52.6",
"windows_x86_64_msvc 0.52.4", "windows_x86_64_gnullvm 0.52.6",
"windows_x86_64_msvc 0.52.6",
] ]
[[package]] [[package]]
@ -7403,9 +7518,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8"
[[package]] [[package]]
name = "windows_aarch64_gnullvm" name = "windows_aarch64_gnullvm"
version = "0.52.4" version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
[[package]] [[package]]
name = "windows_aarch64_msvc" name = "windows_aarch64_msvc"
@ -7415,9 +7530,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"
[[package]] [[package]]
name = "windows_aarch64_msvc" name = "windows_aarch64_msvc"
version = "0.52.4" version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
[[package]] [[package]]
name = "windows_i686_gnu" name = "windows_i686_gnu"
@ -7427,9 +7542,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"
[[package]] [[package]]
name = "windows_i686_gnu" name = "windows_i686_gnu"
version = "0.52.4" version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
[[package]]
name = "windows_i686_gnullvm"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
[[package]] [[package]]
name = "windows_i686_msvc" name = "windows_i686_msvc"
@ -7439,9 +7560,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"
[[package]] [[package]]
name = "windows_i686_msvc" name = "windows_i686_msvc"
version = "0.52.4" version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
[[package]] [[package]]
name = "windows_x86_64_gnu" name = "windows_x86_64_gnu"
@ -7451,9 +7572,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e"
[[package]] [[package]]
name = "windows_x86_64_gnu" name = "windows_x86_64_gnu"
version = "0.52.4" version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
[[package]] [[package]]
name = "windows_x86_64_gnullvm" name = "windows_x86_64_gnullvm"
@ -7463,9 +7584,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"
[[package]] [[package]]
name = "windows_x86_64_gnullvm" name = "windows_x86_64_gnullvm"
version = "0.52.4" version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
[[package]] [[package]]
name = "windows_x86_64_msvc" name = "windows_x86_64_msvc"
@ -7475,9 +7596,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
[[package]] [[package]]
name = "windows_x86_64_msvc" name = "windows_x86_64_msvc"
version = "0.52.4" version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
[[package]] [[package]]
name = "winnow" name = "winnow"
@ -7497,16 +7618,6 @@ dependencies = [
"memchr", "memchr",
] ]
[[package]]
name = "winreg"
version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5"
dependencies = [
"cfg-if",
"windows-sys 0.48.0",
]
[[package]] [[package]]
name = "wiremock" name = "wiremock"
version = "0.6.0" version = "0.6.0"

View file

@ -20,6 +20,7 @@ storage-rocksdb = ["surrealdb/kv-rocksdb"]
storage-tikv = ["surrealdb/kv-tikv"] storage-tikv = ["surrealdb/kv-tikv"]
storage-fdb = ["surrealdb/kv-fdb"] storage-fdb = ["surrealdb/kv-fdb"]
storage-surrealkv = ["surrealdb/kv-surrealkv"] storage-surrealkv = ["surrealdb/kv-surrealkv"]
storage-surrealcs = ["surrealdb/kv-surrealcs"]
scripting = ["surrealdb/scripting"] scripting = ["surrealdb/scripting"]
http = ["surrealdb/http"] http = ["surrealdb/http"]
http-compression = [] http-compression = []
@ -27,8 +28,8 @@ ml = ["surrealdb/ml"]
jwks = ["surrealdb/jwks"] jwks = ["surrealdb/jwks"]
performance-profiler = ["dep:pprof"] performance-profiler = ["dep:pprof"]
# Special features # Special features
storage-fdb-7_1 = ["surrealdb-core/kv-fdb-7_1"] storage-fdb-7_1 = ["surrealdb/kv-fdb-7_1"]
storage-fdb-7_3 = ["surrealdb-core/kv-fdb-7_3"] storage-fdb-7_3 = ["surrealdb/kv-fdb-7_3"]
[workspace] [workspace]
members = [ members = [
@ -56,8 +57,8 @@ inherits = "dev"
argon2 = "0.5.2" argon2 = "0.5.2"
async-graphql = { version = "7.0.9", default-features = false } async-graphql = { version = "7.0.9", default-features = false }
async-graphql-axum = { version = "7.0.9" } async-graphql-axum = { version = "7.0.9" }
axum = { version = "0.7.4", features = ["tracing", "ws"] } axum = { version = "0.7.5", features = ["tracing", "ws"] }
axum-extra = { version = "0.9.2", features = [ axum-extra = { version = "0.9.3", features = [
"query", "query",
"typed-routing", "typed-routing",
"typed-header", "typed-header",
@ -73,15 +74,15 @@ clap = { version = "4.4.11", features = [
"wrap_help", "wrap_help",
"unicode", "unicode",
] } ] }
futures = "0.3.29" futures = "0.3.30"
futures-util = "0.3.29" futures-util = "0.3.30"
geo = "0.28.0" geo = "0.28.0"
geo-types = "0.7.13" geo-types = "0.7.13"
glob = "0.3.1" glob = "0.3.1"
http = "1.1.0" http = "1.1.0"
http-body = "1.0.0" http-body = "1.0.0"
http-body-util = "0.1.1" http-body-util = "0.1.1"
hyper = "1.2.0" hyper = "1.4.1"
once_cell = "1.18.0" once_cell = "1.18.0"
opentelemetry = { version = "0.24" } opentelemetry = { version = "0.24" }
opentelemetry_sdk = { version = "0.24", features = ["rt-tokio"] } opentelemetry_sdk = { version = "0.24", features = ["rt-tokio"] }
@ -92,7 +93,7 @@ pprof = { version = "0.13.0", features = [
"prost-codec", "prost-codec",
], optional = true } ], optional = true }
rand = "0.8.5" rand = "0.8.5"
reqwest = { version = "0.12.5", default-features = false, features = [ reqwest = { version = "0.12.7", default-features = false, features = [
"blocking", "blocking",
"gzip", "gzip",
"http2", "http2",
@ -120,10 +121,10 @@ surrealdb = { version = "2", path = "sdk", features = [
surrealdb-core = { version = "2", path = "core" } surrealdb-core = { version = "2", path = "core" }
tempfile = "3.8.1" tempfile = "3.8.1"
thiserror = "1.0.63" thiserror = "1.0.63"
tokio = { version = "1.34.0", features = ["macros", "signal"] } tokio = { version = "1.40.0", features = ["macros", "signal"] }
tokio-stream = "0.1" tokio-stream = "0.1"
tokio-tungstenite = "0.23.0" tokio-tungstenite = "0.23.1"
tokio-util = { version = "0.7.10", features = ["io"] } tokio-util = { version = "0.7.11", features = ["io"] }
tower = "0.4.13" tower = "0.4.13"
tower-http = { version = "0.5.2", features = [ tower-http = { version = "0.5.2", features = [
"trace", "trace",
@ -138,7 +139,7 @@ tower-http = { version = "0.5.2", features = [
"add-extension", "add-extension",
"compression-full", "compression-full",
] } ] }
tower-service = "0.3.2" tower-service = "0.3.3"
tracing = "0.1" tracing = "0.1"
tracing-opentelemetry = "0.25.0" tracing-opentelemetry = "0.25.0"
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] } tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
@ -172,7 +173,7 @@ serial_test = "2.0.0"
temp-env = { version = "0.3.6", features = ["async_closure"] } temp-env = { version = "0.3.6", features = ["async_closure"] }
test-log = { version = "0.2.13", features = ["trace"] } test-log = { version = "0.2.13", features = ["trace"] }
tokio-stream = { version = "0.1", features = ["net"] } tokio-stream = { version = "0.1", features = ["net"] }
tokio-tungstenite = { version = "0.23.0" } tokio-tungstenite = { version = "0.23.1" }
tonic = "0.12.1" tonic = "0.12.1"
ulid = "1.1.0" ulid = "1.1.0"
wiremock = "0.6.0" wiremock = "0.6.0"

View file

@ -184,6 +184,9 @@ allow_proc_macro = true
[pkg.axum-macros] [pkg.axum-macros]
allow_proc_macro = true allow_proc_macro = true
[pkg.axum-extra]
allow_apis = ["net"]
[pkg.serde_with_macros] [pkg.serde_with_macros]
allow_proc_macro = true allow_proc_macro = true
@ -437,6 +440,7 @@ allow_unsafe = true
[pkg.futures-util] [pkg.futures-util]
allow_unsafe = true allow_unsafe = true
allow_apis = ["net"]
[pkg.indexmap] [pkg.indexmap]
allow_unsafe = true allow_unsafe = true
@ -1161,7 +1165,7 @@ allow_unsafe = true
[pkg.static_assertions_next] [pkg.static_assertions_next]
allow_unsafe = true allow_unsafe = true
[pkg.surrealdb-async-graphql-axum] [pkg.async-graphql-axum]
allow_apis = ["net"] allow_apis = ["net"]
[pkg.futures-timer] [pkg.futures-timer]

View file

@ -30,6 +30,7 @@ kv-rocksdb = ["dep:rocksdb", "tokio/time", "dep:tempfile", "dep:ext-sort"]
kv-tikv = ["dep:tikv", "tokio/time", "dep:tempfile", "dep:ext-sort"] kv-tikv = ["dep:tikv", "tokio/time", "dep:tempfile", "dep:ext-sort"]
kv-fdb = ["dep:foundationdb", "tokio/time", "dep:tempfile", "dep:ext-sort"] kv-fdb = ["dep:foundationdb", "tokio/time", "dep:tempfile", "dep:ext-sort"]
kv-surrealkv = ["dep:surrealkv", "tokio/time", "dep:tempfile", "dep:ext-sort"] kv-surrealkv = ["dep:surrealkv", "tokio/time", "dep:tempfile", "dep:ext-sort"]
kv-surrealcs = ["dep:surrealcs", "tokio/time", "dep:tempfile", "dep:ext-sort"]
scripting = ["dep:js"] scripting = ["dep:js"]
http = ["dep:reqwest"] http = ["dep:reqwest"]
ml = ["dep:surrealml"] ml = ["dep:surrealml"]
@ -117,7 +118,7 @@ rand = "0.8.5"
reblessive = { version = "0.4.0", features = ["tree"] } reblessive = { version = "0.4.0", features = ["tree"] }
regex = "1.10.6" regex = "1.10.6"
regex-syntax = { version = "0.8.4", optional = true, features = ["arbitrary"] } regex-syntax = { version = "0.8.4", optional = true, features = ["arbitrary"] }
reqwest = { version = "0.12.5", default-features = false, features = [ reqwest = { version = "0.12.7", default-features = false, features = [
"json", "json",
"stream", "stream",
"multipart", "multipart",
@ -145,6 +146,7 @@ sha2 = "0.10.8"
snap = "1.1.0" snap = "1.1.0"
storekey = "0.5.0" storekey = "0.5.0"
subtle = "2.6" subtle = "2.6"
surrealcs = { version = "0.1.1", optional = true }
surrealkv = { version = "0.3.4", optional = true } surrealkv = { version = "0.3.4", optional = true }
surrealml = { version = "0.1.1", optional = true, package = "surrealml-core" } surrealml = { version = "0.1.1", optional = true, package = "surrealml-core" }
tempfile = { version = "3.10.1", optional = true } tempfile = { version = "3.10.1", optional = true }
@ -165,14 +167,14 @@ serial_test = "2.0.0"
temp-dir = "0.1.11" temp-dir = "0.1.11"
test-log = { version = "0.2.13", features = ["trace"] } test-log = { version = "0.2.13", features = ["trace"] }
time = { version = "0.3.36", features = ["serde"] } time = { version = "0.3.36", features = ["serde"] }
tokio = { version = "1.34.0", features = ["macros", "sync", "rt-multi-thread"] } tokio = { version = "1.40.0", features = ["macros", "sync", "rt-multi-thread"] }
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] } tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
wiremock = "0.6.0" wiremock = "0.6.0"
[target.'cfg(target_arch = "wasm32")'.dependencies] [target.'cfg(target_arch = "wasm32")'.dependencies]
pharos = "0.5.3" pharos = "0.5.3"
ring = { version = "0.17.7", features = ["wasm32_unknown_unknown_js"] } ring = { version = "0.17.7", features = ["wasm32_unknown_unknown_js"] }
tokio = { version = "1.34.0", default-features = false, features = [ tokio = { version = "1.40.0", default-features = false, features = [
"rt", "rt",
"sync", "sync",
] } ] }
@ -184,7 +186,7 @@ wasmtimer = { version = "0.2.0", default-features = false, features = [
ws_stream_wasm = "0.7.4" ws_stream_wasm = "0.7.4"
[target.'cfg(not(target_arch = "wasm32"))'.dependencies] [target.'cfg(not(target_arch = "wasm32"))'.dependencies]
tokio = { version = "1.34.0", default-features = false, features = [ tokio = { version = "1.40.0", default-features = false, features = [
"macros", "macros",
"io-util", "io-util",
"io-std", "io-std",

View file

@ -9,6 +9,7 @@ fn main() {
feature = "kv-tikv", feature = "kv-tikv",
feature = "kv-rocksdb", feature = "kv-rocksdb",
feature = "kv-surrealkv", feature = "kv-surrealkv",
feature = "kv-surrealcs",
)) { )) {
println!("cargo:rustc-cfg=storage"); println!("cargo:rustc-cfg=storage");
println!("cargo::rustc-check-cfg=cfg(storage)"); println!("cargo::rustc-check-cfg=cfg(storage)");

View file

@ -57,6 +57,7 @@ pub static INSECURE_FORWARD_ACCESS_ERRORS: Lazy<bool> =
feature = "kv-rocksdb", feature = "kv-rocksdb",
feature = "kv-fdb", feature = "kv-fdb",
feature = "kv-tikv", feature = "kv-tikv",
feature = "kv-surrealcs",
))] ))]
/// Specifies the buffer limit for external sorting. /// Specifies the buffer limit for external sorting.
pub static EXTERNAL_SORTING_BUFFER_LIMIT: Lazy<usize> = pub static EXTERNAL_SORTING_BUFFER_LIMIT: Lazy<usize> =

View file

@ -22,6 +22,7 @@ use std::fmt::{self, Debug};
feature = "kv-rocksdb", feature = "kv-rocksdb",
feature = "kv-fdb", feature = "kv-fdb",
feature = "kv-tikv", feature = "kv-tikv",
feature = "kv-surrealcs",
))] ))]
use std::path::PathBuf; use std::path::PathBuf;
use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::atomic::{AtomicBool, Ordering};
@ -76,6 +77,7 @@ pub struct MutableContext {
feature = "kv-rocksdb", feature = "kv-rocksdb",
feature = "kv-fdb", feature = "kv-fdb",
feature = "kv-tikv", feature = "kv-tikv",
feature = "kv-surrealcs",
))] ))]
// The temporary directory // The temporary directory
temporary_directory: Option<Arc<PathBuf>>, temporary_directory: Option<Arc<PathBuf>>,
@ -122,6 +124,7 @@ impl MutableContext {
feature = "kv-rocksdb", feature = "kv-rocksdb",
feature = "kv-fdb", feature = "kv-fdb",
feature = "kv-tikv", feature = "kv-tikv",
feature = "kv-surrealcs",
))] ))]
temporary_directory: Option<Arc<PathBuf>>, temporary_directory: Option<Arc<PathBuf>>,
) -> Result<MutableContext, Error> { ) -> Result<MutableContext, Error> {
@ -144,6 +147,7 @@ impl MutableContext {
feature = "kv-rocksdb", feature = "kv-rocksdb",
feature = "kv-fdb", feature = "kv-fdb",
feature = "kv-tikv", feature = "kv-tikv",
feature = "kv-surrealcs",
))] ))]
temporary_directory, temporary_directory,
transaction: None, transaction: None,
@ -175,6 +179,7 @@ impl MutableContext {
feature = "kv-rocksdb", feature = "kv-rocksdb",
feature = "kv-fdb", feature = "kv-fdb",
feature = "kv-tikv", feature = "kv-tikv",
feature = "kv-surrealcs",
))] ))]
temporary_directory: None, temporary_directory: None,
transaction: None, transaction: None,
@ -202,6 +207,7 @@ impl MutableContext {
feature = "kv-rocksdb", feature = "kv-rocksdb",
feature = "kv-fdb", feature = "kv-fdb",
feature = "kv-tikv", feature = "kv-tikv",
feature = "kv-surrealcs",
))] ))]
temporary_directory: parent.temporary_directory.clone(), temporary_directory: parent.temporary_directory.clone(),
transaction: parent.transaction.clone(), transaction: parent.transaction.clone(),
@ -409,6 +415,7 @@ impl MutableContext {
feature = "kv-rocksdb", feature = "kv-rocksdb",
feature = "kv-fdb", feature = "kv-fdb",
feature = "kv-tikv", feature = "kv-tikv",
feature = "kv-surrealcs",
))] ))]
/// Return the location of the temporary directory if any /// Return the location of the temporary directory if any
pub fn temporary_directory(&self) -> Option<&Arc<PathBuf>> { pub fn temporary_directory(&self) -> Option<&Arc<PathBuf>> {

View file

@ -307,6 +307,7 @@ impl Iterator {
feature = "kv-rocksdb", feature = "kv-rocksdb",
feature = "kv-fdb", feature = "kv-fdb",
feature = "kv-tikv", feature = "kv-tikv",
feature = "kv-surrealcs",
))] ))]
ctx, ctx,
stm, stm,

View file

@ -7,6 +7,7 @@ use crate::dbs::plan::Explanation;
feature = "kv-rocksdb", feature = "kv-rocksdb",
feature = "kv-fdb", feature = "kv-fdb",
feature = "kv-tikv", feature = "kv-tikv",
feature = "kv-surrealcs",
))] ))]
use crate::dbs::store::file_store::FileCollector; use crate::dbs::store::file_store::FileCollector;
use crate::dbs::store::MemoryCollector; use crate::dbs::store::MemoryCollector;
@ -24,6 +25,7 @@ pub(super) enum Results {
feature = "kv-rocksdb", feature = "kv-rocksdb",
feature = "kv-fdb", feature = "kv-fdb",
feature = "kv-tikv", feature = "kv-tikv",
feature = "kv-surrealcs",
))] ))]
File(Box<FileCollector>), File(Box<FileCollector>),
Groups(GroupsCollector), Groups(GroupsCollector),
@ -38,6 +40,7 @@ impl Results {
feature = "kv-rocksdb", feature = "kv-rocksdb",
feature = "kv-fdb", feature = "kv-fdb",
feature = "kv-tikv", feature = "kv-tikv",
feature = "kv-surrealcs",
))] ))]
ctx: &Context, ctx: &Context,
stm: &Statement<'_>, stm: &Statement<'_>,
@ -51,6 +54,7 @@ impl Results {
feature = "kv-rocksdb", feature = "kv-rocksdb",
feature = "kv-fdb", feature = "kv-fdb",
feature = "kv-tikv", feature = "kv-tikv",
feature = "kv-surrealcs",
))] ))]
if stm.tempfiles() { if stm.tempfiles() {
if let Some(temp_dir) = ctx.temporary_directory() { if let Some(temp_dir) = ctx.temporary_directory() {
@ -79,6 +83,7 @@ impl Results {
feature = "kv-rocksdb", feature = "kv-rocksdb",
feature = "kv-fdb", feature = "kv-fdb",
feature = "kv-tikv", feature = "kv-tikv",
feature = "kv-surrealcs",
))] ))]
Self::File(e) => { Self::File(e) => {
e.push(val)?; e.push(val)?;
@ -99,6 +104,7 @@ impl Results {
feature = "kv-rocksdb", feature = "kv-rocksdb",
feature = "kv-fdb", feature = "kv-fdb",
feature = "kv-tikv", feature = "kv-tikv",
feature = "kv-surrealcs",
))] ))]
Self::File(f) => f.sort(orders), Self::File(f) => f.sort(orders),
_ => {} _ => {}
@ -115,6 +121,7 @@ impl Results {
feature = "kv-rocksdb", feature = "kv-rocksdb",
feature = "kv-fdb", feature = "kv-fdb",
feature = "kv-tikv", feature = "kv-tikv",
feature = "kv-surrealcs",
))] ))]
Self::File(f) => f.start_limit(start, limit), Self::File(f) => f.start_limit(start, limit),
Self::Groups(_) => {} Self::Groups(_) => {}
@ -131,6 +138,7 @@ impl Results {
feature = "kv-rocksdb", feature = "kv-rocksdb",
feature = "kv-fdb", feature = "kv-fdb",
feature = "kv-tikv", feature = "kv-tikv",
feature = "kv-surrealcs",
))] ))]
Self::File(e) => e.len(), Self::File(e) => e.len(),
Self::Groups(g) => g.len(), Self::Groups(g) => g.len(),
@ -146,6 +154,7 @@ impl Results {
feature = "kv-rocksdb", feature = "kv-rocksdb",
feature = "kv-fdb", feature = "kv-fdb",
feature = "kv-tikv", feature = "kv-tikv",
feature = "kv-surrealcs",
))] ))]
Self::File(f) => f.take_vec()?, Self::File(f) => f.take_vec()?,
_ => vec![], _ => vec![],
@ -164,6 +173,7 @@ impl Results {
feature = "kv-rocksdb", feature = "kv-rocksdb",
feature = "kv-fdb", feature = "kv-fdb",
feature = "kv-tikv", feature = "kv-tikv",
feature = "kv-surrealcs",
))] ))]
Self::File(e) => { Self::File(e) => {
e.explain(exp); e.explain(exp);

View file

@ -252,6 +252,7 @@ impl<'a> Statement<'a> {
feature = "kv-rocksdb", feature = "kv-rocksdb",
feature = "kv-fdb", feature = "kv-fdb",
feature = "kv-tikv", feature = "kv-tikv",
feature = "kv-surrealcs",
))] ))]
pub fn tempfiles(&self) -> bool { pub fn tempfiles(&self) -> bool {
match self { match self {

View file

@ -59,6 +59,7 @@ impl From<Vec<Value>> for MemoryCollector {
feature = "kv-rocksdb", feature = "kv-rocksdb",
feature = "kv-fdb", feature = "kv-fdb",
feature = "kv-tikv", feature = "kv-tikv",
feature = "kv-surrealcs",
))] ))]
pub(super) mod file_store { pub(super) mod file_store {
use crate::cnf::EXTERNAL_SORTING_BUFFER_LIMIT; use crate::cnf::EXTERNAL_SORTING_BUFFER_LIMIT;

View file

@ -15,6 +15,7 @@ use bincode::Error as BincodeError;
feature = "kv-rocksdb", feature = "kv-rocksdb",
feature = "kv-fdb", feature = "kv-fdb",
feature = "kv-tikv", feature = "kv-tikv",
feature = "kv-surrealcs",
))] ))]
use ext_sort::SortError; use ext_sort::SortError;
use fst::Error as FstError; use fst::Error as FstError;
@ -1214,6 +1215,7 @@ impl From<reqwest::Error> for Error {
feature = "kv-rocksdb", feature = "kv-rocksdb",
feature = "kv-fdb", feature = "kv-fdb",
feature = "kv-tikv", feature = "kv-tikv",
feature = "kv-surrealcs",
))] ))]
impl<S, D, I> From<SortError<S, D, I>> for Error impl<S, D, I> From<SortError<S, D, I>> for Error
where where

View file

@ -33,6 +33,7 @@ use std::fmt;
feature = "kv-rocksdb", feature = "kv-rocksdb",
feature = "kv-fdb", feature = "kv-fdb",
feature = "kv-tikv", feature = "kv-tikv",
feature = "kv-surrealcs",
))] ))]
use std::path::PathBuf; use std::path::PathBuf;
use std::sync::Arc; use std::sync::Arc;
@ -88,6 +89,7 @@ pub struct Datastore {
feature = "kv-rocksdb", feature = "kv-rocksdb",
feature = "kv-fdb", feature = "kv-fdb",
feature = "kv-tikv", feature = "kv-tikv",
feature = "kv-surrealcs",
))] ))]
// The temporary directory // The temporary directory
temporary_directory: Option<Arc<PathBuf>>, temporary_directory: Option<Arc<PathBuf>>,
@ -153,6 +155,11 @@ impl TransactionFactory {
let tx = v.transaction(write, lock).await?; let tx = v.transaction(write, lock).await?;
super::tr::Inner::SurrealKV(tx) super::tr::Inner::SurrealKV(tx)
} }
#[cfg(feature = "kv-surrealcs")]
DatastoreFlavor::SurrealCS(v) => {
let tx = v.transaction(write, lock).await?;
super::tr::Inner::SurrealCS(tx)
}
#[allow(unreachable_patterns)] #[allow(unreachable_patterns)]
_ => unreachable!(), _ => unreachable!(),
}; };
@ -179,6 +186,8 @@ pub(super) enum DatastoreFlavor {
FoundationDB(super::fdb::Datastore), FoundationDB(super::fdb::Datastore),
#[cfg(feature = "kv-surrealkv")] #[cfg(feature = "kv-surrealkv")]
SurrealKV(super::surrealkv::Datastore), SurrealKV(super::surrealkv::Datastore),
#[cfg(feature = "kv-surrealcs")]
SurrealCS(super::surrealcs::Datastore),
} }
impl fmt::Display for Datastore { impl fmt::Display for Datastore {
@ -197,6 +206,8 @@ impl fmt::Display for Datastore {
DatastoreFlavor::FoundationDB(_) => write!(f, "fdb"), DatastoreFlavor::FoundationDB(_) => write!(f, "fdb"),
#[cfg(feature = "kv-surrealkv")] #[cfg(feature = "kv-surrealkv")]
DatastoreFlavor::SurrealKV(_) => write!(f, "surrealkv"), DatastoreFlavor::SurrealKV(_) => write!(f, "surrealkv"),
#[cfg(feature = "kv-surrealcs")]
DatastoreFlavor::SurrealCS(_) => write!(f, "surrealcs"),
#[allow(unreachable_patterns)] #[allow(unreachable_patterns)]
_ => unreachable!(), _ => unreachable!(),
} }
@ -325,6 +336,38 @@ impl Datastore {
#[cfg(not(feature = "kv-rocksdb"))] #[cfg(not(feature = "kv-rocksdb"))]
return Err(Error::Ds("Cannot connect to the `rocksdb` storage engine as it is not enabled in this build of SurrealDB".to_owned())); return Err(Error::Ds("Cannot connect to the `rocksdb` storage engine as it is not enabled in this build of SurrealDB".to_owned()));
} }
// Parse and initiate a SurrealKV datastore
s if s.starts_with("surrealkv:") => {
#[cfg(feature = "kv-surrealkv")]
{
info!(target: TARGET, "Starting kvs store at {}", path);
let s = s.trim_start_matches("surrealkv://");
let s = s.trim_start_matches("surrealkv:");
let v =
super::surrealkv::Datastore::new(s).await.map(DatastoreFlavor::SurrealKV);
let c = clock.unwrap_or_else(|| Arc::new(SizedClock::system()));
info!(target: TARGET, "Started kvs store at {}", path);
Ok((v, c))
}
#[cfg(not(feature = "kv-surrealkv"))]
return Err(Error::Ds("Cannot connect to the `surrealkv` storage engine as it is not enabled in this build of SurrealDB".to_owned()));
}
// Parse and initiate a SurrealCS datastore
s if s.starts_with("surrealcs:") => {
#[cfg(feature = "kv-surrealcs")]
{
info!(target: TARGET, "Starting kvs store at {}", path);
let s = s.trim_start_matches("surrealcs://");
let s = s.trim_start_matches("surrealcs:");
let v =
super::surrealcs::Datastore::new(s).await.map(DatastoreFlavor::SurrealCS);
let c = clock.unwrap_or_else(|| Arc::new(SizedClock::system()));
info!(target: TARGET, "Started kvs store at {}", path);
Ok((v, c))
}
#[cfg(not(feature = "kv-surrealcs"))]
return Err(Error::Ds("Cannot connect to the `surrealcs` storage engine as it is not enabled in this build of SurrealDB".to_owned()));
}
// Parse and initiate an IndxDB database // Parse and initiate an IndxDB database
s if s.starts_with("indxdb:") => { s if s.starts_with("indxdb:") => {
#[cfg(feature = "kv-indxdb")] #[cfg(feature = "kv-indxdb")]
@ -369,22 +412,6 @@ impl Datastore {
} }
#[cfg(not(feature = "kv-fdb"))] #[cfg(not(feature = "kv-fdb"))]
return Err(Error::Ds("Cannot connect to the `foundationdb` storage engine as it is not enabled in this build of SurrealDB".to_owned())); return Err(Error::Ds("Cannot connect to the `foundationdb` storage engine as it is not enabled in this build of SurrealDB".to_owned()));
}
// Parse and initiate a SurrealKV datastore
s if s.starts_with("surrealkv:") => {
#[cfg(feature = "kv-surrealkv")]
{
info!(target: TARGET, "Starting kvs store at {}", path);
let s = s.trim_start_matches("surrealkv://");
let s = s.trim_start_matches("surrealkv:");
let v =
super::surrealkv::Datastore::new(s).await.map(DatastoreFlavor::SurrealKV);
let c = clock.unwrap_or_else(|| Arc::new(SizedClock::system()));
info!(target: TARGET, "Started to kvs store at {}", path);
Ok((v, c))
}
#[cfg(not(feature = "kv-surrealkv"))]
return Err(Error::Ds("Cannot connect to the `surrealkv` storage engine as it is not enabled in this build of SurrealDB".to_owned()));
} }
// The datastore path is not valid // The datastore path is not valid
_ => { _ => {
@ -418,6 +445,7 @@ impl Datastore {
feature = "kv-rocksdb", feature = "kv-rocksdb",
feature = "kv-fdb", feature = "kv-fdb",
feature = "kv-tikv", feature = "kv-tikv",
feature = "kv-surrealcs",
))] ))]
temporary_directory: None, temporary_directory: None,
} }
@ -472,6 +500,7 @@ impl Datastore {
feature = "kv-rocksdb", feature = "kv-rocksdb",
feature = "kv-fdb", feature = "kv-fdb",
feature = "kv-tikv", feature = "kv-tikv",
feature = "kv-surrealcs",
))] ))]
/// Set a temporary directory for ordering of large result sets /// Set a temporary directory for ordering of large result sets
pub fn with_temporary_directory(mut self, path: Option<PathBuf>) -> Self { pub fn with_temporary_directory(mut self, path: Option<PathBuf>) -> Self {
@ -833,6 +862,7 @@ impl Datastore {
feature = "kv-rocksdb", feature = "kv-rocksdb",
feature = "kv-fdb", feature = "kv-fdb",
feature = "kv-tikv", feature = "kv-tikv",
feature = "kv-surrealcs",
))] ))]
self.temporary_directory.clone(), self.temporary_directory.clone(),
)?; )?;

View file

@ -31,6 +31,7 @@ mod indxdb;
mod kv; mod kv;
mod mem; mod mem;
mod rocksdb; mod rocksdb;
mod surrealcs;
mod surrealkv; mod surrealkv;
mod tikv; mod tikv;

View file

@ -0,0 +1,426 @@
#![cfg(feature = "kv-surrealcs")]
use crate::err::Error;
use crate::key::debug::Sprintable;
use crate::kvs::Check;
use crate::kvs::Key;
use crate::kvs::Val;
use futures::lock::Mutex;
use std::fmt::Debug;
use std::ops::Range;
use std::sync::Arc;
use surrealcs::kernel::messages::server::interface::ServerTransactionMessage;
use surrealcs::kernel::messages::server::kv_operations::*;
use surrealcs::router::create_connection_pool;
use surrealcs::transactions::interface::bridge::BridgeHandle;
use surrealcs::transactions::interface::interface::{
Any as AnyState, Transaction as SurrealCSTransaction,
};
/// The main struct that is used to interact with the database.
#[derive(Clone)]
#[non_exhaustive]
pub struct Datastore {}
#[non_exhaustive]
pub struct Transaction {
/// Is the transaction complete?
done: bool,
/// Is the transaction writeable?
write: bool,
/// Should we check unhandled transactions?
check: Check,
/// Has the transaction been started?
started: bool,
/// The underlying datastore transaction
inner: Arc<Mutex<SurrealCSTransaction<AnyState>>>,
}
impl Drop for Transaction {
fn drop(&mut self) {
if !self.done && self.write {
// Check if already panicking
if std::thread::panicking() {
return;
}
// Handle the behaviour
match self.check {
Check::None => {
trace!("A transaction was dropped without being committed or cancelled");
}
Check::Warn => {
warn!("A transaction was dropped without being committed or cancelled");
}
Check::Panic => {
#[cfg(debug_assertions)]
{
let backtrace = std::backtrace::Backtrace::force_capture();
if let std::backtrace::BacktraceStatus::Captured = backtrace.status() {
println!("{}", backtrace);
}
}
panic!("A transaction was dropped without being committed or cancelled");
}
}
}
}
}
impl Datastore {
/// Open a new database
pub(crate) async fn new(path: &str) -> Result<Datastore, Error> {
create_connection_pool(path, None).await.unwrap();
Ok(Datastore {})
}
/// Starts a new transaction.
///
/// # Arguments
/// * `write`: is the transaction writable
///
/// # Returns
/// the transaction
pub(crate) async fn transaction(&self, write: bool, _: bool) -> Result<Transaction, Error> {
let transaction = SurrealCSTransaction::new().await;
let transaction = transaction.map_err(|e| Error::Ds(e.to_string()))?;
let transaction = transaction.into_any();
Ok(Transaction {
done: false,
check: Check::Warn,
write,
started: false,
inner: Arc::new(Mutex::new(transaction)),
})
}
}
impl Transaction {
/// Sends a message to the SurrealCS server.
///
/// # Arguments
/// * `message`: the message to be sent to the server
///
/// # Returns
/// the response from the server
async fn send_message(
&mut self,
message: ServerTransactionMessage,
) -> Result<ServerTransactionMessage, Error> {
let mut transaction = self.inner.lock().await;
// Check to see if this transaction is started
let started = self.started;
// For any future calls, this transaction is started
self.started = true;
// If this is the first message to SurrealCS then
// we need to start a transaction, by creating the
// actor, and send the message with the request.
let response = match started {
false => transaction.begin::<BridgeHandle>(message).await,
true => transaction.send::<BridgeHandle>(message).await,
};
// Return the result
response.map_err(|e| Error::Tx(e.to_string()))
}
}
impl super::api::Transaction for Transaction {
/// Behaviour if unclosed
fn check_level(&mut self, check: Check) {
self.check = check;
}
/// Check if closed
fn closed(&self) -> bool {
self.done
}
/// Check if writeable
fn writeable(&self) -> bool {
self.write
}
/// Cancels the transaction.
#[instrument(level = "trace", target = "surrealdb::core::kvs::api", skip(self))]
async fn cancel(&mut self) -> Result<(), Error> {
// Check to see if transaction is closed
if self.done {
return Err(Error::TxFinished);
}
// Mark this transaction as done
self.done = true;
// Cancel this transaction
let mut transaction = self.inner.lock().await;
transaction.rollback::<BridgeHandle>().await.map_err(|e| Error::Tx(e.to_string()))?;
// Continue
Ok(())
}
/// Commits the transaction.
#[instrument(level = "trace", target = "surrealdb::core::kvs::api", skip(self))]
async fn commit(&mut self) -> Result<(), Error> {
// Check to see if transaction is closed
if self.done {
return Err(Error::TxFinished);
}
// Check to see if transaction is writable
if !self.write {
return Err(Error::TxReadonly);
}
// Mark the transaction as done.
self.done = true;
// Commit the transaction
let mut transaction = self.inner.lock().await;
transaction.empty_commit::<BridgeHandle>().await.map_err(|e| Error::Tx(e.to_string()))?;
// Continue
Ok(())
}
/// Checks if a key exists in the database.
#[instrument(level = "trace", target = "surrealdb::core::kvs::api", skip(self), fields(key = key.sprint()))]
async fn exists<K>(&mut self, key: K) -> Result<bool, Error>
where
K: Into<Key> + Sprintable + Debug,
{
// Check to see if transaction is closed
if self.done {
return Err(Error::TxFinished);
}
// Check the key
let message = ServerTransactionMessage::Exists(MessageExists {
key: key.into(),
});
let response = match self.send_message(message).await? {
ServerTransactionMessage::ResponseExists(v) => v,
_ => return Err(Error::Tx("Received an invalid response".to_string())),
};
// Return result
Ok(response)
}
/// Fetch a key from the database
#[instrument(level = "trace", target = "surrealdb::core::kvs::api", skip(self), fields(key = key.sprint()))]
async fn get<K>(&mut self, key: K, version: Option<u64>) -> Result<Option<Val>, Error>
where
K: Into<Key> + Sprintable + Debug,
{
// Check to see if transaction is closed
if self.done {
return Err(Error::TxFinished);
}
// Fetch the value from the database.
let message = ServerTransactionMessage::Get(MessageGet {
key: key.into(),
});
let response = match self.send_message(message).await? {
ServerTransactionMessage::ResponseGet(v) => v,
_ => return Err(Error::Tx("Received an invalid response".to_string())),
};
// Return result
Ok(response.value)
}
/// Insert or update a key in the database
#[instrument(level = "trace", target = "surrealdb::core::kvs::api", skip(self), fields(key = key.sprint()))]
async fn set<K, V>(&mut self, key: K, val: V, version: Option<u64>) -> Result<(), Error>
where
K: Into<Key> + Sprintable + Debug,
V: Into<Val> + Debug,
{
// Check to see if transaction is closed
if self.done {
return Err(Error::TxFinished);
}
// Check to see if transaction is writable
if !self.write {
return Err(Error::TxReadonly);
}
// Set the key
let message = ServerTransactionMessage::Set(MessageSet {
key: key.into(),
value: val.into(),
});
self.send_message(message).await?;
// Return result
Ok(())
}
/// Insert a key if it doesn't exist in the database
#[instrument(level = "trace", target = "surrealdb::core::kvs::api", skip(self), fields(key = key.sprint()))]
async fn put<K, V>(&mut self, key: K, val: V, version: Option<u64>) -> Result<(), Error>
where
K: Into<Key> + Sprintable + Debug,
V: Into<Val> + Debug,
{
// Check to see if transaction is closed
if self.done {
return Err(Error::TxFinished);
}
// Check to see if transaction is writable
if !self.write {
return Err(Error::TxReadonly);
}
// Put the key
let message = ServerTransactionMessage::Put(MessagePut {
key: key.into(),
value: val.into(),
});
self.send_message(message).await?;
// Return result
Ok(())
}
/// Insert a key if the current value matches a condition
#[instrument(level = "trace", target = "surrealdb::core::kvs::api", skip(self), fields(key = key.sprint()))]
async fn putc<K, V>(&mut self, key: K, val: V, chk: Option<V>) -> Result<(), Error>
where
K: Into<Key> + Sprintable + Debug,
V: Into<Val> + Debug,
{
// Check to see if transaction is closed
if self.done {
return Err(Error::TxFinished);
}
// Check to see if transaction is writable
if !self.write {
return Err(Error::TxReadonly);
}
// Get the arguments
let chk = chk.map(Into::into);
// Set the key if valid
let message = ServerTransactionMessage::Putc(MessagePutc {
key: key.into(),
value: val.into(),
expected_value: chk,
});
self.send_message(message).await?;
// Return result
Ok(())
}
/// Deletes a key from the database.
#[instrument(level = "trace", target = "surrealdb::core::kvs::api", skip(self), fields(key = key.sprint()))]
async fn del<K>(&mut self, key: K) -> Result<(), Error>
where
K: Into<Key> + Sprintable + Debug,
{
// Check to see if transaction is closed
if self.done {
return Err(Error::TxFinished);
}
// Check to see if transaction is writable
if !self.write {
return Err(Error::TxReadonly);
}
// Remove the key
let message = ServerTransactionMessage::Del(MessageDel {
key: key.into(),
});
self.send_message(message).await?;
// Return result
Ok(())
}
/// Delete a key if the current value matches a condition
#[instrument(level = "trace", target = "surrealdb::core::kvs::api", skip(self), fields(key = key.sprint()))]
async fn delc<K, V>(&mut self, key: K, chk: Option<V>) -> Result<(), Error>
where
K: Into<Key> + Sprintable + Debug,
V: Into<Val> + Debug,
{
// Check to see if transaction is closed
if self.done {
return Err(Error::TxFinished);
}
// Check to see if transaction is writable
if !self.write {
return Err(Error::TxReadonly);
}
// Get the arguments
let chk = chk.map(Into::into);
// Delete the key if valid
let message = ServerTransactionMessage::Delc(MessageDelc {
key: key.into(),
expected_value: chk,
});
self.send_message(message).await?;
// Return result
Ok(())
}
/// Delete a range of keys from the database.
#[instrument(level = "trace", target = "surrealdb::core::kvs::api", skip(self), fields(rng = rng.sprint()))]
async fn delr<K>(&mut self, rng: Range<K>) -> Result<(), Error>
where
K: Into<Key> + Sprintable + Debug,
{
// Check to see if transaction is closed
if self.done {
return Err(Error::TxFinished);
}
// Check to see if transaction is writable
if !self.write {
return Err(Error::TxReadonly);
}
// Delete the scan range
let message = ServerTransactionMessage::Delr(MessageDelr {
begin: rng.start.into(),
finish: rng.end.into(),
});
self.send_message(message).await?;
// Return result
Ok(())
}
/// Retrieves a range of key-value pairs from the database.
#[instrument(level = "trace", target = "surrealdb::core::kvs::api", skip(self), fields(rng = rng.sprint()))]
async fn keys<K>(&mut self, rng: Range<K>, limit: u32) -> Result<Vec<Key>, Error>
where
K: Into<Key> + Sprintable + Debug,
{
// Check to see if transaction is closed
if self.done {
return Err(Error::TxFinished);
}
// Retrieve the scan range
let message = ServerTransactionMessage::Keys(MessageKeys {
begin: rng.start.into(),
finish: rng.end.into(),
limit,
});
let response = match self.send_message(message).await? {
ServerTransactionMessage::ResponseKeys(v) => v,
_ => return Err(Error::Tx("Received an invalid response".to_string())),
};
// Return result
Ok(response.keys)
}
/// Retrieves a range of key-value pairs from the database.
#[instrument(level = "trace", target = "surrealdb::core::kvs::api", skip(self), fields(rng = rng.sprint()))]
async fn scan<K>(
&mut self,
rng: Range<K>,
limit: u32,
version: Option<u64>,
) -> Result<Vec<(Key, Val)>, Error>
where
K: Into<Key> + Sprintable + Debug,
{
// Check to see if transaction is closed
if self.done {
return Err(Error::TxFinished);
}
// Retrieve the scan range
let message = ServerTransactionMessage::Scan(MessageScan {
begin: rng.start.into(),
finish: rng.end.into(),
limit,
});
let response = match self.send_message(message).await? {
ServerTransactionMessage::ResponseScan(v) => v,
_ => return Err(Error::Tx("Received an invalid response".to_string())),
};
// Return result
Ok(response.values)
}
}

View file

@ -4,7 +4,8 @@
feature = "kv-indxdb", feature = "kv-indxdb",
feature = "kv-tikv", feature = "kv-tikv",
feature = "kv-fdb", feature = "kv-fdb",
feature = "kv-surrealkv" feature = "kv-surrealkv",
feature = "kv-surrealcs",
))] ))]
use crate::kvs::clock::SizedClock; use crate::kvs::clock::SizedClock;

View file

@ -86,6 +86,8 @@ pub(super) enum Inner {
FoundationDB(super::fdb::Transaction), FoundationDB(super::fdb::Transaction),
#[cfg(feature = "kv-surrealkv")] #[cfg(feature = "kv-surrealkv")]
SurrealKV(super::surrealkv::Transaction), SurrealKV(super::surrealkv::Transaction),
#[cfg(feature = "kv-surrealcs")]
SurrealCS(super::surrealcs::Transaction),
} }
impl fmt::Display for Transactor { impl fmt::Display for Transactor {
@ -104,6 +106,8 @@ impl fmt::Display for Transactor {
Inner::FoundationDB(_) => write!(f, "fdb"), Inner::FoundationDB(_) => write!(f, "fdb"),
#[cfg(feature = "kv-surrealkv")] #[cfg(feature = "kv-surrealkv")]
Inner::SurrealKV(_) => write!(f, "surrealkv"), Inner::SurrealKV(_) => write!(f, "surrealkv"),
#[cfg(feature = "kv-surrealcs")]
Inner::SurrealCS(_) => write!(f, "surrealcs"),
#[allow(unreachable_patterns)] #[allow(unreachable_patterns)]
_ => unreachable!(), _ => unreachable!(),
} }
@ -125,6 +129,8 @@ macro_rules! expand_inner {
Inner::FoundationDB($arm) => $b, Inner::FoundationDB($arm) => $b,
#[cfg(feature = "kv-surrealkv")] #[cfg(feature = "kv-surrealkv")]
Inner::SurrealKV($arm) => $b, Inner::SurrealKV($arm) => $b,
#[cfg(feature = "kv-surrealcs")]
Inner::SurrealCS($arm) => $b,
#[allow(unreachable_patterns)] #[allow(unreachable_patterns)]
_ => { _ => {
unreachable!(); unreachable!();

View file

@ -105,6 +105,10 @@ allow = ["BUSL-1.1"]
name = "surrealdb" name = "surrealdb"
allow = ["BUSL-1.1"] allow = ["BUSL-1.1"]
[[licenses.exceptions]]
name = "surrealcs"
allow = ["BUSL-1.1"]
[[licenses.exceptions]] [[licenses.exceptions]]
name = "surrealdb-core" name = "surrealdb-core"
allow = ["BUSL-1.1"] allow = ["BUSL-1.1"]
@ -113,6 +117,10 @@ allow = ["BUSL-1.1"]
name = "surrealml-core" name = "surrealml-core"
allow = ["Apache-2.0"] allow = ["Apache-2.0"]
[[licenses.exceptions]]
name = "surrealcs-kernel"
allow = ["BUSL-1.1"]
[[licenses.exceptions]] [[licenses.exceptions]]
name = "unicode-ident" name = "unicode-ident"
allow = ["Unicode-DFS-2016"] allow = ["Unicode-DFS-2016"]

View file

@ -32,6 +32,7 @@ kv-rocksdb = ["surrealdb-core/kv-rocksdb", "tokio/time"]
kv-tikv = ["surrealdb-core/kv-tikv", "tokio/time"] kv-tikv = ["surrealdb-core/kv-tikv", "tokio/time"]
kv-fdb = ["surrealdb-core/kv-fdb", "tokio/time"] kv-fdb = ["surrealdb-core/kv-fdb", "tokio/time"]
kv-surrealkv = ["surrealdb-core/kv-surrealkv", "tokio/time"] kv-surrealkv = ["surrealdb-core/kv-surrealkv", "tokio/time"]
kv-surrealcs = ["surrealdb-core/kv-surrealcs", "tokio/time"]
scripting = ["surrealdb-core/scripting"] scripting = ["surrealdb-core/scripting"]
http = ["surrealdb-core/http"] http = ["surrealdb-core/http"]
native-tls = [ native-tls = [
@ -70,13 +71,13 @@ bincode = "1.3.3"
channel = { version = "1.9.0", package = "async-channel" } channel = { version = "1.9.0", package = "async-channel" }
chrono = { version = "0.4.38", features = ["serde"] } chrono = { version = "0.4.38", features = ["serde"] }
dmp = "0.2.0" dmp = "0.2.0"
futures = "0.3.29" futures = "0.3.30"
geo = { version = "0.28.0", features = ["use-serde"] } geo = { version = "0.28.0", features = ["use-serde"] }
indexmap = { version = "2.1.0", features = ["serde"] } indexmap = { version = "2.1.0", features = ["serde"] }
native-tls = { version = "0.2.11", optional = true } native-tls = { version = "0.2.11", optional = true }
once_cell = "1.18.0" once_cell = "1.18.0"
path-clean = "1.0.1" path-clean = "1.0.1"
reqwest = { version = "0.12.5", default-features = false, features = [ reqwest = { version = "0.12.7", default-features = false, features = [
"json", "json",
"multipart", "multipart",
"stream", "stream",
@ -105,7 +106,7 @@ serde_json = "1.0.127"
serde-content = "0.1.0" serde-content = "0.1.0"
surrealdb-core = { version = "2", default-features = false, path = "../core", package = "surrealdb-core" } surrealdb-core = { version = "2", default-features = false, path = "../core", package = "surrealdb-core" }
thiserror = "1.0.63" thiserror = "1.0.63"
tokio-util = { version = "0.7.10", optional = true, features = ["compat"] } tokio-util = { version = "0.7.11", optional = true, features = ["compat"] }
tracing = "0.1.40" tracing = "0.1.40"
trice = { version = "0.4.0", optional = true } trice = { version = "0.4.0", optional = true }
url = "2.5.0" url = "2.5.0"
@ -124,7 +125,7 @@ serial_test = "2.0.0"
temp-dir = "0.1.11" temp-dir = "0.1.11"
test-log = { version = "0.2.13", features = ["trace"] } test-log = { version = "0.2.13", features = ["trace"] }
time = { version = "0.3.36", features = ["serde"] } time = { version = "0.3.36", features = ["serde"] }
tokio = { version = "1.34.0", features = ["macros", "sync", "rt-multi-thread"] } tokio = { version = "1.40.0", features = ["macros", "sync", "rt-multi-thread"] }
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] } tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
ulid = { version = "1.1.0", features = ["serde"] } ulid = { version = "1.1.0", features = ["serde"] }
wiremock = "0.6.0" wiremock = "0.6.0"
@ -132,7 +133,7 @@ wiremock = "0.6.0"
[target.'cfg(target_arch = "wasm32")'.dependencies] [target.'cfg(target_arch = "wasm32")'.dependencies]
pharos = "0.5.3" pharos = "0.5.3"
ring = { version = "0.17.7", features = ["wasm32_unknown_unknown_js"] } ring = { version = "0.17.7", features = ["wasm32_unknown_unknown_js"] }
tokio = { version = "1.34.0", default-features = false, features = [ tokio = { version = "1.40.0", default-features = false, features = [
"rt", "rt",
"sync", "sync",
] } ] }
@ -144,7 +145,7 @@ wasmtimer = { version = "0.2.0", default-features = false, features = [
ws_stream_wasm = "0.7.4" ws_stream_wasm = "0.7.4"
[target.'cfg(not(target_arch = "wasm32"))'.dependencies] [target.'cfg(not(target_arch = "wasm32"))'.dependencies]
tokio = { version = "1.34.0", default-features = false, features = [ tokio = { version = "1.40.0", default-features = false, features = [
"macros", "macros",
"io-util", "io-util",
"io-std", "io-std",

View file

@ -1,7 +1,7 @@
use criterion::{Criterion, Throughput}; use criterion::{Criterion, Throughput};
use std::sync::{Arc, OnceLock}; use std::sync::{Arc, OnceLock};
use std::time::Duration; use std::time::Duration;
#[cfg(any(feature = "kv-rocksdb", feature = "kv-fdb", feature = "kv-surrealkv"))] #[cfg(any(feature = "kv-rocksdb", feature = "kv-surrealkv"))]
use surrealdb::dbs::Session; use surrealdb::dbs::Session;
use surrealdb::kvs::Datastore; use surrealdb::kvs::Datastore;

View file

@ -9,6 +9,7 @@ fn main() {
feature = "kv-tikv", feature = "kv-tikv",
feature = "kv-rocksdb", feature = "kv-rocksdb",
feature = "kv-surrealkv", feature = "kv-surrealkv",
feature = "kv-surrealcs",
)) { )) {
println!("cargo:rustc-cfg=storage"); println!("cargo:rustc-cfg=storage");
println!("cargo::rustc-check-cfg=cfg(storage)"); println!("cargo::rustc-check-cfg=cfg(storage)");

View file

@ -5,8 +5,8 @@ edition = "2021"
publish = false publish = false
[dependencies] [dependencies]
axum = "0.7.2" axum = "0.7.5"
serde = { version = "1.0.209", features = ["derive"] } serde = { version = "1.0.209", features = ["derive"] }
surrealdb = { path = "../.." ,features = ["kv-mem"]} surrealdb = { path = "../.." ,features = ["kv-mem"]}
thiserror = "1.0.63" thiserror = "1.0.63"
tokio = { version = "1.34.0", features = ["macros", "rt-multi-thread"] } tokio = { version = "1.40.0", features = ["macros", "rt-multi-thread"] }

View file

@ -5,7 +5,7 @@ edition = "2021"
publish = false publish = false
[dependencies] [dependencies]
rocket = { version = "0.5.0", features = ["json"] } rocket = { version = "0.5.1", features = ["json"] }
surrealdb = { path = "../..", features = ["kv-mem"]} surrealdb = { path = "../..", features = ["kv-mem"]}
serde_json = "1.0.127" serde_json = "1.0.127"
thiserror = "1.0.63" thiserror = "1.0.63"

View file

@ -124,6 +124,22 @@ impl Connection for Any {
.into()); .into());
} }
EndpointKind::SurrealCS => {
#[cfg(feature = "kv-surrealcs")]
{
features.insert(ExtraFeatures::Backup);
features.insert(ExtraFeatures::LiveQueries);
tokio::spawn(engine::local::native::run_router(address, conn_tx, route_rx));
conn_rx.recv().await??
}
#[cfg(not(feature = "kv-surrealcs"))]
return Err(DbError::Ds(
"Cannot connect to the `surrealcs` storage engine as it is not enabled in this build of SurrealDB".to_owned(),
)
.into());
}
EndpointKind::Http | EndpointKind::Https => { EndpointKind::Http | EndpointKind::Https => {
#[cfg(feature = "protocol-http")] #[cfg(feature = "protocol-http")]
{ {

View file

@ -106,6 +106,21 @@ impl Connection for Any {
.into()); .into());
} }
EndpointKind::SurrealCS => {
#[cfg(feature = "kv-surrealcs")]
{
features.insert(ExtraFeatures::LiveQueries);
spawn_local(engine::local::wasm::run_router(address, conn_tx, route_rx));
conn_rx.recv().await??;
}
#[cfg(not(feature = "kv-surrealcs"))]
return Err(DbError::Ds(
"Cannot connect to the `surrealcs` storage engine as it is not enabled in this build of SurrealDB".to_owned(),
)
.into());
}
EndpointKind::TiKv => { EndpointKind::TiKv => {
#[cfg(feature = "kv-tikv")] #[cfg(feature = "kv-tikv")]
{ {

View file

@ -356,6 +356,42 @@ pub struct FDb;
#[derive(Debug)] #[derive(Debug)]
pub struct SurrealKV; pub struct SurrealKV;
/// SurrealCS database
///
/// # Examples
///
/// Instantiating a SurrealCS-backed instance
///
/// ```no_run
/// # #[tokio::main]
/// # async fn main() -> surrealdb::Result<()> {
/// use surrealdb::Surreal;
/// use surrealdb::engine::local::SurrealCS;
///
/// let db = Surreal::new::<SurrealCS>("path/to/database-folder").await?;
/// # Ok(())
/// # }
/// ```
///
/// Instantiating a SurrealCS-backed strict instance
///
/// ```no_run
/// # #[tokio::main]
/// # async fn main() -> surrealdb::Result<()> {
/// use surrealdb::opt::Config;
/// use surrealdb::Surreal;
/// use surrealdb::engine::local::SurrealCS;
///
/// let config = Config::default().strict();
/// let db = Surreal::new::<SurrealCS>(("path/to/database-folder", config)).await?;
/// # Ok(())
/// # }
/// ```
#[cfg(feature = "kv-surrealcs")]
#[cfg_attr(docsrs, doc(cfg(feature = "kv-surrealcs")))]
#[derive(Debug)]
pub struct SurrealCS;
/// An embedded database /// An embedded database
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct Db(()); pub struct Db(());

View file

@ -114,6 +114,7 @@ pub(crate) async fn run_router(
feature = "kv-rocksdb", feature = "kv-rocksdb",
feature = "kv-fdb", feature = "kv-fdb",
feature = "kv-tikv", feature = "kv-tikv",
feature = "kv-surrealcs",
))] ))]
let kvs = kvs.with_temporary_directory(address.config.temporary_directory); let kvs = kvs.with_temporary_directory(address.config.temporary_directory);

View file

@ -8,6 +8,7 @@ pub mod any;
feature = "kv-fdb", feature = "kv-fdb",
feature = "kv-indxdb", feature = "kv-indxdb",
feature = "kv-surrealkv", feature = "kv-surrealkv",
feature = "kv-surrealcs",
))] ))]
pub mod local; pub mod local;
pub mod proto; pub mod proto;

View file

@ -5,6 +5,7 @@ use crate::opt::capabilities::Capabilities;
feature = "kv-rocksdb", feature = "kv-rocksdb",
feature = "kv-fdb", feature = "kv-fdb",
feature = "kv-tikv", feature = "kv-tikv",
feature = "kv-surrealcs",
))] ))]
use std::path::PathBuf; use std::path::PathBuf;
use std::time::Duration; use std::time::Duration;
@ -32,6 +33,7 @@ pub struct Config {
feature = "kv-rocksdb", feature = "kv-rocksdb",
feature = "kv-fdb", feature = "kv-fdb",
feature = "kv-tikv", feature = "kv-tikv",
feature = "kv-surrealcs",
))] ))]
pub(crate) temporary_directory: Option<PathBuf>, pub(crate) temporary_directory: Option<PathBuf>,
} }
@ -128,6 +130,7 @@ impl Config {
feature = "kv-rocksdb", feature = "kv-rocksdb",
feature = "kv-fdb", feature = "kv-fdb",
feature = "kv-tikv", feature = "kv-tikv",
feature = "kv-surrealcs",
))] ))]
pub fn temporary_directory(mut self, path: Option<PathBuf>) -> Self { pub fn temporary_directory(mut self, path: Option<PathBuf>) -> Self {
self.temporary_directory = path; self.temporary_directory = path;

View file

@ -11,6 +11,8 @@ mod indxdb;
mod mem; mod mem;
#[cfg(feature = "kv-rocksdb")] #[cfg(feature = "kv-rocksdb")]
mod rocksdb; mod rocksdb;
#[cfg(feature = "kv-surrealcs")]
mod surrealcs;
#[cfg(feature = "kv-surrealkv")] #[cfg(feature = "kv-surrealkv")]
mod surrealkv; mod surrealkv;
#[cfg(feature = "kv-tikv")] #[cfg(feature = "kv-tikv")]
@ -131,6 +133,7 @@ pub enum EndpointKind {
TiKv, TiKv,
Unsupported(String), Unsupported(String),
SurrealKV, SurrealKV,
SurrealCS,
} }
impl From<&str> for EndpointKind { impl From<&str> for EndpointKind {
@ -148,6 +151,7 @@ impl From<&str> for EndpointKind {
"rocksdb" => Self::RocksDb, "rocksdb" => Self::RocksDb,
"tikv" => Self::TiKv, "tikv" => Self::TiKv,
"surrealkv" => Self::SurrealKV, "surrealkv" => Self::SurrealKV,
"surrealcs" => Self::SurrealCS,
_ => Self::Unsupported(s.to_owned()), _ => Self::Unsupported(s.to_owned()),
} }
} }

View file

@ -0,0 +1,40 @@
use crate::api::engine::local::Db;
use crate::api::engine::local::SurrealCS;
use crate::api::opt::Config;
use crate::api::opt::Endpoint;
use crate::api::opt::IntoEndpoint;
use crate::api::Result;
use std::path::Path;
use std::path::PathBuf;
use url::Url;
macro_rules! endpoints {
($($name:ty),*) => {
$(
impl IntoEndpoint<SurrealCS> for $name {
type Client = Db;
fn into_endpoint(self) -> Result<Endpoint> {
let protocol = "surrealcs://";
let url = Url::parse(protocol)
.unwrap_or_else(|_| unreachable!("`{protocol}` should be static and valid"));
let mut endpoint = Endpoint::new(url);
endpoint.path = super::path_to_string(protocol, self);
Ok(endpoint)
}
}
impl IntoEndpoint<SurrealCS> for ($name, Config) {
type Client = Db;
fn into_endpoint(self) -> Result<Endpoint> {
let mut endpoint = IntoEndpoint::<SurrealCS>::into_endpoint(self.0)?;
endpoint.config = self.1;
Ok(endpoint)
}
}
)*
}
}
endpoints!(&str, &String, String, &Path, PathBuf);

View file

@ -15,6 +15,7 @@ pub(crate) fn path_valid(v: &str) -> Result<String, String> {
v if v.starts_with("file:") => Ok(v.to_string()), v if v.starts_with("file:") => Ok(v.to_string()),
v if v.starts_with("rocksdb:") => Ok(v.to_string()), v if v.starts_with("rocksdb:") => Ok(v.to_string()),
v if v.starts_with("surrealkv:") => Ok(v.to_string()), v if v.starts_with("surrealkv:") => Ok(v.to_string()),
v if v.starts_with("surrealcs:") => Ok(v.to_string()),
v if v.starts_with("tikv:") => Ok(v.to_string()), v if v.starts_with("tikv:") => Ok(v.to_string()),
v if v.starts_with("fdb:") => Ok(v.to_string()), v if v.starts_with("fdb:") => Ok(v.to_string()),
_ => Err(String::from("Provide a valid database path parameter")), _ => Err(String::from("Provide a valid database path parameter")),

View file

@ -109,12 +109,12 @@ pub fn filter_from_value(v: &str) -> Result<EnvFilter, ParseError> {
"info" => Ok(EnvFilter::default().add_directive(Level::INFO.into())), "info" => Ok(EnvFilter::default().add_directive(Level::INFO.into())),
// Otherwise, let's show debugs and above // Otherwise, let's show debugs and above
"debug" => EnvFilter::builder() "debug" => EnvFilter::builder()
.parse("warn,surreal=debug,surrealdb=debug,surrealdb::core::kvs=debug"), .parse("warn,surreal=debug,surrealdb=debug,surrealcs=warn,surrealdb::core::kvs=debug"),
// Specify the log level for each code area // Specify the log level for each code area
"trace" => EnvFilter::builder() "trace" => EnvFilter::builder()
.parse("warn,surreal=trace,surrealdb=trace,surrealdb::core::kvs=debug"), .parse("warn,surreal=trace,surrealdb=trace,surrealcs=warn,surrealdb::core::kvs=debug"),
// Check if we should show all surreal logs // Check if we should show all surreal logs
"full" => EnvFilter::builder().parse("debug,surreal=trace,surrealdb=trace"), "full" => EnvFilter::builder().parse("debug,surreal=trace,surrealdb=trace,surrealcs=debug"),
// Check if we should show all module logs // Check if we should show all module logs
"all" => Ok(EnvFilter::default().add_directive(Level::TRACE.into())), "all" => Ok(EnvFilter::default().add_directive(Level::TRACE.into())),
// Let's try to parse the custom log level // Let's try to parse the custom log level

View file

@ -1,20 +1,7 @@
# cargo-vet audits file # cargo-vet audits file
[[audits.quick_cache]] [audits]
who = "Emmanuel Keller <emmanuel.keller@surrealdb.com>"
criteria = "safe-to-deploy"
version = "0.5.1"
[[audits.rustls]]
who = "Tobie Morgan Hitchcock <tobie@surrealdb.com>"
criteria = "safe-to-deploy"
delta = "0.21.10 -> 0.21.11"
[[audits.rustls]]
who = "Tobie Morgan Hitchcock <tobie@surrealdb.com>"
criteria = "safe-to-deploy"
delta = "0.22.3 -> 0.22.4"
[[trusted.addr]] [[trusted.addr]]
criteria = "safe-to-deploy" criteria = "safe-to-deploy"
@ -40,6 +27,18 @@ user-id = 3618 # David Tolnay (dtolnay)
start = "2019-07-23" start = "2019-07-23"
end = "2025-08-06" end = "2025-08-06"
[[trusted.bitcode]]
criteria = "safe-to-deploy"
user-id = 132446 # Finn Bear (finnbear)
start = "2023-04-16"
end = "2025-09-03"
[[trusted.bitcode_derive]]
criteria = "safe-to-deploy"
user-id = 132446 # Finn Bear (finnbear)
start = "2023-04-27"
end = "2025-09-03"
[[trusted.bstr]] [[trusted.bstr]]
criteria = "safe-to-deploy" criteria = "safe-to-deploy"
user-id = 189 # Andrew Gallant (BurntSushi) user-id = 189 # Andrew Gallant (BurntSushi)
@ -52,6 +51,18 @@ user-id = 189 # Andrew Gallant (BurntSushi)
start = "2019-06-09" start = "2019-06-09"
end = "2025-08-31" end = "2025-08-31"
[[trusted.bytes]]
criteria = "safe-to-deploy"
user-id = 10
start = "2019-03-06"
end = "2025-09-03"
[[trusted.bytes]]
criteria = "safe-to-deploy"
user-id = 6741 # Alice Ryhl (Darksonn)
start = "2021-01-11"
end = "2025-09-03"
[[trusted.dmp]] [[trusted.dmp]]
criteria = "safe-to-deploy" criteria = "safe-to-deploy"
user-id = 145457 # Tobie Morgan Hitchcock (tobiemh) user-id = 145457 # Tobie Morgan Hitchcock (tobiemh)
@ -106,6 +117,12 @@ user-id = 359 # Sean McArthur (seanmonstar)
start = "2019-04-05" start = "2019-04-05"
end = "2025-08-06" end = "2025-08-06"
[[trusted.http-body]]
criteria = "safe-to-deploy"
user-id = 10
start = "2019-04-04"
end = "2025-09-03"
[[trusted.http-body-util]] [[trusted.http-body-util]]
criteria = "safe-to-deploy" criteria = "safe-to-deploy"
user-id = 359 # Sean McArthur (seanmonstar) user-id = 359 # Sean McArthur (seanmonstar)
@ -154,6 +171,18 @@ user-id = 145457 # Tobie Morgan Hitchcock (tobiemh)
start = "2023-03-26" start = "2023-03-26"
end = "2025-01-24" end = "2025-01-24"
[[trusted.loom]]
criteria = "safe-to-deploy"
user-id = 10
start = "2019-08-08"
end = "2025-09-03"
[[trusted.loom]]
criteria = "safe-to-deploy"
user-id = 6741 # Alice Ryhl (Darksonn)
start = "2021-04-12"
end = "2025-09-03"
[[trusted.memchr]] [[trusted.memchr]]
criteria = "safe-to-deploy" criteria = "safe-to-deploy"
user-id = 189 # Andrew Gallant (BurntSushi) user-id = 189 # Andrew Gallant (BurntSushi)
@ -166,6 +195,18 @@ user-id = 359 # Sean McArthur (seanmonstar)
start = "2019-09-09" start = "2019-09-09"
end = "2025-08-06" end = "2025-08-06"
[[trusted.mio]]
criteria = "safe-to-deploy"
user-id = 10
start = "2019-05-15"
end = "2025-09-03"
[[trusted.nanoservices-utils]]
criteria = "safe-to-deploy"
user-id = 262632 # Maxwell Flitton (maxwellflitton)
start = "2024-03-30"
end = "2025-09-03"
[[trusted.num_cpus]] [[trusted.num_cpus]]
criteria = "safe-to-deploy" criteria = "safe-to-deploy"
user-id = 359 # Sean McArthur (seanmonstar) user-id = 359 # Sean McArthur (seanmonstar)
@ -280,6 +321,12 @@ user-id = 3618 # David Tolnay (dtolnay)
start = "2019-08-20" start = "2019-08-20"
end = "2025-08-06" end = "2025-08-06"
[[trusted.slab]]
criteria = "safe-to-deploy"
user-id = 6741 # Alice Ryhl (Darksonn)
start = "2021-10-13"
end = "2025-09-03"
[[trusted.snap]] [[trusted.snap]]
criteria = "safe-to-deploy" criteria = "safe-to-deploy"
user-id = 189 # Andrew Gallant (BurntSushi) user-id = 189 # Andrew Gallant (BurntSushi)
@ -292,6 +339,18 @@ user-id = 145457 # Tobie Morgan Hitchcock (tobiemh)
start = "2022-03-16" start = "2022-03-16"
end = "2025-01-24" end = "2025-01-24"
[[trusted.surrealcs]]
criteria = "safe-to-deploy"
user-id = 145457 # Tobie Morgan Hitchcock (tobiemh)
start = "2024-09-03"
end = "2025-09-03"
[[trusted.surrealcs-kernel]]
criteria = "safe-to-deploy"
user-id = 145457 # Tobie Morgan Hitchcock (tobiemh)
start = "2024-09-03"
end = "2025-09-03"
[[trusted.surrealdb]] [[trusted.surrealdb]]
criteria = "safe-to-deploy" criteria = "safe-to-deploy"
user-id = 145457 # Tobie Morgan Hitchcock (tobiemh) user-id = 145457 # Tobie Morgan Hitchcock (tobiemh)
@ -346,6 +405,54 @@ user-id = 3618 # David Tolnay (dtolnay)
start = "2019-03-01" start = "2019-03-01"
end = "2025-08-06" end = "2025-08-06"
[[trusted.tokio]]
criteria = "safe-to-deploy"
user-id = 10
start = "2019-03-02"
end = "2025-09-03"
[[trusted.tokio]]
criteria = "safe-to-deploy"
user-id = 6741 # Alice Ryhl (Darksonn)
start = "2020-12-25"
end = "2025-09-03"
[[trusted.tokio-macros]]
criteria = "safe-to-deploy"
user-id = 10
start = "2019-04-24"
end = "2025-09-03"
[[trusted.tokio-macros]]
criteria = "safe-to-deploy"
user-id = 6741 # Alice Ryhl (Darksonn)
start = "2020-10-26"
end = "2025-09-03"
[[trusted.tokio-util]]
criteria = "safe-to-deploy"
user-id = 10
start = "2019-11-26"
end = "2025-09-03"
[[trusted.tokio-util]]
criteria = "safe-to-deploy"
user-id = 6741 # Alice Ryhl (Darksonn)
start = "2021-01-12"
end = "2025-09-03"
[[trusted.tower]]
criteria = "safe-to-deploy"
user-id = 10
start = "2019-04-27"
end = "2025-09-03"
[[trusted.tower-layer]]
criteria = "safe-to-deploy"
user-id = 10
start = "2019-04-27"
end = "2025-09-03"
[[trusted.trice]] [[trusted.trice]]
criteria = "safe-to-deploy" criteria = "safe-to-deploy"
user-id = 145457 # Tobie Morgan Hitchcock (tobiemh) user-id = 145457 # Tobie Morgan Hitchcock (tobiemh)
@ -381,3 +488,81 @@ criteria = "safe-to-deploy"
user-id = 189 # Andrew Gallant (BurntSushi) user-id = 189 # Andrew Gallant (BurntSushi)
start = "2020-01-11" start = "2020-01-11"
end = "2025-08-31" end = "2025-08-31"
[[trusted.windows-core]]
criteria = "safe-to-deploy"
user-id = 64539 # Kenny Kerr (kennykerr)
start = "2021-11-15"
end = "2025-09-03"
[[trusted.windows-registry]]
criteria = "safe-to-deploy"
user-id = 64539 # Kenny Kerr (kennykerr)
start = "2024-02-15"
end = "2025-09-03"
[[trusted.windows-result]]
criteria = "safe-to-deploy"
user-id = 64539 # Kenny Kerr (kennykerr)
start = "2024-02-02"
end = "2025-09-03"
[[trusted.windows-strings]]
criteria = "safe-to-deploy"
user-id = 64539 # Kenny Kerr (kennykerr)
start = "2024-02-02"
end = "2025-09-03"
[[trusted.windows-targets]]
criteria = "safe-to-deploy"
user-id = 64539 # Kenny Kerr (kennykerr)
start = "2022-09-09"
end = "2025-09-03"
[[trusted.windows_aarch64_gnullvm]]
criteria = "safe-to-deploy"
user-id = 64539 # Kenny Kerr (kennykerr)
start = "2022-09-01"
end = "2025-09-03"
[[trusted.windows_aarch64_msvc]]
criteria = "safe-to-deploy"
user-id = 64539 # Kenny Kerr (kennykerr)
start = "2021-11-05"
end = "2025-09-03"
[[trusted.windows_i686_gnu]]
criteria = "safe-to-deploy"
user-id = 64539 # Kenny Kerr (kennykerr)
start = "2021-10-28"
end = "2025-09-03"
[[trusted.windows_i686_gnullvm]]
criteria = "safe-to-deploy"
user-id = 64539 # Kenny Kerr (kennykerr)
start = "2024-04-02"
end = "2025-09-03"
[[trusted.windows_i686_msvc]]
criteria = "safe-to-deploy"
user-id = 64539 # Kenny Kerr (kennykerr)
start = "2021-10-27"
end = "2025-09-03"
[[trusted.windows_x86_64_gnu]]
criteria = "safe-to-deploy"
user-id = 64539 # Kenny Kerr (kennykerr)
start = "2021-10-28"
end = "2025-09-03"
[[trusted.windows_x86_64_gnullvm]]
criteria = "safe-to-deploy"
user-id = 64539 # Kenny Kerr (kennykerr)
start = "2022-09-01"
end = "2025-09-03"
[[trusted.windows_x86_64_msvc]]
criteria = "safe-to-deploy"
user-id = 64539 # Kenny Kerr (kennykerr)
start = "2021-10-27"
end = "2025-09-03"

View file

@ -244,7 +244,7 @@ version = "0.4.3"
criteria = "safe-to-deploy" criteria = "safe-to-deploy"
[[exemptions.axum-extra]] [[exemptions.axum-extra]]
version = "0.9.2" version = "0.9.3"
criteria = "safe-to-deploy" criteria = "safe-to-deploy"
[[exemptions.axum-macros]] [[exemptions.axum-macros]]
@ -327,10 +327,6 @@ criteria = "safe-to-deploy"
version = "0.6.12" version = "0.6.12"
criteria = "safe-to-deploy" criteria = "safe-to-deploy"
[[exemptions.bytes]]
version = "1.7.1"
criteria = "safe-to-deploy"
[[exemptions.bytestring]] [[exemptions.bytestring]]
version = "1.3.1" version = "1.3.1"
criteria = "safe-to-deploy" criteria = "safe-to-deploy"
@ -679,6 +675,10 @@ criteria = "safe-to-deploy"
version = "0.28.1" version = "0.28.1"
criteria = "safe-to-deploy" criteria = "safe-to-deploy"
[[exemptions.glam]]
version = "0.29.0"
criteria = "safe-to-deploy"
[[exemptions.globwalk]] [[exemptions.globwalk]]
version = "0.9.1" version = "0.9.1"
criteria = "safe-to-run" criteria = "safe-to-run"
@ -855,10 +855,6 @@ criteria = "safe-to-deploy"
version = "0.4.11" version = "0.4.11"
criteria = "safe-to-deploy" criteria = "safe-to-deploy"
[[exemptions.loom]]
version = "0.5.6"
criteria = "safe-to-deploy"
[[exemptions.lru]] [[exemptions.lru]]
version = "0.12.3" version = "0.12.3"
criteria = "safe-to-deploy" criteria = "safe-to-deploy"
@ -919,8 +915,8 @@ criteria = "safe-to-deploy"
version = "0.8.11" version = "0.8.11"
criteria = "safe-to-deploy" criteria = "safe-to-deploy"
[[exemptions.multer]] [[exemptions.mio]]
version = "2.1.0" version = "1.0.2"
criteria = "safe-to-deploy" criteria = "safe-to-deploy"
[[exemptions.multer]] [[exemptions.multer]]
@ -1179,6 +1175,10 @@ criteria = "safe-to-deploy"
version = "0.26.0" version = "0.26.0"
criteria = "safe-to-deploy" criteria = "safe-to-deploy"
[[exemptions.quick_cache]]
version = "0.5.1"
criteria = "safe-to-deploy"
[[exemptions.quick_cache]] [[exemptions.quick_cache]]
version = "0.6.2" version = "0.6.2"
criteria = "safe-to-deploy" criteria = "safe-to-deploy"
@ -1300,15 +1300,15 @@ version = "1.1.0"
criteria = "safe-to-deploy" criteria = "safe-to-deploy"
[[exemptions.rocket]] [[exemptions.rocket]]
version = "0.5.0" version = "0.5.1"
criteria = "safe-to-deploy" criteria = "safe-to-deploy"
[[exemptions.rocket_codegen]] [[exemptions.rocket_codegen]]
version = "0.5.0" version = "0.5.1"
criteria = "safe-to-deploy" criteria = "safe-to-deploy"
[[exemptions.rocket_http]] [[exemptions.rocket_http]]
version = "0.5.0" version = "0.5.1"
criteria = "safe-to-deploy" criteria = "safe-to-deploy"
[[exemptions.rocksdb]] [[exemptions.rocksdb]]
@ -1356,7 +1356,7 @@ version = "0.21.8"
criteria = "safe-to-deploy" criteria = "safe-to-deploy"
[[exemptions.rustls]] [[exemptions.rustls]]
version = "0.22.3" version = "0.22.4"
criteria = "safe-to-deploy" criteria = "safe-to-deploy"
[[exemptions.rustls]] [[exemptions.rustls]]
@ -1479,10 +1479,6 @@ criteria = "safe-to-deploy"
version = "0.3.11" version = "0.3.11"
criteria = "safe-to-deploy" criteria = "safe-to-deploy"
[[exemptions.slab]]
version = "0.4.9"
criteria = "safe-to-deploy"
[[exemptions.smallvec]] [[exemptions.smallvec]]
version = "1.13.2" version = "1.13.2"
criteria = "safe-to-deploy" criteria = "safe-to-deploy"
@ -1631,18 +1627,10 @@ criteria = "safe-to-deploy"
version = "1.2.1" version = "1.2.1"
criteria = "safe-to-deploy" criteria = "safe-to-deploy"
[[exemptions.tokio]]
version = "1.38.0"
criteria = "safe-to-deploy"
[[exemptions.tokio-io-timeout]] [[exemptions.tokio-io-timeout]]
version = "1.2.0" version = "1.2.0"
criteria = "safe-to-deploy" criteria = "safe-to-deploy"
[[exemptions.tokio-macros]]
version = "2.3.0"
criteria = "safe-to-deploy"
[[exemptions.tokio-rustls]] [[exemptions.tokio-rustls]]
version = "0.24.1" version = "0.24.1"
criteria = "safe-to-deploy" criteria = "safe-to-deploy"
@ -1659,10 +1647,6 @@ criteria = "safe-to-deploy"
version = "0.23.1" version = "0.23.1"
criteria = "safe-to-deploy" criteria = "safe-to-deploy"
[[exemptions.tokio-util]]
version = "0.7.10"
criteria = "safe-to-deploy"
[[exemptions.toml]] [[exemptions.toml]]
version = "0.8.12" version = "0.8.12"
criteria = "safe-to-deploy" criteria = "safe-to-deploy"
@ -1704,7 +1688,7 @@ version = "0.3.2"
criteria = "safe-to-deploy" criteria = "safe-to-deploy"
[[exemptions.tower-service]] [[exemptions.tower-service]]
version = "0.3.2" version = "0.3.3"
criteria = "safe-to-deploy" criteria = "safe-to-deploy"
[[exemptions.tracing]] [[exemptions.tracing]]
@ -1855,10 +1839,6 @@ criteria = "safe-to-deploy"
version = "0.48.0" version = "0.48.0"
criteria = "safe-to-deploy" criteria = "safe-to-deploy"
[[exemptions.windows-core]]
version = "0.52.0"
criteria = "safe-to-deploy"
[[exemptions.windows-sys]] [[exemptions.windows-sys]]
version = "0.48.0" version = "0.48.0"
criteria = "safe-to-deploy" criteria = "safe-to-deploy"
@ -1867,70 +1847,6 @@ criteria = "safe-to-deploy"
version = "0.52.0" version = "0.52.0"
criteria = "safe-to-deploy" criteria = "safe-to-deploy"
[[exemptions.windows-targets]]
version = "0.48.5"
criteria = "safe-to-deploy"
[[exemptions.windows-targets]]
version = "0.52.4"
criteria = "safe-to-deploy"
[[exemptions.windows_aarch64_gnullvm]]
version = "0.48.5"
criteria = "safe-to-deploy"
[[exemptions.windows_aarch64_gnullvm]]
version = "0.52.4"
criteria = "safe-to-deploy"
[[exemptions.windows_aarch64_msvc]]
version = "0.48.5"
criteria = "safe-to-deploy"
[[exemptions.windows_aarch64_msvc]]
version = "0.52.4"
criteria = "safe-to-deploy"
[[exemptions.windows_i686_gnu]]
version = "0.48.5"
criteria = "safe-to-deploy"
[[exemptions.windows_i686_gnu]]
version = "0.52.4"
criteria = "safe-to-deploy"
[[exemptions.windows_i686_msvc]]
version = "0.48.5"
criteria = "safe-to-deploy"
[[exemptions.windows_i686_msvc]]
version = "0.52.4"
criteria = "safe-to-deploy"
[[exemptions.windows_x86_64_gnu]]
version = "0.48.5"
criteria = "safe-to-deploy"
[[exemptions.windows_x86_64_gnu]]
version = "0.52.4"
criteria = "safe-to-deploy"
[[exemptions.windows_x86_64_gnullvm]]
version = "0.48.5"
criteria = "safe-to-deploy"
[[exemptions.windows_x86_64_gnullvm]]
version = "0.52.4"
criteria = "safe-to-deploy"
[[exemptions.windows_x86_64_msvc]]
version = "0.48.5"
criteria = "safe-to-deploy"
[[exemptions.windows_x86_64_msvc]]
version = "0.52.4"
criteria = "safe-to-deploy"
[[exemptions.winnow]] [[exemptions.winnow]]
version = "0.5.40" version = "0.5.40"
criteria = "safe-to-deploy" criteria = "safe-to-deploy"
@ -1939,10 +1855,6 @@ criteria = "safe-to-deploy"
version = "0.6.5" version = "0.6.5"
criteria = "safe-to-deploy" criteria = "safe-to-deploy"
[[exemptions.winreg]]
version = "0.52.0"
criteria = "safe-to-deploy"
[[exemptions.wiremock]] [[exemptions.wiremock]]
version = "0.6.0" version = "0.6.0"
criteria = "safe-to-run" criteria = "safe-to-run"

View file

@ -44,6 +44,20 @@ user-id = 3618
user-login = "dtolnay" user-login = "dtolnay"
user-name = "David Tolnay" user-name = "David Tolnay"
[[publisher.bitcode]]
version = "0.6.3"
when = "2024-07-14"
user-id = 132446
user-login = "finnbear"
user-name = "Finn Bear"
[[publisher.bitcode_derive]]
version = "0.6.3"
when = "2024-07-14"
user-id = 132446
user-login = "finnbear"
user-name = "Finn Bear"
[[publisher.bstr]] [[publisher.bstr]]
version = "1.9.1" version = "1.9.1"
when = "2024-02-24" when = "2024-02-24"
@ -65,6 +79,13 @@ user-id = 189
user-login = "BurntSushi" user-login = "BurntSushi"
user-name = "Andrew Gallant" user-name = "Andrew Gallant"
[[publisher.bytes]]
version = "1.7.1"
when = "2024-08-01"
user-id = 6741
user-login = "Darksonn"
user-name = "Alice Ryhl"
[[publisher.cexpr]] [[publisher.cexpr]]
version = "0.6.0" version = "0.6.0"
when = "2021-10-11" when = "2021-10-11"
@ -240,6 +261,13 @@ user-id = 145457
user-login = "tobiemh" user-login = "tobiemh"
user-name = "Tobie Morgan Hitchcock" user-name = "Tobie Morgan Hitchcock"
[[publisher.loom]]
version = "0.5.6"
when = "2022-05-19"
user-id = 6741
user-login = "Darksonn"
user-name = "Alice Ryhl"
[[publisher.memchr]] [[publisher.memchr]]
version = "2.7.2" version = "2.7.2"
when = "2024-03-27" when = "2024-03-27"
@ -254,6 +282,13 @@ user-id = 359
user-login = "seanmonstar" user-login = "seanmonstar"
user-name = "Sean McArthur" user-name = "Sean McArthur"
[[publisher.nanoservices-utils]]
version = "0.1.4"
when = "2024-05-16"
user-id = 262632
user-login = "maxwellflitton"
user-name = "Maxwell Flitton"
[[publisher.num_cpus]] [[publisher.num_cpus]]
version = "1.16.0" version = "1.16.0"
when = "2023-06-29" when = "2023-06-29"
@ -332,8 +367,8 @@ user-login = "BurntSushi"
user-name = "Andrew Gallant" user-name = "Andrew Gallant"
[[publisher.reqwest]] [[publisher.reqwest]]
version = "0.12.5" version = "0.12.7"
when = "2024-06-17" when = "2024-08-19"
user-id = 359 user-id = 359
user-login = "seanmonstar" user-login = "seanmonstar"
user-name = "Sean McArthur" user-name = "Sean McArthur"
@ -415,6 +450,13 @@ user-id = 3618
user-login = "dtolnay" user-login = "dtolnay"
user-name = "David Tolnay" user-name = "David Tolnay"
[[publisher.slab]]
version = "0.4.9"
when = "2023-08-22"
user-id = 6741
user-login = "Darksonn"
user-name = "Alice Ryhl"
[[publisher.snap]] [[publisher.snap]]
version = "1.1.1" version = "1.1.1"
when = "2023-12-05" when = "2023-12-05"
@ -429,6 +471,20 @@ user-id = 145457
user-login = "tobiemh" user-login = "tobiemh"
user-name = "Tobie Morgan Hitchcock" user-name = "Tobie Morgan Hitchcock"
[[publisher.surrealcs]]
version = "0.1.1"
when = "2024-09-03"
user-id = 145457
user-login = "tobiemh"
user-name = "Tobie Morgan Hitchcock"
[[publisher.surrealcs-kernel]]
version = "0.1.1"
when = "2024-09-03"
user-id = 145457
user-login = "tobiemh"
user-name = "Tobie Morgan Hitchcock"
[[publisher.surrealdb]] [[publisher.surrealdb]]
version = "1.5.4" version = "1.5.4"
when = "2024-07-10" when = "2024-07-10"
@ -485,6 +541,27 @@ user-id = 3618
user-login = "dtolnay" user-login = "dtolnay"
user-name = "David Tolnay" user-name = "David Tolnay"
[[publisher.tokio]]
version = "1.40.0"
when = "2024-08-30"
user-id = 6741
user-login = "Darksonn"
user-name = "Alice Ryhl"
[[publisher.tokio-macros]]
version = "2.4.0"
when = "2024-07-23"
user-id = 6741
user-login = "Darksonn"
user-name = "Alice Ryhl"
[[publisher.tokio-util]]
version = "0.7.11"
when = "2024-05-04"
user-id = 6741
user-login = "Darksonn"
user-name = "Alice Ryhl"
[[publisher.trice]] [[publisher.trice]]
version = "0.4.0" version = "0.4.0"
when = "2024-01-04" when = "2024-01-04"
@ -548,6 +625,153 @@ user-id = 189
user-login = "BurntSushi" user-login = "BurntSushi"
user-name = "Andrew Gallant" user-name = "Andrew Gallant"
[[publisher.windows-core]]
version = "0.52.0"
when = "2023-11-15"
user-id = 64539
user-login = "kennykerr"
user-name = "Kenny Kerr"
[[publisher.windows-registry]]
version = "0.2.0"
when = "2024-07-03"
user-id = 64539
user-login = "kennykerr"
user-name = "Kenny Kerr"
[[publisher.windows-result]]
version = "0.2.0"
when = "2024-07-03"
user-id = 64539
user-login = "kennykerr"
user-name = "Kenny Kerr"
[[publisher.windows-strings]]
version = "0.1.0"
when = "2024-07-03"
user-id = 64539
user-login = "kennykerr"
user-name = "Kenny Kerr"
[[publisher.windows-targets]]
version = "0.48.5"
when = "2023-08-18"
user-id = 64539
user-login = "kennykerr"
user-name = "Kenny Kerr"
[[publisher.windows-targets]]
version = "0.52.6"
when = "2024-07-03"
user-id = 64539
user-login = "kennykerr"
user-name = "Kenny Kerr"
[[publisher.windows_aarch64_gnullvm]]
version = "0.48.5"
when = "2023-08-18"
user-id = 64539
user-login = "kennykerr"
user-name = "Kenny Kerr"
[[publisher.windows_aarch64_gnullvm]]
version = "0.52.6"
when = "2024-07-03"
user-id = 64539
user-login = "kennykerr"
user-name = "Kenny Kerr"
[[publisher.windows_aarch64_msvc]]
version = "0.48.5"
when = "2023-08-18"
user-id = 64539
user-login = "kennykerr"
user-name = "Kenny Kerr"
[[publisher.windows_aarch64_msvc]]
version = "0.52.6"
when = "2024-07-03"
user-id = 64539
user-login = "kennykerr"
user-name = "Kenny Kerr"
[[publisher.windows_i686_gnu]]
version = "0.48.5"
when = "2023-08-18"
user-id = 64539
user-login = "kennykerr"
user-name = "Kenny Kerr"
[[publisher.windows_i686_gnu]]
version = "0.52.6"
when = "2024-07-03"
user-id = 64539
user-login = "kennykerr"
user-name = "Kenny Kerr"
[[publisher.windows_i686_gnullvm]]
version = "0.52.6"
when = "2024-07-03"
user-id = 64539
user-login = "kennykerr"
user-name = "Kenny Kerr"
[[publisher.windows_i686_msvc]]
version = "0.48.5"
when = "2023-08-18"
user-id = 64539
user-login = "kennykerr"
user-name = "Kenny Kerr"
[[publisher.windows_i686_msvc]]
version = "0.52.6"
when = "2024-07-03"
user-id = 64539
user-login = "kennykerr"
user-name = "Kenny Kerr"
[[publisher.windows_x86_64_gnu]]
version = "0.48.5"
when = "2023-08-18"
user-id = 64539
user-login = "kennykerr"
user-name = "Kenny Kerr"
[[publisher.windows_x86_64_gnu]]
version = "0.52.6"
when = "2024-07-03"
user-id = 64539
user-login = "kennykerr"
user-name = "Kenny Kerr"
[[publisher.windows_x86_64_gnullvm]]
version = "0.48.5"
when = "2023-08-18"
user-id = 64539
user-login = "kennykerr"
user-name = "Kenny Kerr"
[[publisher.windows_x86_64_gnullvm]]
version = "0.52.6"
when = "2024-07-03"
user-id = 64539
user-login = "kennykerr"
user-name = "Kenny Kerr"
[[publisher.windows_x86_64_msvc]]
version = "0.48.5"
when = "2023-08-18"
user-id = 64539
user-login = "kennykerr"
user-name = "Kenny Kerr"
[[publisher.windows_x86_64_msvc]]
version = "0.52.6"
when = "2024-07-03"
user-id = 64539
user-login = "kennykerr"
user-name = "Kenny Kerr"
[[audits.bytecode-alliance.wildcard-audits.arbitrary]] [[audits.bytecode-alliance.wildcard-audits.arbitrary]]
who = "Nick Fitzgerald <fitzgen@gmail.com>" who = "Nick Fitzgerald <fitzgen@gmail.com>"
criteria = "safe-to-deploy" criteria = "safe-to-deploy"