From 2b0396a32ea326a5364528b3dec7eb0f640686ba Mon Sep 17 00:00:00 2001 From: Miguel Piedrafita Date: Sun, 3 Sep 2023 05:02:41 +0100 Subject: [PATCH] api: switch to ensemble --- Tiltfile | 2 + api/.cargo/config.toml | 2 - api/Cargo.lock | 2516 +++++------------ api/Cargo.toml | 14 +- api/Dockerfile | 7 - api/Dockerfile.dev | 1 - api/Tiltfile | 1 - api/prisma-cli/Cargo.toml | 13 - api/prisma-cli/src/main.rs | 3 - .../20230718040035_init/migration.sql | 22 - api/prisma/migrations/migration_lock.toml | 3 - api/prisma/schema.prisma | 62 - api/rustfmt.toml | 2 +- api/src/axum/extractors/prediction.rs | 27 +- api/src/axum/extractors/user.rs | 22 +- api/src/main.rs | 24 +- api/src/migrations.rs | 77 + api/src/models.rs | 79 + api/src/routes/system.rs | 19 +- api/src/routes/v1/mod.rs | 88 +- api/src/server.rs | 12 +- api/src/shutdown.rs | 4 +- api/src/spec.rs | 174 -- api/src/webhooks.rs | 2 +- 24 files changed, 995 insertions(+), 2181 deletions(-) delete mode 100644 api/.cargo/config.toml delete mode 100644 api/prisma-cli/Cargo.toml delete mode 100644 api/prisma-cli/src/main.rs delete mode 100644 api/prisma/migrations/20230718040035_init/migration.sql delete mode 100644 api/prisma/migrations/migration_lock.toml delete mode 100644 api/prisma/schema.prisma create mode 100644 api/src/migrations.rs create mode 100644 api/src/models.rs delete mode 100644 api/src/spec.rs diff --git a/Tiltfile b/Tiltfile index 0de2e95..ba90191 100644 --- a/Tiltfile +++ b/Tiltfile @@ -1,3 +1,5 @@ +allow_k8s_contexts('orbstack') + local_path_storage = local('curl https://raw.githubusercontent.com/rancher/local-path-provisioner/v0.0.24/deploy/local-path-storage.yaml') k8s_yaml(local_path_storage) diff --git a/api/.cargo/config.toml b/api/.cargo/config.toml deleted file mode 100644 index e01630b..0000000 --- a/api/.cargo/config.toml +++ /dev/null @@ -1,2 +0,0 @@ -[alias] -prisma = "run --bin prisma-cli --" diff --git a/api/Cargo.lock b/api/Cargo.lock index baea4ca..652cad9 100644 --- a/api/Cargo.lock +++ b/api/Cargo.lock @@ -2,11 +2,21 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "Inflector" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" +dependencies = [ + "lazy_static", + "regex", +] + [[package]] name = "addr2line" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ "gimli", ] @@ -17,17 +27,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" -[[package]] -name = "ahash" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" -dependencies = [ - "getrandom 0.2.10", - "once_cell", - "version_check", -] - [[package]] name = "ahash" version = "0.8.3" @@ -35,7 +34,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ "cfg-if", - "getrandom 0.2.10", + "getrandom", "once_cell", "serde", "version_check", @@ -43,18 +42,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "0.7.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" -dependencies = [ - "memchr", -] - -[[package]] -name = "aho-corasick" -version = "1.0.2" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" +checksum = "0c378d78423fdad8089616f827526ee33c19f2fddbd5de1629152c9593ba4783" dependencies = [ "memchr", ] @@ -80,6 +70,12 @@ dependencies = [ "tracing", ] +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + [[package]] name = "android-tzdata" version = "0.1.1" @@ -97,9 +93,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.72" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b13c32d80ecc7ab747b80c3784bce54ee8a7a0cc4fbda9bf4cda2cf6fe90854" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" [[package]] name = "arc-swap" @@ -108,29 +104,29 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" [[package]] -name = "ascii" -version = "0.9.3" +name = "arrayvec" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eab1c04a571841102f5345a8fc0f6bb3d31c315dec879b5c6e42e40ce7ffa34e" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "async-trait" -version = "0.1.71" +version = "0.1.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a564d521dd56509c4c47480d00b80ee55f7e385ae48db5744c67ad50c92d2ebf" +checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.29", ] [[package]] -name = "atomic-shim" -version = "0.2.0" +name = "atoi" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67cd4b51d303cf3501c301e8125df442128d3c6d7c69f71b27833d253de47e77" +checksum = "f28d99ec8bfea296261ca1af174f24225171fea9664ba9003cbebee704810528" dependencies = [ - "crossbeam-utils", + "num-traits", ] [[package]] @@ -141,9 +137,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "axum" -version = "0.6.19" +version = "0.6.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a1de45611fdb535bfde7b7de4fd54f4fd2b17b1737c0a59b69bf9b92074b8c" +checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" dependencies = [ "async-trait", "axum-core", @@ -201,7 +197,7 @@ dependencies = [ "axum", "http", "http-body", - "itertools", + "itertools 0.10.5", "jsonschema", "schemars", "serde", @@ -216,17 +212,17 @@ version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cdca6a10ecad987bda04e95606ef85a5417dcaac1a78455242d72e031e2b6b62" dependencies = [ - "heck 0.4.1", + "heck", "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.29", ] [[package]] name = "backtrace" -version = "0.3.68" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" dependencies = [ "addr2line", "cc", @@ -237,62 +233,32 @@ dependencies = [ "rustc-demangle", ] -[[package]] -name = "base-x" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" - -[[package]] -name = "base36" -version = "0.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9c26bddc1271f7112e5ec797e8eeba6de2de211c1488e506b9500196dbf77c5" -dependencies = [ - "base-x", - "failure", -] - -[[package]] -name = "base64" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" - [[package]] name = "base64" -version = "0.13.1" +version = "0.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" +checksum = "414dcefbc63d77c526a76b3afcf6fbb9b5e2791c19c3aa2297733208750c6e53" [[package]] -name = "base64" -version = "0.21.2" +name = "base64ct" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] name = "bigdecimal" -version = "0.3.1" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6773ddc0eafc0e509fb60e48dff7f450f8e674a0686ae8605e8d9901bd5eefa" +checksum = "454bca3db10617b88b566f205ed190aedb0e0e6dd4cad61d3988a72e8c5594cb" dependencies = [ + "autocfg", + "libm", "num-bigint", "num-integer", "num-traits", "serde", ] -[[package]] -name = "bigint" -version = "4.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0e8c8a600052b52482eff2cf4d810e462fdff1f656ac1ecb6232132a1ed7def" -dependencies = [ - "byteorder", - "crunchy", -] - [[package]] name = "bit-set" version = "0.5.3" @@ -316,18 +282,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42" - -[[package]] -name = "block-buffer" -version = "0.9.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" -dependencies = [ - "generic-array", -] +checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" [[package]] name = "block-buffer" @@ -338,21 +295,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "builtin-psl-connectors" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?branch=new-4.14.0-pcr#45b026c8b64ed0b60cb03deed5f478c457de645b" -dependencies = [ - "connection-string", - "either", - "enumflags2", - "indoc", - "lsp-types", - "once_cell", - "psl-core", - "regex", -] - [[package]] name = "bumpalo" version = "3.13.0" @@ -379,9 +321,12 @@ checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" [[package]] name = "cc" -version = "1.0.79" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] [[package]] name = "cfg-if" @@ -391,42 +336,17 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.26" +version = "0.4.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" +checksum = "95ed24df0632f708f5f6d8082675bef2596f7084dee3dd55f632290bf35bfe0f" dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", "num-traits", - "serde", "time 0.1.45", "wasm-bindgen", - "winapi", -] - -[[package]] -name = "colored" -version = "2.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2674ec482fbc38012cf31e6c42ba0177b431a0cb6f15fe40efa5aab1bda516f6" -dependencies = [ - "is-terminal", - "lazy_static", - "windows-sys", -] - -[[package]] -name = "combine" -version = "3.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da3da6baa321ec19e1cc41d31bf599f00c783d0517095cdaf0332e3fe8d20680" -dependencies = [ - "ascii", - "byteorder", - "either", - "memchr", - "unreachable", + "windows-targets", ] [[package]] @@ -444,25 +364,10 @@ dependencies = [ ] [[package]] -name = "connection-string" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "510ca239cf13b7f8d16a2b48f263de7b4f8c566f0af58d901031473c76afb1e3" - -[[package]] -name = "convert_case" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb4a24b1aaf0fd0ce8b45161144d6f42cd91677fd5940fd431183eb023b3a2b8" - -[[package]] -name = "convert_case" -version = "0.6.0" +name = "const-oid" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" -dependencies = [ - "unicode-segmentation", -] +checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" [[package]] name = "core-foundation" @@ -490,12 +395,17 @@ dependencies = [ ] [[package]] -name = "crc32fast" -version = "1.3.2" +name = "crossbeam" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +checksum = "2801af0d36612ae591caa9568261fddce32ce6e08a7275ea334a06a4ad021a2c" dependencies = [ "cfg-if", + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-epoch", + "crossbeam-queue", + "crossbeam-utils", ] [[package]] @@ -508,6 +418,17 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "crossbeam-deque" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +dependencies = [ + "cfg-if", + "crossbeam-epoch", + "crossbeam-utils", +] + [[package]] name = "crossbeam-epoch" version = "0.9.15" @@ -522,19 +443,23 @@ dependencies = [ ] [[package]] -name = "crossbeam-utils" -version = "0.8.16" +name = "crossbeam-queue" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" +checksum = "d1cfb3ea8a53f37c40dea2c7bedcbd88bdfae54f5e2175d6ecaff1c988353add" dependencies = [ "cfg-if", + "crossbeam-utils", ] [[package]] -name = "crunchy" -version = "0.1.6" +name = "crossbeam-utils" +version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2f4a431c5c9f662e1200b7c7f02c34e91361150e382089a8f2dec3ba680cbda" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" +dependencies = [ + "cfg-if", +] [[package]] name = "crypto-common" @@ -547,113 +472,127 @@ dependencies = [ ] [[package]] -name = "cuid" -version = "1.3.1" +name = "dark-std" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe5d03ac594f5f9cc680b142fff46f3ad9f197e19272042ebf1a40b383fee6fb" +checksum = "771253b7ef5105b590ce17ac0cdfbad9aec8bcb07f33c5fa148b6b4ec56b114f" dependencies = [ - "base36", - "bigint", - "cuid2", - "hostname", - "num", - "once_cell", - "rand 0.8.5", + "crossbeam", + "flume", + "parking_lot", + "serde", ] [[package]] -name = "cuid2" -version = "0.1.0" +name = "deadpool" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1debbff0c0f0b54e681296c6f064a78f8ecec8e89e7fcc472443d9f85b98ca9a" +checksum = "421fe0f90f2ab22016f32a9881be5134fdd71c65298917084b0c7477cbc3856e" dependencies = [ - "num", - "proptest", - "rand 0.8.5", - "sha3", + "async-trait", + "deadpool-runtime", + "num_cpus", + "retain_mut", + "tokio", ] [[package]] -name = "datamodel-renderer" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?branch=new-4.14.0-pcr#45b026c8b64ed0b60cb03deed5f478c457de645b" +name = "deadpool-runtime" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaa37046cc0f6c3cc6090fbdbf73ef0b8ef4cfcc37f6befc0020f63e8cf121e1" + +[[package]] +name = "deluxe" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ed332aaf752b459088acf3dd4eca323e3ef4b83c70a84ca48fb0ec5305f1488" dependencies = [ - "base64 0.13.1", + "deluxe-core", + "deluxe-macros", "once_cell", - "psl", - "regex", + "proc-macro2", + "syn 2.0.29", ] [[package]] -name = "diagnostics" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?branch=new-4.14.0-pcr#45b026c8b64ed0b60cb03deed5f478c457de645b" +name = "deluxe-core" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eddada51c8576df9d6a8450c351ff63042b092c9458b8ac7d20f89cbd0ffd313" dependencies = [ - "colored", - "indoc", - "pest", + "arrayvec", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.29", ] [[package]] -name = "digest" -version = "0.9.0" +name = "deluxe-macros" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +checksum = "f87546d9c837f0b7557e47b8bd6eae52c3c223141b76aa233c345c9ab41d9117" dependencies = [ - "generic-array", + "deluxe-core", + "heck", + "if_chain", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.29", +] + +[[package]] +name = "der" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" +dependencies = [ + "const-oid", + "pem-rfc7468", + "zeroize", ] +[[package]] +name = "deranged" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946" + [[package]] name = "digest" version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "block-buffer 0.10.4", + "block-buffer", + "const-oid", "crypto-common", "subtle", ] [[package]] -name = "directories" -version = "4.0.1" +name = "dirs" +version = "5.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f51c5d4ddabd36886dd3e1438cb358cdcb0d7c499cb99cb4ac2e38e18b5cb210" +checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" dependencies = [ "dirs-sys", ] [[package]] name = "dirs-sys" -version = "0.3.7" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" dependencies = [ "libc", + "option-ext", "redox_users", - "winapi", -] - -[[package]] -name = "dmmf" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?branch=new-4.14.0-pcr#45b026c8b64ed0b60cb03deed5f478c457de645b" -dependencies = [ - "bigdecimal", - "indexmap 1.9.3", - "prisma-models", - "psl", - "schema", - "serde", - "serde_json", + "windows-sys", ] -[[package]] -name = "dotenv" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" - [[package]] name = "dotenvy" version = "0.15.7" @@ -662,9 +601,9 @@ checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" [[package]] name = "dyn-clone" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "304e6508efa593091e97a9abbc10f90aa7ca635b6d2784feff3c89d41dd12272" +checksum = "bbfc4744c1b8f2a09adc0e55242f60b1af195d88596bd8700be74418c056c555" [[package]] name = "dyson-api" @@ -676,7 +615,7 @@ dependencies = [ "axum-jsonschema", "chrono", "dotenvy", - "prisma-client-rust", + "ensemble", "redis", "reqwest", "schemars", @@ -690,44 +629,66 @@ dependencies = [ [[package]] name = "either" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "encoding_rs" -version = "0.8.32" +version = "0.8.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" dependencies = [ "cfg-if", ] [[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "enumflags2" -version = "0.7.7" +name = "ensemble" +version = "0.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c041f5090df68b32bcd905365fd51769c8b9d553fe87fde0b683534f10c01bd2" +checksum = "1134d8e1c51031abc315e0ded6e5ba8ca0c2dee40c0165c797d0b53b36de18da" dependencies = [ - "enumflags2_derive", + "Inflector", + "async-trait", + "ensemble_derive", + "fastdate", + "itertools 0.11.0", + "rbatis", + "rbdc-mysql", + "rbdc-pg", + "rbs", + "schemars", "serde", + "serde_json", + "sha256", + "thiserror", + "tokio", + "tracing", + "uuid", ] [[package]] -name = "enumflags2_derive" -version = "0.7.7" +name = "ensemble_derive" +version = "0.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e9a1f9f7d83e59740248a6e14ecf93929ade55027844dfcea78beafccc15745" +checksum = "64a81ef3f125733be81753dc23fe2067c7135b95e8c4870e168ebd997725fd83" dependencies = [ + "Inflector", + "deluxe", + "pluralizer", "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.29", +] + +[[package]] +name = "env_logger" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a19187fea3ac7e84da7dacf48de0c45d63c6a76f9490dae389aead16c243fce3" +dependencies = [ + "log", + "regex", ] [[package]] @@ -738,9 +699,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.1" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" +checksum = "136526188508e25c6fef639d7927dfb3e0e3084488bf202267829cf7fc23dbdd" dependencies = [ "errno-dragonfly", "libc", @@ -757,34 +718,6 @@ dependencies = [ "libc", ] -[[package]] -name = "failure" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32e9bd16cc02eae7db7ef620b392808b89f6a5e16bb3497d159c6b92a0f4f86" -dependencies = [ - "backtrace", - "failure_derive", -] - -[[package]] -name = "failure_derive" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", - "synstructure", -] - -[[package]] -name = "fallible-iterator" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" - [[package]] name = "fancy-regex" version = "0.11.0" @@ -796,28 +729,34 @@ dependencies = [ ] [[package]] -name = "fastrand" -version = "1.9.0" +name = "fastdate" +version = "0.1.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +checksum = "73b1962cdaa569eb98bb3282e6de89e73403c682087ab187d687cf8af475616a" dependencies = [ - "instant", + "libc", + "once_cell", + "serde", + "time 0.3.28", + "winapi", ] [[package]] -name = "fixedbitset" -version = "0.1.9" +name = "fastrand" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86d4de0081402f5e88cdac65c8dcdcc73118c1a7a465e2a05f0da05843a8ea33" +checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" [[package]] -name = "flate2" -version = "1.0.26" +name = "flume" +version = "0.10.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743" +checksum = "1657b4441c3403d9f7b3409e47575237dac27b1b5726df654a6ecbf92f0f7577" dependencies = [ - "crc32fast", - "miniz_oxide", + "futures-core", + "futures-sink", + "pin-project", + "spin 0.9.8", ] [[package]] @@ -860,12 +799,6 @@ dependencies = [ "num", ] -[[package]] -name = "fuchsia-cprng" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" - [[package]] name = "futures" version = "0.3.28" @@ -922,7 +855,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.29", ] [[package]] @@ -937,12 +870,6 @@ version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" -[[package]] -name = "futures-timer" -version = "3.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" - [[package]] name = "futures-util" version = "0.3.28" @@ -973,49 +900,28 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.1.16" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" dependencies = [ "cfg-if", + "js-sys", "libc", - "wasi 0.9.0+wasi-snapshot-preview1", -] - -[[package]] -name = "getrandom" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" -dependencies = [ - "cfg-if", - "js-sys", - "libc", - "wasi 0.11.0+wasi-snapshot-preview1", - "wasm-bindgen", + "wasi 0.11.0+wasi-snapshot-preview1", + "wasm-bindgen", ] [[package]] name = "gimli" -version = "0.27.3" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" - -[[package]] -name = "graphql-parser" -version = "0.3.0" -source = "git+https://github.com/prisma/graphql-parser#6a3f58bd879065588e710cb02b5bd30c1ce182c3" -dependencies = [ - "combine 3.8.1", - "indexmap 1.9.3", - "thiserror", -] +checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" [[package]] name = "h2" -version = "0.3.20" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97ec8491ebaf99c8eaa73058b045fe58073cd6be7f596ac993ced0b0a0c01049" +checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" dependencies = [ "bytes", "fnv", @@ -1032,36 +938,36 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.11.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" -dependencies = [ - "ahash 0.7.6", -] +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.12.3" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" dependencies = [ - "ahash 0.7.6", + "ahash", + "allocator-api2", ] [[package]] -name = "hashbrown" -version = "0.14.0" +name = "hashlink" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" +checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" +dependencies = [ + "hashbrown 0.14.0", +] [[package]] name = "headers" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3e372db8e5c0d213e0cd0b9be18be2aca3d44cf2fe30a9d46a65581cd454584" +checksum = "06683b93020a07e3dbcf5f8c0f6d40080d725bea7936fc01ad345c01b97dc270" dependencies = [ - "base64 0.13.1", - "bitflags 1.3.2", + "base64", "bytes", "headers-core", "http", @@ -1079,15 +985,6 @@ dependencies = [ "http", ] -[[package]] -name = "heck" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" -dependencies = [ - "unicode-segmentation", -] - [[package]] name = "heck" version = "0.4.1" @@ -1112,18 +1009,21 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest 0.10.7", + "digest", ] [[package]] -name = "hostname" -version = "0.3.1" +name = "html_parser" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867" +checksum = "ec016cabcf7c9c48f9d5fdc6b03f273585bfce640a0f47a69552039e92b1959a" dependencies = [ - "libc", - "match_cfg", - "winapi", + "pest", + "pest_derive", + "serde", + "serde_derive", + "serde_json", + "thiserror", ] [[package]] @@ -1156,9 +1056,9 @@ checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" @@ -1177,7 +1077,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2", + "socket2 0.4.9", "tokio", "tower-service", "tracing", @@ -1231,23 +1131,10 @@ dependencies = [ ] [[package]] -name = "include_dir" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18762faeff7122e89e0857b02f7ce6fcc0d101d5e9ad2ad7846cc01d61b7f19e" -dependencies = [ - "include_dir_macros", -] - -[[package]] -name = "include_dir_macros" -version = "0.7.3" +name = "if_chain" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b139284b5cf57ecfa712bcc66950bb635b31aff41c188e8a4cfc758eca374a3f" -dependencies = [ - "proc-macro2", - "quote", -] +checksum = "cb56e1aa765b4b4f3aadfab769793b7087bb03a4ea4920644a6d238e2df5b9ed" [[package]] name = "indexmap" @@ -1270,49 +1157,12 @@ dependencies = [ "hashbrown 0.14.0", ] -[[package]] -name = "indoc" -version = "2.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c785eefb63ebd0e33416dfcb8d6da0bf27ce752843a45632a67bf10d4d4b5c4" - -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "io-lifetimes" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" -dependencies = [ - "hermit-abi", - "libc", - "windows-sys", -] - [[package]] name = "ipnet" version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" -[[package]] -name = "is-terminal" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" -dependencies = [ - "hermit-abi", - "rustix 0.38.4", - "windows-sys", -] - [[package]] name = "iso8601" version = "0.6.1" @@ -1331,6 +1181,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.9" @@ -1346,74 +1205,42 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "json-rpc-api-build" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?branch=new-4.14.0-pcr#45b026c8b64ed0b60cb03deed5f478c457de645b" -dependencies = [ - "backtrace", - "heck 0.3.3", - "serde", - "toml", -] - -[[package]] -name = "jsonrpc-core" -version = "17.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4467ab6dfa369b69e52bd0692e480c4d117410538526a57a304a0f2250fd95e" -dependencies = [ - "futures", - "futures-executor", - "futures-util", - "log", - "serde", - "serde_derive", - "serde_json", -] - [[package]] name = "jsonschema" version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a071f4f7efc9a9118dfb627a0a94ef247986e1ab8606a4c806ae2b3aa3b6978" dependencies = [ - "ahash 0.8.3", + "ahash", "anyhow", - "base64 0.21.2", + "base64", "bytecount", "fancy-regex", "fraction", - "getrandom 0.2.10", + "getrandom", "iso8601", "itoa", "memchr", "num-cmp", "once_cell", - "parking_lot 0.12.1", + "parking_lot", "percent-encoding", "regex", "serde", "serde_json", - "time 0.3.23", + "time 0.3.28", "url", "uuid", ] -[[package]] -name = "keccak" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" -dependencies = [ - "cpufeatures", -] - [[package]] name = "lazy_static" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +dependencies = [ + "spin 0.5.2", +] [[package]] name = "libc" @@ -1427,23 +1254,11 @@ version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" -[[package]] -name = "linked-hash-map" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" - -[[package]] -name = "linux-raw-sys" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" - [[package]] name = "linux-raw-sys" -version = "0.4.3" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09fc20d2ca12cb9f044c93e3bd6d32d523e6e2ec3db4f7b2939cd99026ecd3f0" +checksum = "57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503" [[package]] name = "lock_api" @@ -1457,55 +1272,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" - -[[package]] -name = "lru" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999beba7b6e8345721bd280141ed958096a2e4abdf74f67ff4ce49b4b54e47a" -dependencies = [ - "hashbrown 0.12.3", -] - -[[package]] -name = "lru-cache" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c" -dependencies = [ - "linked-hash-map", -] - -[[package]] -name = "lsp-types" -version = "0.91.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2368312c59425dd133cb9a327afee65be0a633a8ce471d248e2202a48f8f68ae" -dependencies = [ - "bitflags 1.3.2", - "serde", - "serde_json", - "serde_repr", - "url", -] - -[[package]] -name = "mach" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" -dependencies = [ - "libc", -] - -[[package]] -name = "match_cfg" -version = "0.1.0" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "matchers" @@ -1518,9 +1287,9 @@ dependencies = [ [[package]] name = "matchit" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b87248edafb776e59e6ee64a79086f65890d3510f2c656c000bf2a7e8a0aea40" +checksum = "ed1202b2a6f884ae56f04cff409ab315c5ce26b5e58d7412e484f01fd52f52ef" [[package]] name = "md-5" @@ -1528,14 +1297,14 @@ version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca" dependencies = [ - "digest 0.10.7", + "digest", ] [[package]] name = "memchr" -version = "2.5.0" +version = "2.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" [[package]] name = "memoffset" @@ -1546,93 +1315,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "metrics" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e52eb6380b6d2a10eb3434aec0885374490f5b82c8aaf5cd487a183c98be834" -dependencies = [ - "ahash 0.7.6", - "metrics-macros", -] - -[[package]] -name = "metrics" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "142c53885123b68d94108295a09d4afe1a1388ed95b54d5dacd9a454753030f2" -dependencies = [ - "ahash 0.7.6", - "metrics-macros", -] - -[[package]] -name = "metrics-exporter-prometheus" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953cbbb6f9ba4b9304f4df79b98cdc9d14071ed93065a9fca11c00c5d9181b66" -dependencies = [ - "hyper", - "indexmap 1.9.3", - "ipnet", - "metrics 0.19.0", - "metrics-util 0.13.0", - "parking_lot 0.11.2", - "quanta", - "thiserror", - "tokio", - "tracing", -] - -[[package]] -name = "metrics-macros" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49e30813093f757be5cf21e50389a24dc7dbb22c49f23b7e8f51d69b508a5ffa" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "metrics-util" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65a9e83b833e1d2e07010a386b197c13aa199bbd0fca5cf69bfa147972db890a" -dependencies = [ - "aho-corasick 0.7.20", - "atomic-shim", - "crossbeam-epoch", - "crossbeam-utils", - "hashbrown 0.11.2", - "indexmap 1.9.3", - "metrics 0.18.1", - "num_cpus", - "ordered-float", - "parking_lot 0.11.2", - "quanta", - "radix_trie", - "sketches-ddsketch", -] - -[[package]] -name = "metrics-util" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd1f4b69bef1e2b392b2d4a12902f2af90bb438ba4a66aa222d1023fa6561b50" -dependencies = [ - "atomic-shim", - "crossbeam-epoch", - "crossbeam-utils", - "hashbrown 0.11.2", - "metrics 0.19.0", - "num_cpus", - "parking_lot 0.11.2", - "quanta", - "sketches-ddsketch", -] - [[package]] name = "mime" version = "0.3.17" @@ -1665,34 +1347,6 @@ dependencies = [ "windows-sys", ] -[[package]] -name = "mobc" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc79c4a77e312fee9c7bd4b957c12ad1196db73c4a81e5c0b13f02083c4f7f2f" -dependencies = [ - "async-trait", - "futures-channel", - "futures-core", - "futures-timer", - "futures-util", - "log", - "metrics 0.18.1", - "thiserror", - "tokio", - "tracing", - "tracing-subscriber", -] - -[[package]] -name = "nanoid" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ffa00dec017b5b1a8b7cf5e2c008bfda1aa7e0697ac1508b491fdf2622fb4d8" -dependencies = [ - "rand 0.8.5", -] - [[package]] name = "native-tls" version = "0.2.11" @@ -1711,15 +1365,6 @@ dependencies = [ "tempfile", ] -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - [[package]] name = "nom" version = "7.1.3" @@ -1756,9 +1401,9 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" dependencies = [ "autocfg", "num-integer", @@ -1766,16 +1411,33 @@ dependencies = [ ] [[package]] -name = "num-cmp" -version = "0.1.0" +name = "num-bigint-dig" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63335b2e2c34fae2fb0aa2cecfd9f0832a1e24b3b32ecec612c3426d46dc8aaa" - -[[package]] -name = "num-complex" -version = "0.4.3" +checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" +dependencies = [ + "byteorder", + "lazy_static", + "libm", + "num-integer", + "num-iter", + "num-traits", + "rand", + "smallvec", + "zeroize", +] + +[[package]] +name = "num-cmp" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63335b2e2c34fae2fb0aa2cecfd9f0832a1e24b3b32ecec612c3426d46dc8aaa" + +[[package]] +name = "num-complex" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e0d21255c828d6f128a1e41534206671e8c3ea0c62f32291e808dc82cff17d" +checksum = "1ba157ca0885411de85d6ca030ba7e2a83a28636056c7c699b07c8b6f7383214" dependencies = [ "num-traits", ] @@ -1815,9 +1477,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" dependencies = [ "autocfg", "libm", @@ -1835,9 +1497,9 @@ dependencies = [ [[package]] name = "object" -version = "0.31.1" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" dependencies = [ "memchr", ] @@ -1848,19 +1510,13 @@ version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" -[[package]] -name = "opaque-debug" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" - [[package]] name = "openssl" -version = "0.10.55" +version = "0.10.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "345df152bc43501c5eb9e4654ff05f794effb78d4efe3d53abc158baddc0703d" +checksum = "bac25ee399abb46215765b1cb35bc0212377e58a061560d8b29b024fd0430e7c" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.0", "cfg-if", "foreign-types", "libc", @@ -1877,7 +1533,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.29", ] [[package]] @@ -1888,9 +1544,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.90" +version = "0.9.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "374533b0e45f3a7ced10fcaeccca020e66656bc03dac384f852e4e5a7a8104a6" +checksum = "db7e971c2c2bba161b2d2fdf37080177eff520b3bc044787c7f1f5f9e78d869b" dependencies = [ "cc", "libc", @@ -1899,41 +1555,10 @@ dependencies = [ ] [[package]] -name = "opentelemetry" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6105e89802af13fdf48c49d7646d3b533a70e536d818aae7e78ba0433d01acb8" -dependencies = [ - "async-trait", - "crossbeam-channel", - "futures-channel", - "futures-executor", - "futures-util", - "js-sys", - "lazy_static", - "percent-encoding", - "pin-project", - "rand 0.8.5", - "serde", - "thiserror", - "tokio", - "tokio-stream", -] - -[[package]] -name = "ordered-float" -version = "2.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7940cf2ca942593318d07fcf2596cdca60a85c9e7fab408a5e21a4f9dcd40d87" -dependencies = [ - "num-traits", -] - -[[package]] -name = "ordermap" -version = "0.3.5" +name = "option-ext" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a86ed3f5f244b372d6b1a00b72ef7f8876d0bc6a78a4c9985c53614041512063" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] name = "overload" @@ -1941,17 +1566,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" -[[package]] -name = "parking_lot" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" -dependencies = [ - "instant", - "lock_api", - "parking_lot_core 0.8.6", -] - [[package]] name = "parking_lot" version = "0.12.1" @@ -1959,21 +1573,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", - "parking_lot_core 0.9.8", -] - -[[package]] -name = "parking_lot_core" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" -dependencies = [ - "cfg-if", - "instant", - "libc", - "redox_syscall 0.2.16", - "smallvec", - "winapi", + "parking_lot_core", ] [[package]] @@ -1989,24 +1589,21 @@ dependencies = [ "windows-targets", ] -[[package]] -name = "parser-database" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?branch=new-4.14.0-pcr#45b026c8b64ed0b60cb03deed5f478c457de645b" -dependencies = [ - "diagnostics", - "either", - "enumflags2", - "indexmap 1.9.3", - "schema-ast", -] - [[package]] name = "paste" version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" +[[package]] +name = "pem-rfc7468" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" +dependencies = [ + "base64ct", +] + [[package]] name = "percent-encoding" version = "2.3.0" @@ -2015,19 +1612,20 @@ checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "pest" -version = "2.7.1" +version = "2.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d2d1d55045829d65aad9d389139882ad623b33b904e7c9f1b10c5b8927298e5" +checksum = "d7a4d085fd991ac8d5b05a147b437791b4260b76326baf0fc60cf7c9c27ecd33" dependencies = [ + "memchr", "thiserror", "ucd-trie", ] [[package]] name = "pest_derive" -version = "2.7.1" +version = "2.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f94bca7e7a599d89dea5dfa309e217e7906c3c007fb9c3299c40b10d6a315d3" +checksum = "a2bee7be22ce7918f641a33f08e3f43388c7656772244e2bbb2477f44cc9021a" dependencies = [ "pest", "pest_generator", @@ -2035,81 +1633,53 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.1" +version = "2.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99d490fe7e8556575ff6911e45567ab95e71617f43781e5c05490dc8d75c965c" +checksum = "d1511785c5e98d79a05e8a6bc34b4ac2168a0e3e92161862030ad84daa223141" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.29", ] [[package]] name = "pest_meta" -version = "2.7.1" +version = "2.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2674c66ebb4b4d9036012091b537aae5878970d6999f81a265034d85b136b341" +checksum = "b42f0394d3123e33353ca5e1e89092e533d2cc490389f2bd6131c43c634ebc5f" dependencies = [ "once_cell", "pest", - "sha2 0.10.7", -] - -[[package]] -name = "petgraph" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c3659d1ee90221741f65dd128d9998311b0e40c5d3c23a62445938214abce4f" -dependencies = [ - "fixedbitset", - "ordermap", -] - -[[package]] -name = "phf" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" -dependencies = [ - "phf_shared", -] - -[[package]] -name = "phf_shared" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" -dependencies = [ - "siphasher", + "sha2", ] [[package]] name = "pin-project" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "030ad2bc4db10a8944cb0d837f158bdfec4d4a4873ab701a95046770d11f8842" +checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec2e072ecce94ec471b13398d5402c188e76ac03cf74dd1a975161b23a3f6d9c" +checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.29", ] [[package]] name = "pin-project-lite" -version = "0.2.10" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c40d25201921e5ff0c862a505c6557ea88568a4e3ace775ab55e93f2f4f9d57" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -2118,52 +1688,40 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] -name = "pkg-config" -version = "0.3.27" +name = "pkcs1" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" - -[[package]] -name = "postgres-native-tls" -version = "0.5.0" -source = "git+https://github.com/prisma/rust-postgres?branch=pgbouncer-mode#00d4815e58859261bdfca71c75be7dc657303f7d" +checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f" dependencies = [ - "native-tls", - "tokio", - "tokio-native-tls", - "tokio-postgres", + "der", + "pkcs8", + "spki", ] [[package]] -name = "postgres-protocol" -version = "0.6.4" -source = "git+https://github.com/prisma/rust-postgres?branch=pgbouncer-mode#00d4815e58859261bdfca71c75be7dc657303f7d" +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ - "base64 0.13.1", - "byteorder", - "bytes", - "fallible-iterator", - "hmac", - "md-5", - "memchr", - "rand 0.8.5", - "sha2 0.10.7", - "stringprep", + "der", + "spki", ] [[package]] -name = "postgres-types" -version = "0.2.4" -source = "git+https://github.com/prisma/rust-postgres?branch=pgbouncer-mode#00d4815e58859261bdfca71c75be7dc657303f7d" +name = "pkg-config" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" + +[[package]] +name = "pluralizer" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35e4616e94b67b8b61846ea69d4bf041a62147d569d16f437689229e2677d38c" dependencies = [ - "bit-vec", - "bytes", - "chrono", - "fallible-iterator", - "postgres-protocol", - "serde", - "serde_json", - "uuid", + "lazy_static", + "regex", ] [[package]] @@ -2173,489 +1731,243 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] -name = "prisma-cli" -version = "0.0.0" +name = "proc-macro-crate" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ - "prisma-client-rust-cli", + "once_cell", + "toml_edit", ] [[package]] -name = "prisma-client-rust" -version = "0.6.8" -source = "git+https://github.com/Brendonovich/prisma-client-rust?rev=bb1c2d3#bb1c2d3732cda905ff2074a91d679f9ee19a3468" +name = "proc-macro2" +version = "1.0.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ - "base64 0.13.1", - "bigdecimal", - "chrono", - "diagnostics", - "dotenv", - "futures", - "include_dir", - "indexmap 1.9.3", - "paste", - "prisma-client-rust-macros", - "prisma-models", - "psl", - "query-core", - "request-handlers", - "schema-core", - "serde", - "serde-value", - "serde_json", - "tempdir", - "thiserror", - "tokio", - "tracing", - "user-facing-errors", - "uuid", + "unicode-ident", ] [[package]] -name = "prisma-client-rust-cli" -version = "0.6.8" -source = "git+https://github.com/Brendonovich/prisma-client-rust?rev=bb1c2d3#bb1c2d3732cda905ff2074a91d679f9ee19a3468" +name = "quickcheck" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "588f6378e4dd99458b60ec275b4477add41ce4fa9f64dcba6f15adccb19b50d6" dependencies = [ - "directories", - "flate2", - "http", - "prisma-client-rust-generator", - "proc-macro2", - "quote", - "regex", - "reqwest", - "serde", - "serde_json", - "serde_path_to_error", - "syn 1.0.109", - "thiserror", + "env_logger", + "log", + "rand", ] [[package]] -name = "prisma-client-rust-generator" -version = "0.6.8" -source = "git+https://github.com/Brendonovich/prisma-client-rust?rev=bb1c2d3#bb1c2d3732cda905ff2074a91d679f9ee19a3468" +name = "quote" +version = "1.0.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ - "directories", - "flate2", - "http", - "prisma-client-rust-sdk", "proc-macro2", - "quote", - "regex", - "reqwest", - "serde", - "serde_json", - "serde_path_to_error", - "syn 1.0.109", - "thiserror", ] [[package]] -name = "prisma-client-rust-macros" -version = "0.6.8" -source = "git+https://github.com/Brendonovich/prisma-client-rust?rev=bb1c2d3#bb1c2d3732cda905ff2074a91d679f9ee19a3468" +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ - "convert_case 0.6.0", - "proc-macro2", - "quote", - "syn 1.0.109", + "libc", + "rand_chacha", + "rand_core", ] [[package]] -name = "prisma-client-rust-sdk" -version = "0.6.8" -source = "git+https://github.com/Brendonovich/prisma-client-rust?rev=bb1c2d3#bb1c2d3732cda905ff2074a91d679f9ee19a3468" +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ - "convert_case 0.5.0", - "dmmf", - "prisma-models", - "proc-macro2", - "psl", - "query-core", - "quote", - "request-handlers", - "serde", - "serde_json", - "serde_path_to_error", - "syn 1.0.109", - "thiserror", + "ppv-lite86", + "rand_core", ] [[package]] -name = "prisma-models" -version = "0.0.0" -source = "git+https://github.com/Brendonovich/prisma-engines?branch=new-4.14.0-pcr#45b026c8b64ed0b60cb03deed5f478c457de645b" +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "bigdecimal", - "chrono", - "cuid", - "itertools", - "nanoid", - "prisma-value", - "psl", - "thiserror", - "uuid", + "getrandom", ] [[package]] -name = "prisma-value" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?branch=new-4.14.0-pcr#45b026c8b64ed0b60cb03deed5f478c457de645b" +name = "rbatis" +version = "4.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "407b46669c2d37f066d82037f9be9aeb8de49f9dfb866f0dd4f7d2f4647ca34b" dependencies = [ - "base64 0.13.1", - "bigdecimal", - "chrono", - "once_cell", - "regex", + "crossbeam", + "dark-std", + "fastdate", + "futures", + "futures-core", + "hex", + "log", + "rand", + "rbatis-codegen", + "rbatis-macro-driver", + "rbdc", + "rbs", "serde", - "serde_json", - "uuid", ] [[package]] -name = "proc-macro2" -version = "1.0.66" +name = "rbatis-codegen" +version = "4.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +checksum = "21925368dd37d1c9e7b6a14e914994adfa87c5dcc7cb1c928e08ecda9ac9dd80" dependencies = [ - "unicode-ident", + "async-trait", + "base64", + "html_parser", + "proc-macro2", + "quote", + "rbs", + "serde", + "serde_json", + "syn 2.0.29", + "url", ] [[package]] -name = "proptest" -version = "1.2.0" +name = "rbatis-macro-driver" +version = "4.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e35c06b98bf36aba164cc17cb25f7e232f5c4aeea73baa14b8a9f0d92dbfa65" +checksum = "4784033814eccca6e3e8cf0e911fbf74dc49f9b09a2e29e7542799a60f37daea" dependencies = [ - "bit-set", - "bitflags 1.3.2", - "byteorder", - "lazy_static", - "num-traits", - "rand 0.8.5", - "rand_chacha 0.3.1", - "rand_xorshift", - "regex-syntax 0.6.29", - "rusty-fork", - "tempfile", - "unarray", + "proc-macro2", + "quote", + "rbatis-codegen", + "syn 2.0.29", ] [[package]] -name = "psl" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?branch=new-4.14.0-pcr#45b026c8b64ed0b60cb03deed5f478c457de645b" +name = "rbdc" +version = "4.3.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48e30387aba9f3956852e99266bedc21d192b39b41df7be4a908d8f24531b7bb" dependencies = [ - "builtin-psl-connectors", - "psl-core", + "async-trait", + "bigdecimal", + "bytes", + "deadpool", + "fastdate", + "futures-channel", + "futures-core", + "futures-util", + "hashlink", + "itoa", + "log", + "memchr", + "native-tls", + "rbs", + "serde", + "serde_bytes", + "serde_json", + "tokio", + "tokio-native-tls", + "uuid", ] [[package]] -name = "psl-core" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?branch=new-4.14.0-pcr#45b026c8b64ed0b60cb03deed5f478c457de645b" -dependencies = [ - "bigdecimal", - "chrono", - "diagnostics", - "enumflags2", - "indoc", - "itertools", - "lsp-types", - "once_cell", - "parser-database", - "prisma-value", - "regex", - "schema-ast", - "serde", - "serde_json", - "url", -] - -[[package]] -name = "quaint" -version = "0.2.0-alpha.13" -source = "git+https://github.com/Brendonovich/prisma-engines?branch=new-4.14.0-pcr#45b026c8b64ed0b60cb03deed5f478c457de645b" +name = "rbdc-mysql" +version = "4.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1d72e9d9dbd8a0c38aba69cd204e73553c589d22ceb6b65c7fbd4bcbfe0752e" dependencies = [ - "async-trait", - "base64 0.12.3", - "bigdecimal", - "bit-vec", + "bitflags 2.4.0", "byteorder", "bytes", - "chrono", - "connection-string", - "futures", + "digest", + "either", + "fastdate", + "futures-core", + "futures-util", + "generic-array", "hex", - "lru-cache", - "metrics 0.18.1", - "mobc", - "native-tls", - "num_cpus", + "log", "percent-encoding", - "postgres-native-tls", - "postgres-types", - "serde_json", - "sqlformat", - "thiserror", - "tokio", - "tokio-postgres", - "tracing", - "tracing-core", + "rand", + "rbdc", + "rbs", + "rsa", + "serde", + "sha-1", + "sha2", + "smallvec", "url", - "uuid", ] [[package]] -name = "quanta" -version = "0.9.3" +name = "rbdc-pg" +version = "4.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20afe714292d5e879d8b12740aa223c6a88f118af41870e8b6196e39a02238a8" -dependencies = [ - "crossbeam-utils", - "libc", - "mach", - "once_cell", - "raw-cpuid", - "wasi 0.10.0+wasi-snapshot-preview1", - "web-sys", - "winapi", -] - -[[package]] -name = "query-connector" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?branch=new-4.14.0-pcr#45b026c8b64ed0b60cb03deed5f478c457de645b" +checksum = "e950c0ffa3f0a8eb55ac3a0b4c14cb1a1305e3a662cae1a8b01911a1ac3d3807" dependencies = [ - "anyhow", - "async-trait", - "chrono", - "futures", - "indexmap 1.9.3", - "itertools", - "prisma-models", - "prisma-value", - "serde", - "serde_json", - "thiserror", - "user-facing-errors", - "uuid", -] - -[[package]] -name = "query-core" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?branch=new-4.14.0-pcr#45b026c8b64ed0b60cb03deed5f478c457de645b" -dependencies = [ - "async-trait", + "atoi", + "base64", "bigdecimal", - "chrono", - "connection-string", - "crossbeam-channel", - "cuid", - "enumflags2", - "futures", - "indexmap 1.9.3", - "itertools", - "lru", - "once_cell", - "opentelemetry", - "petgraph", - "prisma-models", - "psl", - "query-connector", - "query-engine-metrics", - "schema", + "byteorder", + "bytes", + "dirs", + "either", + "fastdate", + "futures-channel", + "futures-core", + "futures-util", + "hmac", + "itoa", + "log", + "md-5", + "memchr", + "num-bigint", + "percent-encoding", + "rand", + "rbdc", + "rbs", "serde", - "serde_json", - "thiserror", - "tokio", - "tracing", - "tracing-futures", - "tracing-opentelemetry", - "tracing-subscriber", - "user-facing-errors", + "sha2", + "smallvec", + "stringprep", + "url", "uuid", + "whoami", ] [[package]] -name = "query-engine-metrics" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?branch=new-4.14.0-pcr#45b026c8b64ed0b60cb03deed5f478c457de645b" -dependencies = [ - "metrics 0.18.1", - "metrics-exporter-prometheus", - "metrics-util 0.12.1", - "once_cell", - "parking_lot 0.12.1", - "serde", - "serde_json", - "tracing", - "tracing-futures", - "tracing-subscriber", -] - -[[package]] -name = "quick-error" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" - -[[package]] -name = "quote" -version = "1.0.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fe8a65d69dd0808184ebb5f836ab526bb259db23c657efa38711b1072ee47f0" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" +name = "rbs" +version = "4.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +checksum = "b2745c83350eb46c0ccae3a6df0b2bd380d43fc946ffcddf1ed9d980f257f145" dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "rand" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" -dependencies = [ - "fuchsia-cprng", - "libc", - "rand_core 0.3.1", - "rdrand", - "winapi", -] - -[[package]] -name = "rand" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" -dependencies = [ - "getrandom 0.1.16", - "libc", - "rand_chacha 0.2.2", - "rand_core 0.5.1", - "rand_hc", -] - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha 0.3.1", - "rand_core 0.6.4", -] - -[[package]] -name = "rand_chacha" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" -dependencies = [ - "ppv-lite86", - "rand_core 0.5.1", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core 0.6.4", -] - -[[package]] -name = "rand_core" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" -dependencies = [ - "rand_core 0.4.2", -] - -[[package]] -name = "rand_core" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" - -[[package]] -name = "rand_core" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" -dependencies = [ - "getrandom 0.1.16", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom 0.2.10", -] - -[[package]] -name = "rand_hc" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" -dependencies = [ - "rand_core 0.5.1", -] - -[[package]] -name = "rand_xorshift" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" -dependencies = [ - "rand_core 0.6.4", -] - -[[package]] -name = "raw-cpuid" -version = "10.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c297679cb867470fa8c9f67dbba74a78d78e3e98d7cf2b08d6d71540f797332" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "rdrand" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" -dependencies = [ - "rand_core 0.3.1", + "byteorder", + "num-traits", + "quickcheck", + "rmp", + "serde", + "serde_bytes", + "serde_derive", ] [[package]] name = "redis" -version = "0.23.1" +version = "0.23.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff5d95dd18a4d76650f0c2607ed8ebdbf63baf9cb934e1c233cd220c694db1d7" +checksum = "4f49cdc0bb3f412bf8e7d1bd90fe1d9eb10bc5c399ba90973c14662a27b3f8ba" dependencies = [ "arc-swap", "async-trait", "bytes", - "combine 4.6.6", + "combine", "futures", "futures-util", "itoa", @@ -2663,7 +1975,7 @@ dependencies = [ "pin-project-lite", "ryu", "sha1_smol", - "socket2", + "socket2 0.4.9", "tokio", "tokio-retry", "tokio-util", @@ -2694,21 +2006,21 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" dependencies = [ - "getrandom 0.2.10", + "getrandom", "redox_syscall 0.2.16", "thiserror", ] [[package]] name = "regex" -version = "1.9.1" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2eae68fc220f7cf2532e4494aded17545fce192d59cd996e0fe7887f4ceb575" +checksum = "697061221ea1b4a94a624f67d0ae2bfe4e22b8a17b6a192afb11046542cc8c47" dependencies = [ - "aho-corasick 1.0.2", + "aho-corasick", "memchr", - "regex-automata 0.3.3", - "regex-syntax 0.7.4", + "regex-automata 0.3.8", + "regex-syntax 0.7.5", ] [[package]] @@ -2722,13 +2034,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.3" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39354c10dd07468c2e73926b23bb9c2caca74c5501e38a35da70406f1d923310" +checksum = "c2f401f4955220693b56f8ec66ee9c78abffd8d1c4f23dc41a23839eb88f0795" dependencies = [ - "aho-corasick 1.0.2", + "aho-corasick", "memchr", - "regex-syntax 0.7.4", + "regex-syntax 0.7.5", ] [[package]] @@ -2739,50 +2051,17 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" - -[[package]] -name = "remove_dir_all" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" -dependencies = [ - "winapi", -] - -[[package]] -name = "request-handlers" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?branch=new-4.14.0-pcr#45b026c8b64ed0b60cb03deed5f478c457de645b" -dependencies = [ - "bigdecimal", - "connection-string", - "dmmf", - "futures", - "graphql-parser", - "indexmap 1.9.3", - "itertools", - "prisma-models", - "psl", - "query-core", - "serde", - "serde_json", - "sql-query-connector", - "thiserror", - "tracing", - "url", - "user-facing-errors", -] +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" [[package]] name = "reqwest" -version = "0.11.18" +version = "0.11.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" +checksum = "3e9ad3fe7488d7e34558a2033d45a0c90b72d97b4f80705666fea71472e2e6a1" dependencies = [ - "base64 0.21.2", + "base64", "bytes", "encoding_rs", "futures-core", @@ -2814,41 +2093,60 @@ dependencies = [ ] [[package]] -name = "rustc-demangle" -version = "0.1.23" +name = "retain_mut" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "4389f1d5789befaf6029ebd9f7dac4af7f7e3d61b69d4f30e2ac02b57e7712b0" [[package]] -name = "rustc-hash" -version = "1.1.0" +name = "rmp" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +checksum = "7f9860a6cc38ed1da53456442089b4dfa35e7cedaa326df63017af88385e6b20" +dependencies = [ + "byteorder", + "num-traits", + "paste", +] [[package]] -name = "rustix" -version = "0.37.23" +name = "rsa" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06" +checksum = "6ab43bb47d23c1a631b4b680199a45255dce26fa9ab2fa902581f624ff13e6a8" dependencies = [ - "bitflags 1.3.2", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys 0.3.8", - "windows-sys", + "byteorder", + "const-oid", + "digest", + "num-bigint-dig", + "num-integer", + "num-iter", + "num-traits", + "pkcs1", + "pkcs8", + "rand_core", + "signature", + "spki", + "subtle", + "zeroize", ] +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + [[package]] name = "rustix" -version = "0.38.4" +version = "0.38.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a962918ea88d644592894bc6dc55acc6c0956488adcebbfb6e273506b7fd6e5" +checksum = "c0c3dde1fc030af041adc40e79c0e7fbcf431dd24870053d187d7c66e4b87453" dependencies = [ - "bitflags 2.3.3", + "bitflags 2.4.0", "errno", "libc", - "linux-raw-sys 0.4.3", + "linux-raw-sys", "windows-sys", ] @@ -2858,18 +2156,6 @@ version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" -[[package]] -name = "rusty-fork" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f" -dependencies = [ - "fnv", - "quick-error", - "tempfile", - "wait-timeout", -] - [[package]] name = "ryu" version = "1.0.15" @@ -2885,72 +2171,11 @@ dependencies = [ "windows-sys", ] -[[package]] -name = "schema" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?branch=new-4.14.0-pcr#45b026c8b64ed0b60cb03deed5f478c457de645b" -dependencies = [ - "once_cell", - "prisma-models", - "psl", - "rustc-hash", -] - -[[package]] -name = "schema-ast" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?branch=new-4.14.0-pcr#45b026c8b64ed0b60cb03deed5f478c457de645b" -dependencies = [ - "diagnostics", - "pest", - "pest_derive", -] - -[[package]] -name = "schema-connector" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?branch=new-4.14.0-pcr#45b026c8b64ed0b60cb03deed5f478c457de645b" -dependencies = [ - "chrono", - "enumflags2", - "psl", - "quaint", - "serde", - "serde_json", - "sha2 0.9.9", - "tracing", - "tracing-error", - "user-facing-errors", -] - -[[package]] -name = "schema-core" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?branch=new-4.14.0-pcr#45b026c8b64ed0b60cb03deed5f478c457de645b" -dependencies = [ - "async-trait", - "chrono", - "enumflags2", - "json-rpc-api-build", - "jsonrpc-core", - "psl", - "schema-connector", - "serde", - "serde_json", - "sql-schema-connector", - "tokio", - "tracing", - "tracing-futures", - "tracing-subscriber", - "url", - "user-facing-errors", -] - [[package]] name = "schemars" -version = "0.8.12" +version = "0.8.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02c613288622e5f0c3fdc5dbd4db1c5fbe752746b1d1a56a0630b78fd00de44f" +checksum = "763f8cd0d4c71ed8389c90cb8100cba87e763bd01a8e614d4f0af97bcd50a161" dependencies = [ "chrono", "dyn-clone", @@ -2959,13 +2184,14 @@ dependencies = [ "serde", "serde_json", "url", + "uuid", ] [[package]] name = "schemars_derive" -version = "0.8.12" +version = "0.8.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "109da1e6b197438deb6db99952990c7f959572794b80ff93707d55a232545e7c" +checksum = "ec0f696e21e10fa546b7ffb1c9672c6de8fbc7a81acf59524386d8639bf12737" dependencies = [ "proc-macro2", "quote", @@ -2975,15 +2201,15 @@ dependencies = [ [[package]] name = "scopeguard" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "security-framework" -version = "2.9.1" +version = "2.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fc758eb7bffce5b308734e9b0c1468893cae9ff70ebf13e7090be8dcbcc83a8" +checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" dependencies = [ "bitflags 1.3.2", "core-foundation", @@ -2994,9 +2220,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.9.0" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f51d0c0d83bec45f16480d0ce0058397a69e48fcdc52d1dc8855fb68acbd31a7" +checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" dependencies = [ "core-foundation-sys", "libc", @@ -3004,32 +2230,31 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.171" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30e27d1e4fd7659406c492fd6cfaf2066ba8773de45ca75e855590f856dc34a9" +checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" dependencies = [ "serde_derive", ] [[package]] -name = "serde-value" -version = "0.7.0" +name = "serde_bytes" +version = "0.11.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3a1a3341211875ef120e117ea7fd5228530ae7e7036a779fdc9117be6b3282c" +checksum = "ab33ec92f677585af6d88c65593ae2375adde54efdbf16d597f2cbc7a6d368ff" dependencies = [ - "ordered-float", "serde", ] [[package]] name = "serde_derive" -version = "1.0.171" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "389894603bd18c46fa56231694f8d827779c0951a667087194cf9de94ed24682" +checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.29", ] [[package]] @@ -3045,11 +2270,10 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.104" +version = "1.0.105" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "076066c5f1078eac5b722a31827a8832fe108bed65dfa75e233c89f8206e976c" +checksum = "693151e1ac27563d6dbcec9dee9fbd5da8539b20fa14ad3752b2e6d363ace360" dependencies = [ - "indexmap 2.0.0", "itoa", "ryu", "serde", @@ -3078,17 +2302,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "serde_repr" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d89a8107374290037607734c0b73a85db7ed80cae314b3c5791f192a496e731" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.26", -] - [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -3101,6 +2314,17 @@ dependencies = [ "serde", ] +[[package]] +name = "sha-1" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5058ada175748e33390e40e872bd0fe59a19f265d0158daa551c5a88a76009c" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + [[package]] name = "sha1" version = "0.10.5" @@ -3109,7 +2333,7 @@ checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.7", + "digest", ] [[package]] @@ -3118,19 +2342,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" -[[package]] -name = "sha2" -version = "0.9.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" -dependencies = [ - "block-buffer 0.9.0", - "cfg-if", - "cpufeatures", - "digest 0.9.0", - "opaque-debug", -] - [[package]] name = "sha2" version = "0.10.7" @@ -3139,17 +2350,20 @@ checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.7", + "digest", ] [[package]] -name = "sha3" -version = "0.10.8" +name = "sha256" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +checksum = "7895c8ae88588ccead14ff438b939b0c569cd619116f14b4d13fdff7b8333386" dependencies = [ - "digest 0.10.7", - "keccak", + "async-trait", + "bytes", + "hex", + "sha2", + "tokio", ] [[package]] @@ -3171,22 +2385,20 @@ dependencies = [ ] [[package]] -name = "siphasher" -version = "0.3.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" - -[[package]] -name = "sketches-ddsketch" -version = "0.1.3" +name = "signature" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04d2ecae5fcf33b122e2e6bd520a57ccf152d2dde3b38c71039df1a6867264ee" +checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" +dependencies = [ + "digest", + "rand_core", +] [[package]] name = "slab" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg", ] @@ -3208,112 +2420,38 @@ dependencies = [ ] [[package]] -name = "sql-ddl" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?branch=new-4.14.0-pcr#45b026c8b64ed0b60cb03deed5f478c457de645b" - -[[package]] -name = "sql-query-connector" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?branch=new-4.14.0-pcr#45b026c8b64ed0b60cb03deed5f478c457de645b" -dependencies = [ - "anyhow", - "async-trait", - "bigdecimal", - "chrono", - "cuid", - "futures", - "itertools", - "once_cell", - "opentelemetry", - "prisma-models", - "prisma-value", - "psl", - "quaint", - "query-connector", - "rand 0.7.3", - "serde", - "serde_json", - "thiserror", - "tokio", - "tracing", - "tracing-futures", - "tracing-opentelemetry", - "user-facing-errors", - "uuid", -] - -[[package]] -name = "sql-schema-connector" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?branch=new-4.14.0-pcr#45b026c8b64ed0b60cb03deed5f478c457de645b" +name = "socket2" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" dependencies = [ - "chrono", - "connection-string", - "datamodel-renderer", - "either", - "enumflags2", - "indoc", - "once_cell", - "prisma-value", - "psl", - "quaint", - "regex", - "schema-connector", - "serde", - "serde_json", - "sql-ddl", - "sql-schema-describer", - "sqlformat", - "sqlparser", - "tokio", - "tracing", - "tracing-futures", - "url", - "user-facing-errors", - "uuid", + "libc", + "windows-sys", ] [[package]] -name = "sql-schema-describer" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?branch=new-4.14.0-pcr#45b026c8b64ed0b60cb03deed5f478c457de645b" -dependencies = [ - "async-trait", - "bigdecimal", - "either", - "enumflags2", - "indexmap 1.9.3", - "indoc", - "once_cell", - "prisma-value", - "psl", - "quaint", - "regex", - "serde", - "tracing", - "tracing-error", - "tracing-futures", -] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] -name = "sqlformat" -version = "0.2.1" +name = "spin" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c12bc9199d1db8234678b7051747c07f517cdcf019262d1847b94ec8b1aee3e" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" dependencies = [ - "itertools", - "nom", - "unicode_categories", + "lock_api", ] [[package]] -name = "sqlparser" -version = "0.32.0" +name = "spki" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0366f270dbabb5cc2e4c88427dc4c08bba144f81e32fbd459a013f26a4d16aa0" +checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" dependencies = [ - "log", + "base64ct", + "der", ] [[package]] @@ -3326,6 +2464,12 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + [[package]] name = "subtle" version = "2.5.0" @@ -3345,9 +2489,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.26" +version = "2.0.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45c3457aacde3c65315de5031ec191ce46604304d2446e803d71ade03308d970" +checksum = "c324c494eba9d92503e6f1ef2e6df781e78f6a7705a0202d9801b198807d518a" dependencies = [ "proc-macro2", "quote", @@ -3360,60 +2504,37 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" -[[package]] -name = "synstructure" -version = "0.12.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", - "unicode-xid", -] - -[[package]] -name = "tempdir" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8" -dependencies = [ - "rand 0.4.6", - "remove_dir_all", -] - [[package]] name = "tempfile" -version = "3.6.0" +version = "3.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31c0432476357e58790aaa47a8efb0c5138f137343f3b5f23bd36a27e3b0a6d6" +checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" dependencies = [ - "autocfg", "cfg-if", "fastrand", "redox_syscall 0.3.5", - "rustix 0.37.23", + "rustix", "windows-sys", ] [[package]] name = "thiserror" -version = "1.0.43" +version = "1.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a35fc5b8971143ca348fa6df4f024d4d55264f3468c71ad1c2f365b0a4d58c42" +checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.43" +version = "1.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "463fe12d7993d3b327787537ce8dd4dfa058de32fc2b195ef3cde03dc4771e8f" +checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.29", ] [[package]] @@ -3439,10 +2560,11 @@ dependencies = [ [[package]] name = "time" -version = "0.3.23" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59e399c068f43a5d116fedaf73b203fa4f9c519f17e2b34f63221d3792f81446" +checksum = "17f6bb557fd245c28e6411aa56b6403c689ad95061f50e4be16c274e70a17e48" dependencies = [ + "deranged", "serde", "time-core", "time-macros", @@ -3456,9 +2578,9 @@ checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" [[package]] name = "time-macros" -version = "0.2.10" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96ba15a897f3c86766b757e5ac7221554c6750054d74d5b28844fce5fb36a6c4" +checksum = "1a942f44339478ef67935ab2bbaec2fb0322496cf3cbe84b261e06ac3814c572" dependencies = [ "time-core", ] @@ -3480,20 +2602,19 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.29.1" +version = "1.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "532826ff75199d5833b9d2c5fe410f29235e25704ee5f0ef599fb51c21f4a4da" +checksum = "17ed6077ed6cd6c74735e21f37eb16dc3935f96878b1fe961074089cc80893f9" dependencies = [ - "autocfg", "backtrace", "bytes", "libc", "mio", "num_cpus", - "parking_lot 0.12.1", + "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2", + "socket2 0.5.3", "tokio-macros", "windows-sys", ] @@ -3506,7 +2627,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.29", ] [[package]] @@ -3519,29 +2640,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-postgres" -version = "0.7.7" -source = "git+https://github.com/prisma/rust-postgres?branch=pgbouncer-mode#00d4815e58859261bdfca71c75be7dc657303f7d" -dependencies = [ - "async-trait", - "byteorder", - "bytes", - "fallible-iterator", - "futures-channel", - "futures-util", - "log", - "parking_lot 0.12.1", - "percent-encoding", - "phf", - "pin-project-lite", - "postgres-protocol", - "postgres-types", - "socket2", - "tokio", - "tokio-util", -] - [[package]] name = "tokio-retry" version = "0.3.0" @@ -3549,18 +2647,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f57eb36ecbe0fc510036adff84824dd3c24bb781e21bfa67b69d556aa85214f" dependencies = [ "pin-project", - "rand 0.8.5", - "tokio", -] - -[[package]] -name = "tokio-stream" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" -dependencies = [ - "futures-core", - "pin-project-lite", + "rand", "tokio", ] @@ -3579,12 +2666,20 @@ dependencies = [ ] [[package]] -name = "toml" -version = "0.5.11" +name = "toml_datetime" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" + +[[package]] +name = "toml_edit" +version = "0.19.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" dependencies = [ - "serde", + "indexmap 2.0.0", + "toml_datetime", + "winnow", ] [[package]] @@ -3636,7 +2731,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.29", ] [[package]] @@ -3649,26 +2744,6 @@ dependencies = [ "valuable", ] -[[package]] -name = "tracing-error" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d686ec1c0f384b1277f097b2f279a2ecc11afe8c133c1aabf036a27cb4cd206e" -dependencies = [ - "tracing", - "tracing-subscriber", -] - -[[package]] -name = "tracing-futures" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" -dependencies = [ - "pin-project", - "tracing", -] - [[package]] name = "tracing-log" version = "0.1.3" @@ -3680,20 +2755,6 @@ dependencies = [ "tracing-core", ] -[[package]] -name = "tracing-opentelemetry" -version = "0.17.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbbe89715c1dbbb790059e2565353978564924ee85017b5fff365c872ff6721f" -dependencies = [ - "once_cell", - "opentelemetry", - "tracing", - "tracing-core", - "tracing-log", - "tracing-subscriber", -] - [[package]] name = "tracing-subscriber" version = "0.3.17" @@ -3730,12 +2791,6 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" -[[package]] -name = "unarray" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" - [[package]] name = "unicode-bidi" version = "0.3.13" @@ -3757,38 +2812,11 @@ dependencies = [ "tinyvec", ] -[[package]] -name = "unicode-segmentation" -version = "1.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" - -[[package]] -name = "unicode-xid" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" - -[[package]] -name = "unicode_categories" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" - -[[package]] -name = "unreachable" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" -dependencies = [ - "void", -] - [[package]] name = "url" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" dependencies = [ "form_urlencoded", "idna", @@ -3796,38 +2824,13 @@ dependencies = [ "serde", ] -[[package]] -name = "user-facing-error-macros" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?branch=new-4.14.0-pcr#45b026c8b64ed0b60cb03deed5f478c457de645b" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "user-facing-errors" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?branch=new-4.14.0-pcr#45b026c8b64ed0b60cb03deed5f478c457de645b" -dependencies = [ - "backtrace", - "indoc", - "itertools", - "quaint", - "serde", - "serde_json", - "tracing", - "user-facing-error-macros", -] - [[package]] name = "uuid" version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" dependencies = [ - "getrandom 0.2.10", + "getrandom", "serde", ] @@ -3849,21 +2852,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "void" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" - -[[package]] -name = "wait-timeout" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6" -dependencies = [ - "libc", -] - [[package]] name = "want" version = "0.3.1" @@ -3873,12 +2861,6 @@ dependencies = [ "try-lock", ] -[[package]] -name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" - [[package]] name = "wasi" version = "0.10.0+wasi-snapshot-preview1" @@ -3912,7 +2894,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.29", "wasm-bindgen-shared", ] @@ -3946,7 +2928,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.29", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -3967,6 +2949,16 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "whoami" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22fc3756b8a9133049b26c7f61ab35416c130e8c09b660f5b3958b446f52cc50" +dependencies = [ + "wasm-bindgen", + "web-sys", +] + [[package]] name = "winapi" version = "0.3.9" @@ -4009,9 +3001,9 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.48.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ "windows_aarch64_gnullvm", "windows_aarch64_msvc", @@ -4024,51 +3016,67 @@ dependencies = [ [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_i686_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_x86_64_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_msvc" -version = "0.48.0" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "winnow" +version = "0.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "7c2e3184b9c4e92ad5167ca73039d0c42476302ab603e2fec4487511f38ccefc" +dependencies = [ + "memchr", +] [[package]] name = "winreg" -version = "0.10.1" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ - "winapi", + "cfg-if", + "windows-sys", ] + +[[package]] +name = "zeroize" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" diff --git a/api/Cargo.toml b/api/Cargo.toml index 3bab39b..34fefe7 100644 --- a/api/Cargo.toml +++ b/api/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" default-run = "dyson-api" [dependencies] -url = "2.4.0" +url = { version = "2.4.0", features = ["serde"] } anyhow = "1.0.72" tracing = "0.1.37" dotenvy = "0.15.7" @@ -15,23 +15,17 @@ aide = { version = "0.11.0", features = ["axum"] } tokio = { version = "1.29.1", features = ["full"] } serde = { version = "1.0.171", features = ["derive"] } reqwest = { version = "0.11.18", features = ["json"] } +ensemble = { version = "0.0.3", features = ["postgres"] } axum-jsonschema = { version = "0.6.0", features = ["aide"] } axum = { version = "0.6.19", features = ["headers", "macros"] } -schemars = { version = "0.8.12", features = ["url", "chrono"] } tracing-subscriber = { version = "0.3.17", features = ["env-filter"] } -prisma-client-rust = { git = "https://github.com/Brendonovich/prisma-client-rust", rev = "bb1c2d3", default-features = false, features = [ - "postgresql", - "migrations", -] } +schemars = { version = "0.8.12", features = ["url", "chrono", "uuid1"] } redis = { version = "0.23.1", features = [ "aio", "tokio-comp", "connection-manager", ] } + [build-dependencies] chrono = "0.4.26" - -[workspace] -members = [".", "prisma-cli"] -default-members = [".", "prisma-cli"] diff --git a/api/Dockerfile b/api/Dockerfile index 319b256..dc65d4b 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -5,17 +5,10 @@ FROM chef AS planner COPY . . RUN cargo chef prepare --recipe-path recipe.json -FROM chef as prisma -COPY .cargo /app/.cargo -COPY prisma-cli /app -COPY prisma /app/prisma -RUN cargo prisma generate - FROM chef AS builder COPY --from=planner /app/recipe.json recipe.json RUN cargo chef cook --release --recipe-path recipe.json COPY . . -COPY --from=prisma /app/src/db.rs /app/src/db.rs RUN cargo build --release --bin dyson-api FROM debian:bookworm-slim as runtime diff --git a/api/Dockerfile.dev b/api/Dockerfile.dev index 3743539..c08680d 100644 --- a/api/Dockerfile.dev +++ b/api/Dockerfile.dev @@ -3,7 +3,6 @@ WORKDIR /app COPY . /app/ -RUN cargo prisma generate RUN cargo build EXPOSE 8000 diff --git a/api/Tiltfile b/api/Tiltfile index 5c9a688..2181221 100644 --- a/api/Tiltfile +++ b/api/Tiltfile @@ -6,7 +6,6 @@ docker_build_with_restart( entrypoint="cargo run", live_update=[ sync('.', '/app/'), - run('cargo prisma generate', trigger=['./prisma/schema.prisma']) ] ) diff --git a/api/prisma-cli/Cargo.toml b/api/prisma-cli/Cargo.toml deleted file mode 100644 index d1a78b0..0000000 --- a/api/prisma-cli/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "prisma-cli" -publish = false -version = "0.0.0" -edition = "2021" - -[dependencies] - -[dependencies.prisma-client-rust-cli] -rev = "bb1c2d3" -default-features = false -features = ["postgresql", "migrations"] -git = "https://github.com/Brendonovich/prisma-client-rust" diff --git a/api/prisma-cli/src/main.rs b/api/prisma-cli/src/main.rs deleted file mode 100644 index f758015..0000000 --- a/api/prisma-cli/src/main.rs +++ /dev/null @@ -1,3 +0,0 @@ -fn main() { - prisma_client_rust_cli::run(); -} diff --git a/api/prisma/migrations/20230718040035_init/migration.sql b/api/prisma/migrations/20230718040035_init/migration.sql deleted file mode 100644 index 6f95abb..0000000 --- a/api/prisma/migrations/20230718040035_init/migration.sql +++ /dev/null @@ -1,22 +0,0 @@ --- CreateTable -CREATE TABLE "User" ( - "username" TEXT NOT NULL, - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" TIMESTAMP(3) NOT NULL, - - CONSTRAINT "User_pkey" PRIMARY KEY ("username") -); - --- CreateTable -CREATE TABLE "ApiToken" ( - "token" TEXT NOT NULL, - "userId" TEXT NOT NULL, - "name" TEXT, - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" TIMESTAMP(3) NOT NULL, - - CONSTRAINT "ApiToken_pkey" PRIMARY KEY ("token") -); - --- AddForeignKey -ALTER TABLE "ApiToken" ADD CONSTRAINT "ApiToken_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("username") ON DELETE RESTRICT ON UPDATE CASCADE; diff --git a/api/prisma/migrations/migration_lock.toml b/api/prisma/migrations/migration_lock.toml deleted file mode 100644 index fbffa92..0000000 --- a/api/prisma/migrations/migration_lock.toml +++ /dev/null @@ -1,3 +0,0 @@ -# Please do not edit this file manually -# It should be added in your version-control system (i.e. Git) -provider = "postgresql" \ No newline at end of file diff --git a/api/prisma/schema.prisma b/api/prisma/schema.prisma deleted file mode 100644 index d2ca3cd..0000000 --- a/api/prisma/schema.prisma +++ /dev/null @@ -1,62 +0,0 @@ -datasource db { - provider = "postgresql" - url = env("DATABASE_URL") -} - -generator client { - module_path = "db" - client_format = "folder" - output = "../src/db/" - provider = "cargo prisma" -} - -model User { - id String @id @default(uuid()) - username String @unique - tokens ApiToken[] - predictions Predictions[] - - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt -} - -model ApiToken { - token String @id - userId String - name String? - - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt - - user User @relation(fields: [userId], references: [id]) -} - -enum PredictionStatus { - STARTING - PROCESSING - SUCCEEDED - FAILED - CANCELLED -} - -model Predictions { - id String @id @default(uuid()) - userId String - version String - status PredictionStatus @default(STARTING) - - input Json - output Json @default("{}") - error Json @default("{}") - logs String? - metrics Json @default("{}") - webhookUrl String? - webhookFilter String[] - - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt - startedAt DateTime? - completedAt DateTime? - - user User @relation(fields: [userId], references: [id]) -} diff --git a/api/rustfmt.toml b/api/rustfmt.toml index a3644ec..5c94ef6 100644 --- a/api/rustfmt.toml +++ b/api/rustfmt.toml @@ -2,7 +2,7 @@ tab_spaces = 4 hard_tabs = true edition = "2021" use_try_shorthand = true -imports_granularity = "crate" +imports_granularity = "Crate" use_field_init_shorthand = true condense_wildcard_suffixes = true match_block_trailing_comma = true diff --git a/api/src/axum/extractors/prediction.rs b/api/src/axum/extractors/prediction.rs index bd452e9..dfb021f 100644 --- a/api/src/axum/extractors/prediction.rs +++ b/api/src/axum/extractors/prediction.rs @@ -7,15 +7,11 @@ use axum::{ async_trait, extract::{FromRequestParts, Path}, http::request::Parts, - Extension, RequestPartsExt, + RequestPartsExt, }; -use std::sync::Arc; +use ensemble::Model; -use crate::{ - db::{predictions, PrismaClient}, - errors::RouteError, - spec::Prediction, -}; +use crate::{errors::RouteError, models::Prediction}; use super::AuthenticatedUser; @@ -30,20 +26,19 @@ impl FromRequestParts for AuthenticatedPrediction { async fn from_request_parts(parts: &mut Parts, _: &S) -> Result { let Path(id) = parts.extract::>().await?; let AuthenticatedUser(user) = parts.extract::().await?; - let Extension(prisma) = parts.extract::>>().await?; - let prediction = prisma - .predictions() - .find_unique(predictions::id::equals(id)) - .exec() - .await? - .ok_or_else(RouteError::not_found)?; + let prediction = Prediction::find(id.parse().map_err(|_| RouteError::bad_request())?) + .await + .map_err(|e| match e { + ensemble::Error::NotFound => RouteError::not_found(), + _ => RouteError::internal_error(), + })?; - if prediction.user_id != user.id { + if prediction.user != user { return Err(RouteError::not_found()); } - Ok(Self(prediction.into())) + Ok(Self(prediction)) } } diff --git a/api/src/axum/extractors/user.rs b/api/src/axum/extractors/user.rs index d9acc8d..4c063a1 100644 --- a/api/src/axum/extractors/user.rs +++ b/api/src/axum/extractors/user.rs @@ -8,18 +8,18 @@ use axum::{ extract::FromRequestParts, headers::{authorization::Bearer, Authorization}, http::request::Parts, - Extension, RequestPartsExt, TypedHeader, + RequestPartsExt, TypedHeader, }; -use std::sync::Arc; +use ensemble::Model; use crate::{ - db::{api_token, user, PrismaClient}, errors::RouteError, + models::{ApiToken, User}, }; #[derive(Debug)] #[allow(clippy::module_name_repetitions)] -pub struct AuthenticatedUser(pub user::Data); +pub struct AuthenticatedUser(pub User); #[async_trait] impl FromRequestParts for AuthenticatedUser { @@ -31,17 +31,11 @@ impl FromRequestParts for AuthenticatedUser { .await .map_err(|_| RouteError::unauthorized())?; - let Extension(prisma) = parts.extract::>>().await?; - - let token = prisma - .api_token() - .find_unique(api_token::token::equals(bearer.token().to_string())) - .with(api_token::user::fetch()) - .exec() - .await? - .ok_or_else(RouteError::unauthorized)?; + let mut token = ApiToken::find(bearer.token().to_string()) + .await + .map_err(|_| RouteError::unauthorized())?; - Ok(Self(token.user().unwrap().clone())) + Ok(Self(token.user().await.unwrap().clone())) } } diff --git a/api/src/main.rs b/api/src/main.rs index 1edc9b1..5de84f4 100644 --- a/api/src/main.rs +++ b/api/src/main.rs @@ -9,16 +9,14 @@ use tracing_subscriber::{ prelude::__tracing_subscriber_SubscriberExt, util::SubscriberInitExt, EnvFilter, Layer, }; -#[allow(warnings, unused)] -mod db; - mod axum; mod config; mod errors; +mod migrations; +mod models; mod routes; mod server; mod shutdown; -mod spec; mod webhooks; #[tokio::main] @@ -33,19 +31,21 @@ async fn main() -> Result<()> { ) .init(); - let prisma_client = db::new_client() - .await - .expect("Failed to connect to database"); + ensemble::setup(&env::var("DATABASE_URL").expect("Missing DATABASE_URL environment variable")) + .await?; let redis_pool = ConnectionManager::new(redis::Client::open( env::var("REDIS_URL").expect("Missing REDIS_URL environment variable"), )?) .await?; - #[cfg(debug_assertions)] - prisma_client._db_push().await?; - #[cfg(not(debug_assertions))] - prisma_client._migrate_deploy().await?; + ensemble::migrate!( + migrations::CreateUsersTable, + migrations::CreateTokensTable, + migrations::CreatePredictionsTable + ) + .await + .expect("Failed to run migrations"); - server::start(prisma_client, redis_pool).await + server::start(redis_pool).await } diff --git a/api/src/migrations.rs b/api/src/migrations.rs new file mode 100644 index 0000000..22c1db2 --- /dev/null +++ b/api/src/migrations.rs @@ -0,0 +1,77 @@ +use ensemble::migrations::{Error, Migration, Schema}; + +use crate::models::WebhookEvent; + +#[derive(Debug, Default)] +pub struct CreateUsersTable; + +#[ensemble::async_trait] +impl Migration for CreateUsersTable { + async fn up(&self) -> Result<(), Error> { + Schema::create("users", |table| { + table.uuid(); + table.string("username").unique(true); + table.timestamps(); + }) + .await + } + + async fn down(&self) -> Result<(), Error> { + Schema::drop("users").await + } +} + +#[derive(Debug, Default)] +pub struct CreateTokensTable; + +#[ensemble::async_trait] +impl Migration for CreateTokensTable { + async fn up(&self) -> Result<(), Error> { + Schema::create("api_tokens", |table| { + table.string("token").primary(true); + table.string("name"); + table.timestamps(); + + table.foreign_uuid("user_id"); + }) + .await + } + + async fn down(&self) -> Result<(), Error> { + Schema::drop("api_tokens").await + } +} + +#[derive(Debug, Default)] +pub struct CreatePredictionsTable; + +#[ensemble::async_trait] +impl Migration for CreatePredictionsTable { + async fn up(&self) -> Result<(), Error> { + Schema::create("predictions", |table| { + table.uuid(); + table.string("version"); + table.string("status"); + table.json("input"); + table.text("logs").nullable(true); + table.json("error").nullable(true); + table.json("output").nullable(true); + table.json("metrics").nullable(true); + table.string("webhook_url").nullable(true); + table + .json("webhook_filter") + .default(Vec::::new()); + + table.timestamps(); + table.timestamp("started_at").nullable(true); + table.timestamp("completed_at").nullable(true); + + table.foreign_uuid("user_id"); + }) + .await + } + + async fn down(&self) -> Result<(), Error> { + Schema::drop("predictions").await + } +} diff --git a/api/src/models.rs b/api/src/models.rs new file mode 100644 index 0000000..306f02d --- /dev/null +++ b/api/src/models.rs @@ -0,0 +1,79 @@ +use ensemble::{ + relationships::{BelongsTo, HasMany}, + types::{DateTime, Json, Uuid}, + Model, +}; +use schemars::JsonSchema; +use url::Url; + +#[derive(Debug, Clone, Model, JsonSchema)] +pub struct User { + #[model(uuid)] + pub id: Uuid, + pub username: String, + pub created_at: DateTime, + pub updated_at: DateTime, + + pub api_tokens: HasMany, + pub predictions: HasMany, +} + +#[derive(Debug, Clone, Model, JsonSchema)] +pub struct ApiToken { + pub name: String, + #[model(primary, hide)] + pub token: String, + pub created_at: DateTime, + pub updated_at: DateTime, + + pub user: BelongsTo, +} + +/// The events that can trigger a webhook. +#[derive(Debug, serde::Serialize, serde::Deserialize, JsonSchema, Clone, Copy, PartialEq, Eq)] +#[serde(rename_all = "lowercase")] +pub enum WebhookEvent { + /// Immediately on prediction start. + Start, + /// Each time a prediction generates an output (note that predictions can generate multiple outputs) + Output, + /// Each time log output is generated by a prediction + Logs, + /// When the prediction reaches a terminal state (succeeded/canceled/failed) + Completed, +} + +#[derive(Debug, serde::Serialize, serde::Deserialize, JsonSchema, Clone, Copy, PartialEq, Eq)] +#[serde(rename_all = "lowercase")] +pub enum PredictionStatus { + Starting, + Processing, + Succeeded, + Failed, + Cancelled, +} + +#[derive(Debug, Clone, Model, JsonSchema)] +pub struct Prediction { + #[model(uuid)] + pub id: Uuid, + pub version: String, + #[model(default = PredictionStatus::Starting)] + pub status: PredictionStatus, + pub webhook_url: Option, + #[model(default)] + pub webhook_filter: Json>, + + pub logs: Option, + pub input: Json, + pub error: Option, + pub output: Option, + pub metrics: Option, + + pub created_at: DateTime, + pub updated_at: DateTime, + pub started_at: Option, + pub completed_at: Option, + + pub user: BelongsTo, +} diff --git a/api/src/routes/system.rs b/api/src/routes/system.rs index c155411..4dca90b 100644 --- a/api/src/routes/system.rs +++ b/api/src/routes/system.rs @@ -1,17 +1,9 @@ -use aide::axum::{ - routing::{get, post}, - ApiRouter, -}; -use axum::Extension; +use aide::axum::{routing::get, ApiRouter}; use axum_jsonschema::Json; use schemars::JsonSchema; -use crate::shutdown::Agent as Shutdown; - pub fn handler() -> ApiRouter { - ApiRouter::new() - .api_route("/", get(root)) - .api_route("/shutdown", post(shutdown)) + ApiRouter::new().api_route("/", get(root)) } #[derive(Debug, serde::Serialize, JsonSchema)] @@ -41,10 +33,3 @@ pub async fn root() -> Json { }, }) } - -#[allow(clippy::unused_async)] -pub async fn shutdown(Extension(shutdown): Extension) -> Json { - shutdown.start(); - - Json("Shutting down...".to_string()) -} diff --git a/api/src/routes/v1/mod.rs b/api/src/routes/v1/mod.rs index 106d937..e2d6c3c 100644 --- a/api/src/routes/v1/mod.rs +++ b/api/src/routes/v1/mod.rs @@ -1,11 +1,10 @@ -use std::sync::Arc; - use aide::axum::{ routing::{get, post}, ApiRouter, }; use axum::Extension; use axum_jsonschema::Json; +use ensemble::{types::ToJson, Model}; use redis::{aio::ConnectionManager, AsyncCommands}; use schemars::{JsonSchema, _serde_json::Value}; use serde_json::json; @@ -14,9 +13,8 @@ use url::Url; use crate::{ axum::extractors::{prediction::AuthenticatedPrediction, AuthenticatedUser}, config, - db::{predictions, user, PrismaClient}, errors::RouteError, - spec::{Prediction, PredictionStatus, WebhookEvent}, + models::{Prediction, PredictionStatus, WebhookEvent}, webhooks::WebhookSender, }; @@ -32,18 +30,11 @@ pub fn handler() -> ApiRouter { } async fn get_predictions( - AuthenticatedUser(user): AuthenticatedUser, - Extension(prisma): Extension>, + AuthenticatedUser(mut user): AuthenticatedUser, ) -> Result>, RouteError> { - let predictions = prisma - .predictions() - .find_many(vec![predictions::user_id::equals(user.id)]) - .exec() - .await?; - - Ok(Json( - predictions.into_iter().map(Into::into).collect::>(), - )) + let predictions = user.predictions().await.unwrap(); + + Ok(Json(predictions.clone())) } #[allow(clippy::unused_async)] @@ -73,59 +64,50 @@ struct CreatePredictionRequest { } async fn create_prediction( - AuthenticatedUser(user): AuthenticatedUser, + AuthenticatedUser(mut user): AuthenticatedUser, Extension(mut redis): Extension, - Extension(prisma): Extension>, Json(req): Json, ) -> Result, RouteError> { tracing::trace!(req = ?req, "User @{} requested a prediction", user.username); - let prediction = prisma - .predictions() - .create( - req.version, - req.input, - user::id::equals(user.id), - vec![ - predictions::webhook_url::set(req.webhook.map(Url::into)), - predictions::webhook_filter::set( - req.webhook_events_filter - .unwrap_or_default() - .into_iter() - .map(Into::into) - .collect::>(), - ), - ], - ) - .exec() - .await?; + let prediction = user + .predictions + .create(Prediction { + version: req.version, + input: req.input.into(), + webhook_url: req.webhook.map(Url::into), + webhook_filter: req + .webhook_events_filter + .unwrap_or_default() + .into_iter() + .map(Into::into) + .collect::>() + .to_json(), + ..Default::default() + }) + .await + .unwrap(); if let Err(e) = redis - .lpush::<_, _, ()>(config::REDIS_PREDICTION_QUEUE, prediction.id.clone()) + .lpush::<_, _, ()>(config::REDIS_PREDICTION_QUEUE, prediction.id.to_string()) .await { tracing::error!(error = ?e, "Failed to push prediction to queue"); - prisma - .predictions() - .delete(predictions::id::equals(prediction.id)) - .exec() - .await?; - + prediction.delete().await?; return Err(RouteError::internal_error().set_error(e.into())); } - Ok(Json(prediction.into())) + Ok(Json(prediction)) } async fn cancel_prediction( AuthenticatedPrediction(mut prediction): AuthenticatedPrediction, Extension(mut redis): Extension, - Extension(prisma): Extension>, ) -> Result, RouteError> { tracing::trace!( "User {} requested to cancel prediction {}", - prediction.user_id, + prediction.user.value, prediction.id ); @@ -139,7 +121,7 @@ async fn cancel_prediction( } if let Err(e) = redis - .lpush::<_, _, ()>(config::REDIS_CANCEL_QUEUE, prediction.id.clone()) + .lpush::<_, _, ()>(config::REDIS_CANCEL_QUEUE, prediction.id.to_string()) .await { tracing::error!(error = ?e, "Failed to push prediction to cancel queue"); @@ -147,18 +129,8 @@ async fn cancel_prediction( return Err(RouteError::internal_error().set_error(e.into())); } - prisma - .predictions() - .update( - predictions::id::equals(prediction.id.clone()), - vec![predictions::status::set( - predictions::status::Type::Cancelled, - )], - ) - .exec() - .await?; - prediction.status = PredictionStatus::Cancelled; + prediction.save().await?; let wh_prediction = prediction.clone(); tokio::spawn(async move { diff --git a/api/src/server.rs b/api/src/server.rs index 22392c3..2899bd4 100644 --- a/api/src/server.rs +++ b/api/src/server.rs @@ -2,15 +2,12 @@ use aide::openapi::{self, OpenApi}; use anyhow::Result; use axum::{Extension, Server}; use redis::aio::ConnectionManager; -use std::{env, net::SocketAddr, sync::Arc}; +use std::{env, net::SocketAddr}; -use crate::{db::PrismaClient, routes, shutdown::Shutdown}; +use crate::{routes, shutdown::Shutdown}; #[allow(clippy::redundant_pub_crate)] -pub(crate) async fn start( - prisma_client: PrismaClient, - redis_pool: ConnectionManager, -) -> Result<()> { +pub(crate) async fn start(redis_pool: ConnectionManager) -> Result<()> { let mut openapi = OpenApi { info: openapi::Info { title: "Dyson".to_string(), @@ -28,8 +25,7 @@ pub(crate) async fn start( let router = router .layer(Extension(openapi)) .layer(shutdown.extension()) - .layer(Extension(redis_pool)) - .layer(Extension(Arc::new(prisma_client))); + .layer(Extension(redis_pool)); let addr = SocketAddr::from(( [0, 0, 0, 0], diff --git a/api/src/shutdown.rs b/api/src/shutdown.rs index 559aa26..4003c90 100644 --- a/api/src/shutdown.rs +++ b/api/src/shutdown.rs @@ -98,10 +98,10 @@ fn register_handlers() -> impl Future { async move { tokio::select! { - _ = ctrl_c => { + () = ctrl_c => { tracing::info!("Received Ctrl+C signal"); }, - _ = terminate => { + () = terminate => { tracing::info!("Received terminate signal"); }, } diff --git a/api/src/spec.rs b/api/src/spec.rs deleted file mode 100644 index c00de9c..0000000 --- a/api/src/spec.rs +++ /dev/null @@ -1,174 +0,0 @@ -use schemars::JsonSchema; -use url::Url; - -use crate::db::{api_token, predictions, user}; - -#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, JsonSchema)] -pub struct User { - pub username: user::username::Type, - pub created_at: user::created_at::Type, - pub updated_at: user::updated_at::Type, - - #[serde(skip_serializing_if = "Option::is_none")] - pub tokens: Option>, - - #[serde(skip_serializing_if = "Option::is_none")] - pub predictions: Option>, -} - -#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, JsonSchema)] -pub struct ApiToken { - pub name: api_token::name::Type, - pub token: api_token::token::Type, - pub user_id: api_token::user_id::Type, - pub created_at: api_token::created_at::Type, - pub updated_at: api_token::updated_at::Type, - - #[serde(skip_serializing_if = "Option::is_none")] - pub user: Option, -} - -#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, JsonSchema)] -pub struct Prediction { - pub id: predictions::id::Type, - #[serde(skip_serializing_if = "always_hide_on_serialization")] - pub user_id: predictions::user_id::Type, - pub version: predictions::version::Type, - pub status: PredictionStatus, - pub input: predictions::input::Type, - pub output: predictions::output::Type, - pub error: predictions::error::Type, - pub logs: predictions::logs::Type, - pub metrics: predictions::metrics::Type, - #[serde(skip_serializing_if = "always_hide_on_serialization")] - pub webhook_url: Option, - #[serde(skip_serializing_if = "always_hide_on_serialization")] - pub webhook_filter: Vec, - pub created_at: predictions::created_at::Type, - pub updated_at: predictions::updated_at::Type, - pub started_at: predictions::started_at::Type, - pub completed_at: predictions::completed_at::Type, - - #[serde(skip_serializing_if = "Option::is_none")] - pub user: Option, -} - -#[derive(Debug, serde::Serialize, serde::Deserialize, JsonSchema, Clone, Copy, PartialEq, Eq)] -#[serde(rename_all = "lowercase")] -pub enum PredictionStatus { - Starting, - Processing, - Succeeded, - Failed, - Cancelled, -} - -/// The events that can trigger a webhook. -#[derive(Debug, serde::Serialize, serde::Deserialize, JsonSchema, Clone, Copy, PartialEq, Eq)] -#[serde(rename_all = "lowercase")] -pub enum WebhookEvent { - /// Immediately on prediction start. - Start, - /// Each time a prediction generates an output (note that predictions can generate multiple outputs) - Output, - /// Each time log output is generated by a prediction - Logs, - /// When the prediction reaches a terminal state (succeeded/canceled/failed) - Completed, -} - -impl From for User { - fn from(user: user::Data) -> Self { - Self { - username: user.username, - updated_at: user.updated_at, - created_at: user.created_at, - predictions: user - .predictions - .map(|predictions| predictions.into_iter().map(Into::into).collect()), - tokens: user - .tokens - .map(|tokens| tokens.into_iter().map(Into::into).collect()), - } - } -} - -impl From for ApiToken { - fn from(token: api_token::Data) -> Self { - Self { - name: token.name, - token: token.token, - user_id: token.user_id, - updated_at: token.updated_at, - created_at: token.created_at, - user: token.user.map(|u| (*u).into()), - } - } -} - -impl From for Prediction { - fn from(value: predictions::Data) -> Self { - Self { - id: value.id, - logs: value.logs, - input: value.input, - error: value.error, - output: value.output, - user_id: value.user_id, - version: value.version, - metrics: value.metrics, - status: value.status.into(), - updated_at: value.updated_at, - created_at: value.created_at, - started_at: value.started_at, - webhook_url: value.webhook_url.map(|s| Url::parse(&s).unwrap()), - completed_at: value.completed_at, - user: value.user.map(|u| (*u).into()), - webhook_filter: value - .webhook_filter - .into_iter() - .map(Into::into) - .collect::>(), - } - } -} - -impl From for PredictionStatus { - fn from(value: predictions::status::Type) -> Self { - match value { - predictions::status::Type::Failed => Self::Failed, - predictions::status::Type::Starting => Self::Starting, - predictions::status::Type::Processing => Self::Processing, - predictions::status::Type::Succeeded => Self::Succeeded, - predictions::status::Type::Cancelled => Self::Cancelled, - } - } -} - -impl From for String { - fn from(value: WebhookEvent) -> Self { - match value { - WebhookEvent::Logs => "logs".into(), - WebhookEvent::Start => "start".into(), - WebhookEvent::Output => "output".into(), - WebhookEvent::Completed => "completed".into(), - } - } -} - -#[allow(clippy::fallible_impl_from)] -impl From for WebhookEvent { - fn from(value: String) -> Self { - match value.as_str() { - "logs" => Self::Logs, - "start" => Self::Start, - "output" => Self::Output, - "completed" => Self::Completed, - _ => panic!("Invalid webhook event"), - } - } -} - -const fn always_hide_on_serialization(_: &T) -> bool { - true -} diff --git a/api/src/webhooks.rs b/api/src/webhooks.rs index dc99da7..04b1d44 100644 --- a/api/src/webhooks.rs +++ b/api/src/webhooks.rs @@ -4,7 +4,7 @@ use anyhow::Result; use reqwest::Client; use url::Url; -use crate::spec::{Prediction, WebhookEvent}; +use crate::models::{Prediction, WebhookEvent}; pub struct WebhookSender { client: Client,