From 8002a93069e4ed9d72b58223647372245c7b3f84 Mon Sep 17 00:00:00 2001 From: Bulat Kurbanov Date: Wed, 25 Dec 2024 23:28:22 +0100 Subject: [PATCH] Move to sqlx --- .cargo/config.toml | 2 - Cargo.lock | 3541 ++---- Cargo.toml | 32 +- prisma-cli/.gitignore | 3 - prisma-cli/Cargo.lock | 3195 ----- prisma-cli/Cargo.toml | 9 - prisma-cli/src/main.rs | 3 - prisma/schema.prisma | 164 - src/db.rs | 15 +- src/main.rs | 1 - src/prisma.rs | 15957 ------------------------- src/serializers/author.rs | 68 +- src/serializers/author_annotation.rs | 23 +- src/serializers/book.rs | 191 +- src/serializers/book_annotation.rs | 23 +- src/serializers/date.rs | 16 + src/serializers/genre.rs | 27 +- src/serializers/mod.rs | 1 + src/serializers/sequence.rs | 57 +- src/serializers/source.rs | 12 +- src/serializers/translator.rs | 45 +- src/serializers/utils.rs | 36 - src/views/authors.rs | 332 +- src/views/books.rs | 682 +- src/views/genres.rs | 109 +- src/views/mod.rs | 9 +- src/views/sequences.rs | 281 +- src/views/translators.rs | 200 +- 28 files changed, 2508 insertions(+), 22526 deletions(-) delete mode 100644 .cargo/config.toml delete mode 100644 prisma-cli/.gitignore delete mode 100644 prisma-cli/Cargo.lock delete mode 100644 prisma-cli/Cargo.toml delete mode 100644 prisma-cli/src/main.rs delete mode 100644 prisma/schema.prisma delete mode 100644 src/prisma.rs create mode 100644 src/serializers/date.rs diff --git a/.cargo/config.toml b/.cargo/config.toml deleted file mode 100644 index 2090db1..0000000 --- a/.cargo/config.toml +++ /dev/null @@ -1,2 +0,0 @@ -[alias] -prisma = "run -p prisma-cli --" diff --git a/Cargo.lock b/Cargo.lock index fdecd0d..b49cb26 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,29 +4,18 @@ version = 3 [[package]] name = "addr2line" -version = "0.21.0" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ "gimli", ] [[package]] -name = "adler" -version = "1.0.2" +name = "adler2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "ahash" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" -dependencies = [ - "getrandom 0.2.14", - "once_cell", - "version_check", -] +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" [[package]] name = "ahash" @@ -40,15 +29,6 @@ dependencies = [ "zerocopy", ] -[[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.1.3" @@ -58,6 +38,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + [[package]] name = "android-tzdata" version = "0.1.1" @@ -73,36 +59,24 @@ dependencies = [ "libc", ] -[[package]] -name = "anyhow" -version = "1.0.82" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f538837af36e6f6a9be0faa67f9a314f8119e4e4b5867c6ab40ed60360142519" - -[[package]] -name = "ascii" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eab1c04a571841102f5345a8fc0f6bb3d31c315dec879b5c6e42e40ce7ffa34e" - [[package]] name = "async-trait" -version = "0.1.80" +version = "0.1.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" +checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn", ] [[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]] @@ -113,24 +87,24 @@ checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "autocfg" -version = "1.2.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "axum" -version = "0.7.7" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "504e3947307ac8326a5437504c517c4b56716c9d98fac0028c2acc7ca47d70ae" +checksum = "edca88bc138befd0323b20752846e6587272d3b03b0343c8ea28a6f819e6e71f" dependencies = [ "async-trait", "axum-core", "bytes", "futures-util", - "http 1.1.0", - "http-body 1.0.0", + "http", + "http-body", "http-body-util", - "hyper 1.3.1", + "hyper", "hyper-util", "itoa", "matchit", @@ -143,9 +117,9 @@ dependencies = [ "serde_json", "serde_path_to_error", "serde_urlencoded", - "sync_wrapper 1.0.1", + "sync_wrapper", "tokio", - "tower 0.5.1", + "tower 0.5.2", "tower-layer", "tower-service", "tracing", @@ -160,13 +134,13 @@ dependencies = [ "async-trait", "bytes", "futures-util", - "http 1.1.0", - "http-body 1.0.0", + "http", + "http-body", "http-body-util", "mime", "pin-project-lite", "rustversion", - "sync_wrapper 1.0.1", + "sync_wrapper", "tower-layer", "tower-service", "tracing", @@ -174,25 +148,26 @@ dependencies = [ [[package]] name = "axum-extra" -version = "0.9.4" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73c3220b188aea709cf1b6c5f9b01c3bd936bb08bd2b5184a12b35ac8131b1f9" +checksum = "c794b30c904f0a1c2fb7740f7df7f7972dfaa14ef6f57cb6178dc63e5dca2f04" dependencies = [ "axum", "axum-core", "bytes", + "fastrand", "futures-util", - "http 1.1.0", - "http-body 1.0.0", + "http", + "http-body", "http-body-util", "mime", + "multer", "pin-project-lite", "serde", "serde_html_form", - "tower 0.5.1", + "tower 0.5.2", "tower-layer", "tower-service", - "tracing", ] [[package]] @@ -204,11 +179,11 @@ dependencies = [ "axum", "bytes", "futures-core", - "http 1.1.0", - "http-body 1.0.0", + "http", + "http-body", "matchit", - "metrics 0.23.0", - "metrics-exporter-prometheus 0.15.3", + "metrics", + "metrics-exporter-prometheus", "once_cell", "pin-project", "tokio", @@ -218,47 +193,19 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.71" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ "addr2line", - "cc", "cfg-if", "libc", "miniz_oxide", "object", "rustc-demangle", + "windows-targets 0.52.6", ] -[[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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - [[package]] name = "base64" version = "0.21.7" @@ -267,49 +214,25 @@ checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "base64" -version = "0.22.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9475866fec1451be56a3c2400fd081ff546538961565ccb5b7142cbd22bc7a51" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] -name = "bigdecimal" -version = "0.3.1" +name = "base64ct" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6773ddc0eafc0e509fb60e48dff7f450f8e674a0686ae8605e8d9901bd5eefa" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + +[[package]] +name = "bitflags" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" dependencies = [ - "num-bigint", - "num-integer", - "num-traits", "serde", ] -[[package]] -name = "bit-vec" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" - -[[package]] -name = "block-buffer" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" -dependencies = [ - "generic-array", -] - [[package]] name = "block-buffer" version = "0.10.4" @@ -329,32 +252,17 @@ dependencies = [ "chrono", "meilisearch-sdk", "once_cell", - "prisma-client-rust", - "rand 0.8.5", + "rand", "sentry", "sentry-tracing", "serde", + "sqlx", "tokio", - "tower-http 0.6.1", + "tower-http 0.6.2", "tracing", "tracing-subscriber", ] -[[package]] -name = "builtin-psl-connectors" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?tag=pcr-0.6.10#c4aeef82dbae310e974d6122160c7e3b5fb6df53" -dependencies = [ - "connection-string", - "either", - "enumflags2", - "indoc", - "lsp-types", - "once_cell", - "psl-core", - "regex", -] - [[package]] name = "bumpalo" version = "3.16.0" @@ -369,15 +277,18 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.6.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" +checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" [[package]] name = "cc" -version = "1.0.95" +version = "1.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32a725bc159af97c3e629873bb9f88fb8cf8a4867175f76dc987815ea07c83b" +checksum = "c31a0499c1dc64f458ad13872de75c0eb7e3fdb0e67964610c914b034fc5956e" +dependencies = [ + "shlex", +] [[package]] name = "cfg-if" @@ -386,10 +297,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] -name = "chrono" -version = "0.4.38" +name = "cfg_aliases" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + +[[package]] +name = "chrono" +version = "0.4.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825" dependencies = [ "android-tzdata", "iana-time-zone", @@ -397,46 +314,23 @@ dependencies = [ "num-traits", "serde", "wasm-bindgen", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] -name = "colored" -version = "2.1.0" +name = "concurrent-queue" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" dependencies = [ - "lazy_static", - "windows-sys 0.48.0", + "crossbeam-utils", ] [[package]] -name = "combine" -version = "3.8.1" +name = "const-oid" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da3da6baa321ec19e1cc41d31bf599f00c783d0517095cdaf0332e3fe8d20680" -dependencies = [ - "ascii", - "byteorder", - "either", - "memchr", - "unreachable", -] - -[[package]] -name = "connection-string" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97faeec45f49581c458f8bf81992c5e3ec17d82cda99f59d3cea14eff62698d" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "convert_case" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb4a24b1aaf0fd0ce8b45161144d6f42cd91677fd5940fd431183eb023b3a2b8" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "convert_case" @@ -459,36 +353,33 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.12" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3" dependencies = [ "libc", ] [[package]] -name = "crc32fast" -version = "1.4.0" +name = "crc" +version = "3.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" +checksum = "69e6e4d7b33a94f0991c26729976b10ebde1d34c3ee82408fb536164fa10d636" dependencies = [ - "cfg-if", + "crc-catalog", ] [[package]] -name = "crossbeam-channel" -version = "0.5.12" +name = "crc-catalog" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab3db02a9c5b5121e1e42fbdb1aeb65f5e02624cc58c43f2884c6ccac0b82f95" -dependencies = [ - "crossbeam-utils", -] +checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" [[package]] name = "crossbeam-epoch" @@ -501,18 +392,18 @@ dependencies = [ [[package]] name = "crossbeam-queue" -version = "0.3.11" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" +checksum = "0f58bbc28f91df819d0aa2a2c00cd19754769c2fad90579b3592b1c9ba7a3115" dependencies = [ "crossbeam-utils", ] [[package]] name = "crossbeam-utils" -version = "0.8.19" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "crypto-common" @@ -524,50 +415,6 @@ dependencies = [ "typenum", ] -[[package]] -name = "cuid" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51294db11d38eb763c92936c5c88425d0090e27dce21dd15748134af9e53e739" -dependencies = [ - "base36", - "cuid-util", - "cuid2", - "hostname 0.3.1", - "num", - "once_cell", - "rand 0.8.5", -] - -[[package]] -name = "cuid-util" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ea2bfe0336ff1b7ca74819b2df8dfae9afea358aff6b1688baa5c181d8c3713" - -[[package]] -name = "cuid2" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47d99cacd52fd67db7490ad051c8c1973fb75520174d69aabbae08c534c9d0e8" -dependencies = [ - "cuid-util", - "num", - "rand 0.8.5", - "sha3", -] - -[[package]] -name = "datamodel-renderer" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?tag=pcr-0.6.10#c4aeef82dbae310e974d6122160c7e3b5fb6df53" -dependencies = [ - "base64 0.13.1", - "once_cell", - "psl", - "regex", -] - [[package]] name = "debugid" version = "0.8.0" @@ -578,6 +425,17 @@ dependencies = [ "uuid", ] +[[package]] +name = "der" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +dependencies = [ + "const-oid", + "pem-rfc7468", + "zeroize", +] + [[package]] name = "deranged" version = "0.3.11" @@ -588,139 +446,53 @@ dependencies = [ "serde", ] -[[package]] -name = "diagnostics" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?tag=pcr-0.6.10#c4aeef82dbae310e974d6122160c7e3b5fb6df53" -dependencies = [ - "colored", - "indoc", - "pest", -] - -[[package]] -name = "digest" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" -dependencies = [ - "generic-array", -] - [[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 = "displaydoc" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f51c5d4ddabd36886dd3e1438cb358cdcb0d7c499cb99cb4ac2e38e18b5cb210" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ - "dirs-sys", + "proc-macro2", + "quote", + "syn", ] [[package]] -name = "dirs-sys" -version = "0.3.7" +name = "dotenvy" +version = "0.15.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" -dependencies = [ - "libc", - "redox_users", - "winapi", -] - -[[package]] -name = "dml" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?tag=pcr-0.6.10#c4aeef82dbae310e974d6122160c7e3b5fb6df53" -dependencies = [ - "chrono", - "cuid", - "either", - "enumflags2", - "indoc", - "prisma-value", - "psl-core", - "schema-ast", - "serde", - "serde_json", - "uuid", -] - -[[package]] -name = "dmmf" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?tag=pcr-0.6.10#c4aeef82dbae310e974d6122160c7e3b5fb6df53" -dependencies = [ - "bigdecimal", - "indexmap 1.9.3", - "prisma-models", - "psl", - "schema", - "schema-builder", - "serde", - "serde_json", -] - -[[package]] -name = "dotenv" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" +checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" [[package]] name = "either" -version = "1.11.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" dependencies = [ "serde", ] [[package]] name = "encoding_rs" -version = "0.8.34" +version = "0.8.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" 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.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3278c9d5fb675e0a51dabcf4c0d355f692b064171535ba72361be1528a9d8e8d" -dependencies = [ - "enumflags2_derive", -] - -[[package]] -name = "enumflags2_derive" -version = "0.7.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c785274071b1b420972453b306eeca06acf4633829db4223b58a2a8c5953bc4" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.60", -] - [[package]] name = "equivalent" version = "1.0.1" @@ -729,47 +501,41 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.8" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] -name = "failure" -version = "0.1.8" +name = "etcetera" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32e9bd16cc02eae7db7ef620b392808b89f6a5e16bb3497d159c6b92a0f4f86" +checksum = "136d1b5283a1ab77bd9257427ffd09d8667ced0570b6f938942bc7568ed5b943" dependencies = [ - "backtrace", - "failure_derive", + "cfg-if", + "home", + "windows-sys 0.48.0", ] [[package]] -name = "failure_derive" -version = "0.1.8" +name = "event-listener" +version = "5.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" +checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", - "synstructure", + "concurrent-queue", + "parking", + "pin-project-lite", ] -[[package]] -name = "fallible-iterator" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" - [[package]] name = "fastrand" -version = "2.0.2" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "findshlibs" @@ -784,25 +550,14 @@ dependencies = [ ] [[package]] -name = "finl_unicode" -version = "1.2.0" +name = "flume" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fcfdc7a0362c9f4444381a9e697c79d435fe65b52a37466fc2c1184cee9edc6" - -[[package]] -name = "fixedbitset" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86d4de0081402f5e88cdac65c8dcdcc73118c1a7a465e2a05f0da05843a8ea33" - -[[package]] -name = "flate2" -version = "1.0.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +checksum = "da0e4dd2a88388a1f4ccc7c9ce104604dab68d9f408dc34cd45823d5a9069095" dependencies = [ - "crc32fast", - "miniz_oxide", + "futures-core", + "futures-sink", + "spin", ] [[package]] @@ -837,9 +592,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" dependencies = [ "futures-channel", "futures-core", @@ -852,9 +607,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", "futures-sink", @@ -862,15 +617,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-executor" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ "futures-core", "futures-task", @@ -878,45 +633,50 @@ dependencies = [ ] [[package]] -name = "futures-io" -version = "0.3.30" +name = "futures-intrusive" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" +dependencies = [ + "futures-core", + "lock_api", + "parking_lot", +] + +[[package]] +name = "futures-io" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-macro" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn", ] [[package]] name = "futures-sink" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" - -[[package]] -name = "futures-timer" -version = "3.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-util" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-channel", "futures-core", @@ -942,76 +702,36 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.1.16" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" -dependencies = [ - "cfg-if", - "libc", - "wasi 0.9.0+wasi-snapshot-preview1", -] - -[[package]] -name = "getrandom" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "js-sys", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", "wasm-bindgen", ] [[package]] name = "gimli" -version = "0.28.1" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" - -[[package]] -name = "graphql-parser" -version = "0.3.0" -source = "git+https://github.com/prisma/graphql-parser#6a3f58bd879065588e710cb02b5bd30c1ce182c3" -dependencies = [ - "combine", - "indexmap 1.9.3", - "thiserror", -] +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "h2" -version = "0.3.26" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http 0.2.12", - "indexmap 2.2.6", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "h2" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" +checksum = "ccae279728d634d083c00f6099cb58f01cc99c145b84b8be2f6c74618d79922e" dependencies = [ "atomic-waker", "bytes", "fnv", "futures-core", "futures-sink", - "http 1.1.0", - "indexmap 2.2.6", + "http", + "indexmap", "slab", "tokio", "tokio-util", @@ -1020,39 +740,34 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.11.2" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ - "ahash 0.7.8", + "ahash", + "allocator-api2", ] [[package]] name = "hashbrown" -version = "0.12.3" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -dependencies = [ - "ahash 0.7.8", -] +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" [[package]] -name = "hashbrown" -version = "0.14.3" +name = "hashlink" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "6ba4ff7128dee98c7dc9794b6a411377e1404dba1c97deb8d1a55297bd25d8af" dependencies = [ - "ahash 0.8.11", + "hashbrown 0.14.5", ] [[package]] name = "heck" -version = "0.3.3" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" -dependencies = [ - "unicode-segmentation", -] +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" @@ -1066,24 +781,31 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +[[package]] +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + [[package]] name = "hmac" 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 = "home" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867" +checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf" dependencies = [ - "libc", - "match_cfg", - "winapi", + "windows-sys 0.59.0", ] [[package]] @@ -1099,20 +821,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.12" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - -[[package]] -name = "http" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +checksum = "f16ca2af56261c99fba8bac40a10251ce8188205a4c448fbb745a2e4daa76fea" dependencies = [ "bytes", "fnv", @@ -1121,43 +832,32 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.6" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ "bytes", - "http 0.2.12", - "pin-project-lite", -] - -[[package]] -name = "http-body" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" -dependencies = [ - "bytes", - "http 1.1.0", + "http", ] [[package]] name = "http-body-util" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0475f8b2ac86659c21b64320d5d653f9efe42acd2a4e560073ec61a155a34f1d" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" dependencies = [ "bytes", - "futures-core", - "http 1.1.0", - "http-body 1.0.0", + "futures-util", + "http", + "http-body", "pin-project-lite", ] [[package]] name = "httparse" -version = "1.8.0" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" [[package]] name = "httpdate" @@ -1167,40 +867,16 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "0.14.28" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" -dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "h2 0.3.26", - "http 0.2.12", - "http-body 0.4.6", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "socket2 0.5.6", - "tokio", - "tower-service", - "tracing", - "want", -] - -[[package]] -name = "hyper" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d" +checksum = "256fb8d4bd6413123cc9d91832d78325c48ff41677595be797d90f42969beae0" dependencies = [ "bytes", "futures-channel", "futures-util", - "h2 0.4.6", - "http 1.1.0", - "http-body 1.0.0", + "h2", + "http", + "http-body", "httparse", "httpdate", "itoa", @@ -1212,32 +888,20 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.26.0" +version = "0.27.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0bea761b46ae2b24eb4aef630d8d1c398157b6fc29e6350ecf090a0b70c952c" +checksum = "2d191583f3da1305256f22463b9bb0471acad48a4e534a5218b9963e9c1f59b2" dependencies = [ "futures-util", - "http 1.1.0", - "hyper 1.3.1", + "http", + "hyper", "hyper-util", "rustls", "rustls-pki-types", "tokio", "tokio-rustls", "tower-service", -] - -[[package]] -name = "hyper-tls" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" -dependencies = [ - "bytes", - "hyper 0.14.28", - "native-tls", - "tokio", - "tokio-native-tls 0.3.1", + "webpki-roots", ] [[package]] @@ -1248,39 +912,38 @@ checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ "bytes", "http-body-util", - "hyper 1.3.1", + "hyper", "hyper-util", "native-tls", "tokio", - "tokio-native-tls 0.3.1", + "tokio-native-tls", "tower-service", ] [[package]] name = "hyper-util" -version = "0.1.3" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca38ef113da30126bbff9cd1705f9273e15d45498615d138b0c20279ac7a76aa" +checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" dependencies = [ "bytes", "futures-channel", "futures-util", - "http 1.1.0", - "http-body 1.0.0", - "hyper 1.3.1", + "http", + "http-body", + "hyper", "pin-project-lite", - "socket2 0.5.6", + "socket2", "tokio", - "tower 0.4.13", "tower-service", "tracing", ] [[package]] name = "iana-time-zone" -version = "0.1.60" +version = "0.1.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -1299,72 +962,160 @@ dependencies = [ "cc", ] +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "idna" -version = "0.5.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +dependencies = [ + "icu_normalizer", + "icu_properties", ] [[package]] name = "indexmap" -version = "1.9.3" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", - "serde", -] - -[[package]] -name = "indexmap" -version = "2.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" dependencies = [ "equivalent", - "hashbrown 0.14.3", -] - -[[package]] -name = "indoc" -version = "1.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa799dd5ed20a7e349f3b4639aa80d74549c81716d9ec4f994c9b5815598306" - -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "introspection-connector" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?tag=pcr-0.6.10#c4aeef82dbae310e974d6122160c7e3b5fb6df53" -dependencies = [ - "anyhow", - "async-trait", - "enumflags2", - "psl", - "serde", - "serde_json", - "thiserror", - "user-facing-errors", + "hashbrown 0.15.2", ] [[package]] name = "ipnet" -version = "2.9.0" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" [[package]] name = "iso8601" @@ -1375,65 +1126,22 @@ dependencies = [ "nom", ] -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "itertools" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" -dependencies = [ - "either", -] - [[package]] name = "itoa" -version = "1.0.11" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "js-sys" -version = "0.3.70" +version = "0.3.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" +checksum = "6717b6b5b077764fb5966237269cb3c64edddde4b14ce42647430a78ced9e7b7" dependencies = [ + "once_cell", "wasm-bindgen", ] -[[package]] -name = "json-rpc-api-build" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?tag=pcr-0.6.10#c4aeef82dbae310e974d6122160c7e3b5fb6df53" -dependencies = [ - "backtrace", - "heck", - "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 = "jsonwebtoken" version = "9.3.0" @@ -1447,54 +1155,55 @@ dependencies = [ "serde_json", ] -[[package]] -name = "keccak" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" -dependencies = [ - "cpufeatures", -] - [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +dependencies = [ + "spin", +] [[package]] name = "libc" -version = "0.2.153" +version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" [[package]] -name = "libredox" -version = "0.1.3" +name = "libm" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" + +[[package]] +name = "libsqlite3-sys" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e99fb7a497b1e3339bc746195567ed8d3e24945ecd636e3619d20b9de9e9149" dependencies = [ - "bitflags 2.5.0", - "libc", + "cc", + "pkg-config", + "vcpkg", ] [[package]] -name = "linked-hash-map" -version = "0.5.6" +name = "linux-raw-sys" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] -name = "linux-raw-sys" -version = "0.4.13" +name = "litemap" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" [[package]] name = "lock_api" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", @@ -1502,55 +1211,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.21" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" - -[[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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "matchers" @@ -1574,7 +1237,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" dependencies = [ "cfg-if", - "digest 0.10.7", + "digest", ] [[package]] @@ -1583,11 +1246,11 @@ version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "056e8c0652af81cc6525e0d9c0e1037ea7bcd77955dcd4aef1a1441be7ad7e55" dependencies = [ - "convert_case 0.6.0", + "convert_case", "proc-macro2", "quote", "structmeta", - "syn 2.0.60", + "syn", ] [[package]] @@ -1606,10 +1269,10 @@ dependencies = [ "log", "meilisearch-index-setting-macro", "pin-project-lite", - "reqwest 0.12.4", + "reqwest", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", "time", "uuid", "wasm-bindgen-futures", @@ -1619,29 +1282,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.2" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" - -[[package]] -name = "metrics" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e52eb6380b6d2a10eb3434aec0885374490f5b82c8aaf5cd487a183c98be834" -dependencies = [ - "ahash 0.7.8", - "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.8", - "metrics-macros", -] +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "metrics" @@ -1649,97 +1292,30 @@ version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "884adb57038347dfbaf2d5065887b6cf4312330dc8e94bc30a1a839bd79d3261" dependencies = [ - "ahash 0.8.11", + "ahash", "portable-atomic", ] -[[package]] -name = "metrics-exporter-prometheus" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953cbbb6f9ba4b9304f4df79b98cdc9d14071ed93065a9fca11c00c5d9181b66" -dependencies = [ - "hyper 0.14.28", - "indexmap 1.9.3", - "ipnet", - "metrics 0.19.0", - "metrics-util 0.13.0", - "parking_lot 0.11.2", - "quanta 0.9.3", - "thiserror", - "tokio", - "tracing", -] - [[package]] name = "metrics-exporter-prometheus" version = "0.15.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4f0c8427b39666bf970460908b213ec09b3b350f20c0c2eabcbba51704a08e6" dependencies = [ - "base64 0.22.0", + "base64 0.22.1", "http-body-util", - "hyper 1.3.1", + "hyper", "hyper-util", - "indexmap 2.2.6", + "indexmap", "ipnet", - "metrics 0.23.0", - "metrics-util 0.17.0", - "quanta 0.12.3", - "thiserror", + "metrics", + "metrics-util", + "quanta", + "thiserror 1.0.69", "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 0.9.3", - "radix_trie", - "sketches-ddsketch 0.1.3", -] - -[[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 0.9.3", - "sketches-ddsketch 0.1.3", -] - [[package]] name = "metrics-util" version = "0.17.0" @@ -1748,49 +1324,11 @@ checksum = "4259040465c955f9f2f1a4a8a16dc46726169bca0f88e8fb2dbeced487c3e828" dependencies = [ "crossbeam-epoch", "crossbeam-utils", - "hashbrown 0.14.3", - "metrics 0.23.0", + "hashbrown 0.14.5", + "metrics", "num_cpus", - "quanta 0.12.3", - "sketches-ddsketch 0.2.2", -] - -[[package]] -name = "migration-connector" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?tag=pcr-0.6.10#c4aeef82dbae310e974d6122160c7e3b5fb6df53" -dependencies = [ - "chrono", - "enumflags2", - "introspection-connector", - "psl", - "sha2 0.9.9", - "tracing", - "tracing-error", - "user-facing-errors", -] - -[[package]] -name = "migration-core" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?tag=pcr-0.6.10#c4aeef82dbae310e974d6122160c7e3b5fb6df53" -dependencies = [ - "async-trait", - "chrono", - "enumflags2", - "json-rpc-api-build", - "jsonrpc-core", - "migration-connector", - "psl", - "serde", - "serde_json", - "sql-migration-connector", - "tokio", - "tracing", - "tracing-futures", - "tracing-subscriber", - "url", - "user-facing-errors", + "quanta", + "sketches-ddsketch", ] [[package]] @@ -1807,50 +1345,47 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.2" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +checksum = "4ffbe83022cedc1d264172192511ae958937694cd57ce297164951b8b3568394" dependencies = [ - "adler", + "adler2", ] [[package]] name = "mio" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" +checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" dependencies = [ - "hermit-abi", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", "windows-sys 0.52.0", ] [[package]] -name = "mobc" -version = "0.7.3" -source = "git+https://github.com/prisma/mobc?tag=1.0.6#80462c4870a2bf6aab49da15c88c021bae531da8" +name = "multer" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83e87776546dc87511aa5ee218730c92b666d7264ab6ed41f9d215af9cd5224b" dependencies = [ - "async-trait", - "futures-channel", - "futures-core", - "futures-timer", + "bytes", + "encoding_rs", "futures-util", - "log", - "metrics 0.18.1", - "thiserror", - "tokio", - "tracing", - "tracing-subscriber", + "http", + "httparse", + "memchr", + "mime", + "spin", + "version_check", ] [[package]] name = "native-tls" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" dependencies = [ - "lazy_static", "libc", "log", "openssl", @@ -1862,15 +1397,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" @@ -1892,37 +1418,20 @@ dependencies = [ ] [[package]] -name = "num" -version = "0.4.2" +name = "num-bigint-dig" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3135b08af27d103b0a51f2ae0f8632117b7b185ccf931445affa8df530576a41" +checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" dependencies = [ - "num-bigint", - "num-complex", + "byteorder", + "lazy_static", + "libm", "num-integer", "num-iter", - "num-rational", - "num-traits", -] - -[[package]] -name = "num-bigint" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-complex" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23c6602fda94a57c990fe0df199a035d83576b496aa29f4e634a8ac6004e68a6" -dependencies = [ "num-traits", + "rand", + "smallvec", + "zeroize", ] [[package]] @@ -1942,34 +1451,23 @@ dependencies = [ [[package]] name = "num-iter" -version = "0.1.44" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d869c01cc0c455284163fd0092f1f93835385ccab5a98a0dcc497b2f8bf055a9" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" dependencies = [ "autocfg", "num-integer", "num-traits", ] -[[package]] -name = "num-rational" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" -dependencies = [ - "autocfg", - "num-bigint", - "num-integer", - "num-traits", -] - [[package]] name = "num-traits" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", + "libm", ] [[package]] @@ -1984,35 +1482,26 @@ dependencies = [ [[package]] name = "object" -version = "0.32.2" +version = "0.36.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.20.1" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82881c4be219ab5faaf2ad5e5e5ecdff8c66bd7402ca3160975c93b24961afd1" -dependencies = [ - "portable-atomic", -] - -[[package]] -name = "opaque-debug" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "openssl" -version = "0.10.66" +version = "0.10.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" +checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" dependencies = [ - "bitflags 2.5.0", + "bitflags", "cfg-if", "foreign-types", "libc", @@ -2029,7 +1518,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn", ] [[package]] @@ -2040,9 +1529,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.103" +version = "0.9.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" +checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" dependencies = [ "cc", "libc", @@ -2050,46 +1539,11 @@ dependencies = [ "vcpkg", ] -[[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", - "thiserror", - "tokio", -] - -[[package]] -name = "ordered-float" -version = "2.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f19d67e5a2795c94e73e0bb1cc1a7edeb2e28efd39e2e1c9b7a40c1108b11c" -dependencies = [ - "num-traits", -] - -[[package]] -name = "ordermap" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a86ed3f5f244b372d6b1a00b72ef7f8876d0bc6a78a4c9985c53614041512063" - [[package]] name = "os_info" -version = "3.8.2" +version = "3.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae99c7fa6dd38c7cafe1ec085e804f8f555a2f8659b0dbe03f1f9963a9b51092" +checksum = "eb6651f4be5e39563c4fe5cc8326349eb99a25d805a3493f791d5bfd0269e430" dependencies = [ "log", "serde", @@ -2103,70 +1557,48 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] -name = "parking_lot" -version = "0.11.2" +name = "parking" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" -dependencies = [ - "instant", - "lock_api", - "parking_lot_core 0.8.6", -] +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" [[package]] name = "parking_lot" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", - "parking_lot_core 0.9.9", + "parking_lot_core", ] [[package]] name = "parking_lot_core" -version = "0.8.6" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" -dependencies = [ - "cfg-if", - "instant", - "libc", - "redox_syscall 0.2.16", - "smallvec", - "winapi", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.4.1", + "redox_syscall", "smallvec", - "windows-targets 0.48.5", -] - -[[package]] -name = "parser-database" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?tag=pcr-0.6.10#c4aeef82dbae310e974d6122160c7e3b5fb6df53" -dependencies = [ - "diagnostics", - "either", - "enumflags2", - "indexmap 1.9.3", - "schema-ast", + "windows-targets 0.52.6", ] [[package]] name = "paste" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[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" @@ -2174,104 +1606,31 @@ version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" -[[package]] -name = "pest" -version = "2.7.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "311fb059dee1a7b802f036316d790138c613a4e8b180c822e3925a662e9f0c95" -dependencies = [ - "memchr", - "thiserror", - "ucd-trie", -] - -[[package]] -name = "pest_derive" -version = "2.7.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f73541b156d32197eecda1a4014d7f868fd2bcb3c550d5386087cfba442bf69c" -dependencies = [ - "pest", - "pest_generator", -] - -[[package]] -name = "pest_generator" -version = "2.7.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c35eeed0a3fab112f75165fdc026b3913f4183133f19b49be773ac9ea966e8bd" -dependencies = [ - "pest", - "pest_meta", - "proc-macro2", - "quote", - "syn 2.0.60", -] - -[[package]] -name = "pest_meta" -version = "2.7.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2adbf29bb9776f28caece835398781ab24435585fe0d4dc1374a61db5accedca" -dependencies = [ - "once_cell", - "pest", - "sha2 0.10.8", -] - -[[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", -] - [[package]] name = "pin-project" -version = "1.1.5" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +checksum = "be57f64e946e500c8ee36ef6331845d40a93055567ec57e8fae13efd33759b95" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.5" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn", ] [[package]] name = "pin-project-lite" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" [[package]] name = "pin-utils" @@ -2280,59 +1639,37 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] -name = "pkg-config" -version = "0.3.30" +name = "pkcs1" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f" +dependencies = [ + "der", + "pkcs8", + "spki", +] + +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + +[[package]] +name = "pkg-config" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "portable-atomic" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc9c68a3f6da06753e9335d63e27f6b9754dd1920d941135b7ea8224f141adb2" - -[[package]] -name = "postgres-native-tls" -version = "0.5.0" -source = "git+https://github.com/pimeys/rust-postgres?rev=064a6a50427542e2c166e870027735aab3b52e77#064a6a50427542e2c166e870027735aab3b52e77" -dependencies = [ - "native-tls", - "tokio", - "tokio-native-tls 0.3.0", - "tokio-postgres", -] - -[[package]] -name = "postgres-protocol" -version = "0.6.4" -source = "git+https://github.com/pimeys/rust-postgres?rev=064a6a50427542e2c166e870027735aab3b52e77#064a6a50427542e2c166e870027735aab3b52e77" -dependencies = [ - "base64 0.13.1", - "byteorder", - "bytes", - "fallible-iterator", - "hmac", - "md-5", - "memchr", - "rand 0.8.5", - "sha2 0.10.8", - "stringprep", -] - -[[package]] -name = "postgres-types" -version = "0.2.4" -source = "git+https://github.com/pimeys/rust-postgres?rev=064a6a50427542e2c166e870027735aab3b52e77#064a6a50427542e2c166e870027735aab3b52e77" -dependencies = [ - "bit-vec", - "bytes", - "chrono", - "fallible-iterator", - "postgres-protocol", - "serde", - "serde_json", - "uuid", -] +checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6" [[package]] name = "powerfmt" @@ -2342,349 +1679,98 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.17" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" - -[[package]] -name = "prisma-cli" -version = "0.1.0" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" dependencies = [ - "prisma-client-rust-cli", -] - -[[package]] -name = "prisma-client-rust" -version = "0.6.11" -source = "git+https://github.com/Brendonovich/prisma-client-rust?tag=0.6.11#3ac68d0052533d3ae0332d93a56a8ad169c2ee18" -dependencies = [ - "base64 0.13.1", - "bigdecimal", - "chrono", - "diagnostics", - "dml", - "dmmf", - "dotenv", - "futures", - "indexmap 1.9.3", - "migration-core", - "paste", - "prisma-client-rust-macros", - "prisma-models", - "psl", - "query-connector", - "query-core", - "schema", - "serde", - "serde-value", - "serde_json", - "thiserror", - "user-facing-errors", - "uuid", -] - -[[package]] -name = "prisma-client-rust-cli" -version = "0.6.11" -source = "git+https://github.com/Brendonovich/prisma-client-rust?tag=0.6.11#3ac68d0052533d3ae0332d93a56a8ad169c2ee18" -dependencies = [ - "directories", - "flate2", - "http 0.2.12", - "prisma-client-rust-sdk", - "proc-macro2", - "quote", - "regex", - "reqwest 0.11.27", - "serde", - "serde_json", - "serde_path_to_error", - "syn 1.0.109", - "thiserror", -] - -[[package]] -name = "prisma-client-rust-macros" -version = "0.6.11" -source = "git+https://github.com/Brendonovich/prisma-client-rust?tag=0.6.11#3ac68d0052533d3ae0332d93a56a8ad169c2ee18" -dependencies = [ - "convert_case 0.6.0", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "prisma-client-rust-sdk" -version = "0.6.11" -source = "git+https://github.com/Brendonovich/prisma-client-rust?tag=0.6.11#3ac68d0052533d3ae0332d93a56a8ad169c2ee18" -dependencies = [ - "convert_case 0.5.0", - "dml", - "dmmf", - "prisma-models", - "proc-macro2", - "psl", - "query-core", - "quote", - "request-handlers", - "serde", - "serde_json", - "serde_path_to_error", - "syn 1.0.109", - "thiserror", -] - -[[package]] -name = "prisma-models" -version = "0.0.0" -source = "git+https://github.com/Brendonovich/prisma-engines?tag=pcr-0.6.10#c4aeef82dbae310e974d6122160c7e3b5fb6df53" -dependencies = [ - "bigdecimal", - "chrono", - "itertools 0.10.5", - "once_cell", - "prisma-value", - "psl", - "serde", - "serde_json", - "thiserror", -] - -[[package]] -name = "prisma-value" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?tag=pcr-0.6.10#c4aeef82dbae310e974d6122160c7e3b5fb6df53" -dependencies = [ - "base64 0.12.3", - "bigdecimal", - "chrono", - "once_cell", - "regex", - "serde", - "serde_json", - "uuid", + "zerocopy", ] [[package]] name = "proc-macro2" -version = "1.0.81" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" dependencies = [ "unicode-ident", ] [[package]] -name = "psl" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?tag=pcr-0.6.10#c4aeef82dbae310e974d6122160c7e3b5fb6df53" +name = "quanta" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773ce68d0bb9bc7ef20be3536ffe94e223e1f365bd374108b2659fac0c65cfe6" dependencies = [ - "builtin-psl-connectors", - "dml", - "psl-core", -] - -[[package]] -name = "psl-core" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?tag=pcr-0.6.10#c4aeef82dbae310e974d6122160c7e3b5fb6df53" -dependencies = [ - "bigdecimal", - "chrono", - "diagnostics", - "enumflags2", - "indoc", - "itertools 0.10.5", - "lsp-types", + "crossbeam-utils", + "libc", "once_cell", - "parser-database", - "prisma-value", - "regex", - "schema-ast", - "serde", - "serde_json", - "url", + "raw-cpuid", + "wasi", + "web-sys", + "winapi", ] [[package]] -name = "quaint" -version = "0.2.0-alpha.13" -source = "git+https://github.com/Brendonovich/quaint?tag=0.6.5#c502995f5e9dd4a86d80fa27f63e641bd6bbc6f2" +name = "quinn" +version = "0.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62e96808277ec6f97351a2380e6c25114bc9e67037775464979f3037c92d05ef" dependencies = [ - "async-trait", - "base64 0.12.3", - "bigdecimal", - "bit-vec", - "byteorder", "bytes", - "chrono", - "connection-string", - "futures", - "hex", - "lru-cache", - "metrics 0.18.1", - "mobc", - "native-tls", - "num_cpus", - "percent-encoding", - "postgres-native-tls", - "postgres-types", - "serde_json", - "sqlformat", - "thiserror", - "tokio", - "tokio-postgres", - "tracing", - "tracing-core", - "url", - "uuid", -] - -[[package]] -name = "quanta" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20afe714292d5e879d8b12740aa223c6a88f118af41870e8b6196e39a02238a8" -dependencies = [ - "crossbeam-utils", - "libc", - "mach", - "once_cell", - "raw-cpuid 10.7.0", - "wasi 0.10.2+wasi-snapshot-preview1", - "web-sys", - "winapi", -] - -[[package]] -name = "quanta" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5167a477619228a0b284fac2674e3c388cba90631d7b7de620e6f1fcd08da5" -dependencies = [ - "crossbeam-utils", - "libc", - "once_cell", - "raw-cpuid 11.0.1", - "wasi 0.11.0+wasi-snapshot-preview1", - "web-sys", - "winapi", -] - -[[package]] -name = "query-connector" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?tag=pcr-0.6.10#c4aeef82dbae310e974d6122160c7e3b5fb6df53" -dependencies = [ - "anyhow", - "async-trait", - "chrono", - "futures", - "indexmap 1.9.3", - "itertools 0.10.5", - "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?tag=pcr-0.6.10#c4aeef82dbae310e974d6122160c7e3b5fb6df53" -dependencies = [ - "async-trait", - "base64 0.12.3", - "bigdecimal", - "chrono", - "connection-string", - "crossbeam-queue", - "cuid", - "enumflags2", - "futures", - "indexmap 1.9.3", - "itertools 0.10.5", - "lazy_static", - "lru", - "once_cell", - "opentelemetry", - "parking_lot 0.12.1", - "petgraph", - "pin-utils", - "prisma-models", - "prisma-value", - "psl", - "query-connector", - "query-engine-metrics", - "schema", - "schema-builder", - "serde", - "serde_json", - "sql-query-connector", - "thiserror", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror 2.0.9", "tokio", "tracing", - "tracing-futures", - "tracing-opentelemetry", - "tracing-subscriber", - "url", - "user-facing-errors", - "uuid", ] [[package]] -name = "query-engine-metrics" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?tag=pcr-0.6.10#c4aeef82dbae310e974d6122160c7e3b5fb6df53" +name = "quinn-proto" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2fe5ef3495d7d2e377ff17b1a8ce2ee2ec2a18cde8b6ad6619d65d0701c135d" dependencies = [ - "metrics 0.18.1", - "metrics-exporter-prometheus 0.10.0", - "metrics-util 0.12.1", - "once_cell", - "parking_lot 0.12.1", - "serde", - "serde_json", + "bytes", + "getrandom", + "rand", + "ring", + "rustc-hash", + "rustls", + "rustls-pki-types", + "slab", + "thiserror 2.0.9", + "tinyvec", "tracing", - "tracing-futures", - "tracing-subscriber", + "web-time", +] + +[[package]] +name = "quinn-udp" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c40286217b4ba3a71d644d752e6a0b71f13f1b6a2c5311acfcbe0c2418ed904" +dependencies = [ + "cfg_aliases", + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.59.0", ] [[package]] name = "quote" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[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" @@ -2692,18 +1778,8 @@ 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", + "rand_chacha", + "rand_core", ] [[package]] @@ -2713,16 +1789,7 @@ 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.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" -dependencies = [ - "getrandom 0.1.16", + "rand_core", ] [[package]] @@ -2731,75 +1798,37 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.14", -] - -[[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", + "getrandom", ] [[package]] name = "raw-cpuid" -version = "10.7.0" +version = "11.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c297679cb867470fa8c9f67dbba74a78d78e3e98d7cf2b08d6d71540f797332" +checksum = "1ab240315c661615f2ee9f0f2cd32d5a7343a84d5ebcccb99d46e6637565e7b0" dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "raw-cpuid" -version = "11.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d86a7c4638d42c44551f4791a20e687dbb4c3de1f33c43dd71e355cd429def1" -dependencies = [ - "bitflags 2.5.0", + "bitflags", ] [[package]] name = "redox_syscall" -version = "0.2.16" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_users" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" -dependencies = [ - "getrandom 0.2.14", - "libredox", - "thiserror", + "bitflags", ] [[package]] name = "regex" -version = "1.10.4" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ - "aho-corasick 1.1.3", + "aho-corasick", "memchr", - "regex-automata 0.4.6", - "regex-syntax 0.8.3", + "regex-automata 0.4.9", + "regex-syntax 0.8.5", ] [[package]] @@ -2813,13 +1842,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.6" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ - "aho-corasick 1.1.3", + "aho-corasick", "memchr", - "regex-syntax 0.8.3", + "regex-syntax 0.8.5", ] [[package]] @@ -2830,90 +1859,28 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" - -[[package]] -name = "request-handlers" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?tag=pcr-0.6.10#c4aeef82dbae310e974d6122160c7e3b5fb6df53" -dependencies = [ - "bigdecimal", - "connection-string", - "dmmf", - "futures", - "graphql-parser", - "indexmap 1.9.3", - "itertools 0.10.5", - "psl", - "query-core", - "serde", - "serde_json", - "thiserror", - "tracing", - "url", - "user-facing-errors", -] +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "reqwest" -version = "0.11.27" +version = "0.12.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" +checksum = "a77c62af46e79de0a562e1a9849205ffcb7fc1238876e9bd743357570e04046f" dependencies = [ - "base64 0.21.7", - "bytes", - "encoding_rs", - "futures-core", - "futures-util", - "h2 0.3.26", - "http 0.2.12", - "http-body 0.4.6", - "hyper 0.14.28", - "hyper-tls 0.5.0", - "ipnet", - "js-sys", - "log", - "mime", - "native-tls", - "once_cell", - "percent-encoding", - "pin-project-lite", - "rustls-pemfile 1.0.4", - "serde", - "serde_json", - "serde_urlencoded", - "sync_wrapper 0.1.2", - "system-configuration", - "tokio", - "tokio-native-tls 0.3.1", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "winreg 0.50.0", -] - -[[package]] -name = "reqwest" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "566cafdd92868e0939d3fb961bd0dc25fcfaaed179291093b3d43e6b3150ea10" -dependencies = [ - "base64 0.22.0", + "base64 0.22.1", "bytes", "futures-channel", "futures-core", "futures-util", - "h2 0.4.6", - "http 1.1.0", - "http-body 1.0.0", + "h2", + "http", + "http-body", "http-body-util", - "hyper 1.3.1", + "hyper", "hyper-rustls", - "hyper-tls 0.6.0", + "hyper-tls", "hyper-util", "ipnet", "js-sys", @@ -2923,15 +1890,16 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", + "quinn", "rustls", - "rustls-pemfile 2.1.2", + "rustls-pemfile", "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", - "sync_wrapper 0.1.2", + "sync_wrapper", "tokio", - "tokio-native-tls 0.3.1", + "tokio-native-tls", "tokio-rustls", "tokio-util", "tower-service", @@ -2941,7 +1909,7 @@ dependencies = [ "wasm-streams", "web-sys", "webpki-roots", - "winreg 0.52.0", + "windows-registry", ] [[package]] @@ -2952,7 +1920,7 @@ checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", "cfg-if", - "getrandom 0.2.14", + "getrandom", "libc", "spin", "untrusted", @@ -2960,40 +1928,66 @@ dependencies = [ ] [[package]] -name = "rustc-demangle" -version = "0.1.23" +name = "rsa" +version = "0.9.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "47c75d7c5c6b673e58bf54d8544a9f432e3a925b0e80f7cd3602ab5c50c55519" +dependencies = [ + "const-oid", + "digest", + "num-bigint-dig", + "num-integer", + "num-traits", + "pkcs1", + "pkcs8", + "rand_core", + "signature", + "spki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + +[[package]] +name = "rustc-hash" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7fb8039b3032c191086b10f11f319a6e99e1e82889c5cc6046f515c9db1d497" [[package]] name = "rustc_version" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ "semver", ] [[package]] name = "rustix" -version = "0.38.34" +version = "0.38.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" dependencies = [ - "bitflags 2.5.0", + "bitflags", "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "rustls" -version = "0.22.4" +version = "0.23.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" +checksum = "5065c3f250cbd332cd894be57c40fa52387247659b14a2d6041d121547903b1b" dependencies = [ - "log", + "once_cell", "ring", "rustls-pki-types", "rustls-webpki", @@ -3003,28 +1997,21 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "1.0.4" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" dependencies = [ - "base64 0.21.7", -] - -[[package]] -name = "rustls-pemfile" -version = "2.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" -dependencies = [ - "base64 0.22.0", "rustls-pki-types", ] [[package]] name = "rustls-pki-types" -version = "1.9.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e696e35370c65c9c541198af4543ccd580cf17fc25d8e05c5a242b202488c55" +checksum = "d2bf47e6ff922db3825eb750c4e2ff784c6ff8fb9e13046ef6a1d1c5401b0b37" +dependencies = [ + "web-time", +] [[package]] name = "rustls-webpki" @@ -3039,56 +2026,23 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.15" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80af6f9131f277a45a3fba6ce8e2258037bb0477a67e610d3c1fe046ab31de47" +checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" [[package]] name = "ryu" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "schannel" -version = "0.1.23" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "schema" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?tag=pcr-0.6.10#c4aeef82dbae310e974d6122160c7e3b5fb6df53" -dependencies = [ - "once_cell", - "prisma-models", - "psl", -] - -[[package]] -name = "schema-ast" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?tag=pcr-0.6.10#c4aeef82dbae310e974d6122160c7e3b5fb6df53" -dependencies = [ - "diagnostics", - "pest", - "pest_derive", -] - -[[package]] -name = "schema-builder" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?tag=pcr-0.6.10#c4aeef82dbae310e974d6122160c7e3b5fb6df53" -dependencies = [ - "itertools 0.10.5", - "lazy_static", - "once_cell", - "prisma-models", - "psl", - "schema", + "windows-sys 0.59.0", ] [[package]] @@ -3099,11 +2053,11 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "security-framework" -version = "2.10.0" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "770452e37cad93e0a50d5abc3990d2bc351c36d0328f86cefec2f2fb206eaef6" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 1.3.2", + "bitflags", "core-foundation", "core-foundation-sys", "libc", @@ -3112,9 +2066,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.10.0" +version = "2.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41f3cc463c0ef97e11c3461a9d3787412d30e8e7eb907c79180c4a57bf7c04ef" +checksum = "1863fd3768cd83c56a7f60faa4dc0d403f1b6df0a38c3c25f44b7894e45370d5" dependencies = [ "core-foundation-sys", "libc", @@ -3122,19 +2076,19 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.22" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" +checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" [[package]] name = "sentry" -version = "0.34.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5484316556650182f03b43d4c746ce0e3e48074a21e2f51244b648b6542e1066" +checksum = "016958f51b96861dead7c1e02290f138411d05e94fad175c8636a835dee6e51e" dependencies = [ "httpdate", "native-tls", - "reqwest 0.12.4", + "reqwest", "sentry-backtrace", "sentry-contexts", "sentry-core", @@ -3147,9 +2101,9 @@ dependencies = [ [[package]] name = "sentry-backtrace" -version = "0.34.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40aa225bb41e2ec9d7c90886834367f560efc1af028f1c5478a6cce6a59c463a" +checksum = "e57712c24e99252ef175b4b06c485294f10ad6bc5b5e1567ff3803ee7a0b7d3f" dependencies = [ "backtrace", "once_cell", @@ -3159,11 +2113,11 @@ dependencies = [ [[package]] name = "sentry-contexts" -version = "0.34.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a8dd746da3d16cb8c39751619cefd4fcdbd6df9610f3310fd646b55f6e39910" +checksum = "eba8754ec3b9279e00aa6d64916f211d44202370a1699afde1db2c16cbada089" dependencies = [ - "hostname 0.4.0", + "hostname", "libc", "os_info", "rustc_version", @@ -3173,12 +2127,12 @@ dependencies = [ [[package]] name = "sentry-core" -version = "0.34.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "161283cfe8e99c8f6f236a402b9ccf726b201f365988b5bb637ebca0abbd4a30" +checksum = "f9f8b6dcd4fbae1e3e22b447f32670360b27e31b62ab040f7fb04e0f80c04d92" dependencies = [ "once_cell", - "rand 0.8.5", + "rand", "sentry-types", "serde", "serde_json", @@ -3186,9 +2140,9 @@ dependencies = [ [[package]] name = "sentry-debug-images" -version = "0.34.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc6b25e945fcaa5e97c43faee0267eebda9f18d4b09a251775d8fef1086238a" +checksum = "8982a69133d3f5e4efdbfa0776937fca43c3a2e275a8fe184f50b1b0aa92e07c" dependencies = [ "findshlibs", "once_cell", @@ -3197,9 +2151,9 @@ dependencies = [ [[package]] name = "sentry-panic" -version = "0.34.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc74f229c7186dd971a9491ffcbe7883544aa064d1589bd30b83fb856cd22d63" +checksum = "de296dae6f01e931b65071ee5fe28d66a27909857f744018f107ed15fd1f6b25" dependencies = [ "sentry-backtrace", "sentry-core", @@ -3207,9 +2161,9 @@ dependencies = [ [[package]] name = "sentry-tracing" -version = "0.34.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd3c5faf2103cd01eeda779ea439b68c4ee15adcdb16600836e97feafab362ec" +checksum = "263f73c757ed7915d3e1e34625eae18cad498a95b4261603d4ce3f87b159a6f0" dependencies = [ "sentry-backtrace", "sentry-core", @@ -3219,16 +2173,16 @@ dependencies = [ [[package]] name = "sentry-types" -version = "0.34.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d68cdf6bc41b8ff3ae2a9c4671e97426dcdd154cc1d4b6b72813f285d6b163f" +checksum = "a71ed3a389948a6a6d92b98e997a2723ca22f09660c5a7b7388ecd509a70a527" dependencies = [ "debugid", "hex", - "rand 0.8.5", + "rand", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", "time", "url", "uuid", @@ -3236,42 +2190,32 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.210" +version = "1.0.216" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +checksum = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e" dependencies = [ "serde_derive", ] -[[package]] -name = "serde-value" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3a1a3341211875ef120e117ea7fd5228530ae7e7036a779fdc9117be6b3282c" -dependencies = [ - "ordered-float", - "serde", -] - [[package]] name = "serde_derive" -version = "1.0.210" +version = "1.0.216" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn", ] [[package]] name = "serde_html_form" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de514ef58196f1fc96dcaef80fe6170a1ce6215df9687a93fe8300e773fefc5" +checksum = "9d2de91cf02bbc07cde38891769ccd5d4f073d22a40683aa4bc7a95781aaa2c4" dependencies = [ "form_urlencoded", - "indexmap 2.2.6", + "indexmap", "itoa", "ryu", "serde", @@ -3279,12 +2223,12 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.116" +version = "1.0.134" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e17db7126d17feb94eb3fad46bf1a96b034e8aacbc2e775fe81505f8b0b2813" +checksum = "d00f4175c42ee48b15416f6193a959ba3a0d67fc699a0db9ad12df9f83991c7d" dependencies = [ - "indexmap 2.2.6", "itoa", + "memchr", "ryu", "serde", ] @@ -3299,17 +2243,6 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_repr" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.60", -] - [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -3323,16 +2256,14 @@ dependencies = [ ] [[package]] -name = "sha2" -version = "0.9.9" +name = "sha1" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ - "block-buffer 0.9.0", "cfg-if", "cpufeatures", - "digest 0.9.0", - "opaque-debug", + "digest", ] [[package]] @@ -3343,17 +2274,7 @@ checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.7", -] - -[[package]] -name = "sha3" -version = "0.10.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" -dependencies = [ - "digest 0.10.7", - "keccak", + "digest", ] [[package]] @@ -3365,6 +2286,12 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "signal-hook-registry" version = "1.4.2" @@ -3375,16 +2302,14 @@ dependencies = [ ] [[package]] -name = "siphasher" -version = "0.3.11" +name = "signature" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" - -[[package]] -name = "sketches-ddsketch" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04d2ecae5fcf33b122e2e6bd520a57ccf152d2dde3b38c71039df1a6867264ee" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest", + "rand_core", +] [[package]] name = "sketches-ddsketch" @@ -3406,22 +2331,15 @@ name = "smallvec" version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "socket2" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" dependencies = [ - "libc", - "winapi", + "serde", ] [[package]] name = "socket2" -version = "0.5.6" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" +checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" dependencies = [ "libc", "windows-sys 0.52.0", @@ -3432,135 +2350,243 @@ name = "spin" version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" - -[[package]] -name = "sql-ddl" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?tag=pcr-0.6.10#c4aeef82dbae310e974d6122160c7e3b5fb6df53" - -[[package]] -name = "sql-introspection-connector" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?tag=pcr-0.6.10#c4aeef82dbae310e974d6122160c7e3b5fb6df53" dependencies = [ - "anyhow", - "async-trait", - "bigdecimal", - "datamodel-renderer", - "enumflags2", - "introspection-connector", - "once_cell", - "psl", - "quaint", - "regex", - "serde", - "serde_json", - "sql-schema-describer", - "thiserror", - "tracing", - "tracing-futures", - "user-facing-errors", + "lock_api", ] [[package]] -name = "sql-migration-connector" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?tag=pcr-0.6.10#c4aeef82dbae310e974d6122160c7e3b5fb6df53" +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" dependencies = [ - "chrono", - "connection-string", - "either", - "enumflags2", - "indoc", - "migration-connector", - "once_cell", - "psl", - "quaint", - "regex", - "serde_json", - "sql-ddl", - "sql-introspection-connector", - "sql-schema-describer", - "tokio", - "tracing", - "tracing-futures", - "url", - "user-facing-errors", - "uuid", -] - -[[package]] -name = "sql-query-connector" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?tag=pcr-0.6.10#c4aeef82dbae310e974d6122160c7e3b5fb6df53" -dependencies = [ - "anyhow", - "async-trait", - "bigdecimal", - "chrono", - "cuid", - "futures", - "itertools 0.10.5", - "once_cell", - "opentelemetry", - "prisma-models", - "prisma-value", - "psl", - "quaint", - "query-connector", - "rand 0.7.3", - "serde", - "serde_json", - "socket2 0.4.10", - "thiserror", - "tokio", - "tracing", - "tracing-futures", - "tracing-opentelemetry", - "user-facing-errors", - "uuid", -] - -[[package]] -name = "sql-schema-describer" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?tag=pcr-0.6.10#c4aeef82dbae310e974d6122160c7e3b5fb6df53" -dependencies = [ - "async-trait", - "bigdecimal", - "enumflags2", - "indexmap 1.9.3", - "indoc", - "once_cell", - "psl", - "quaint", - "regex", - "serde", - "tracing", - "tracing-error", - "tracing-futures", + "base64ct", + "der", ] [[package]] name = "sqlformat" -version = "0.2.3" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce81b7bd7c4493975347ef60d8c7e8b742d4694f4c49f93e0a12ea263938176c" +checksum = "7bba3a93db0cc4f7bdece8bb09e77e2e785c20bfebf79eb8340ed80708048790" dependencies = [ - "itertools 0.12.1", "nom", "unicode_categories", ] [[package]] -name = "stringprep" -version = "0.1.4" +name = "sqlx" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb41d74e231a107a1b4ee36bd1214b11285b77768d2e3824aedafa988fd36ee6" +checksum = "93334716a037193fac19df402f8571269c84a00852f6a7066b5d2616dcd64d3e" +dependencies = [ + "sqlx-core", + "sqlx-macros", + "sqlx-mysql", + "sqlx-postgres", + "sqlx-sqlite", +] + +[[package]] +name = "sqlx-core" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4d8060b456358185f7d50c55d9b5066ad956956fddec42ee2e8567134a8936e" +dependencies = [ + "atoi", + "byteorder", + "bytes", + "chrono", + "crc", + "crossbeam-queue", + "either", + "event-listener", + "futures-channel", + "futures-core", + "futures-intrusive", + "futures-io", + "futures-util", + "hashbrown 0.14.5", + "hashlink", + "hex", + "indexmap", + "log", + "memchr", + "once_cell", + "paste", + "percent-encoding", + "serde", + "serde_json", + "sha2", + "smallvec", + "sqlformat", + "thiserror 1.0.69", + "tokio", + "tokio-stream", + "tracing", + "url", +] + +[[package]] +name = "sqlx-macros" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cac0692bcc9de3b073e8d747391827297e075c7710ff6276d9f7a1f3d58c6657" +dependencies = [ + "proc-macro2", + "quote", + "sqlx-core", + "sqlx-macros-core", + "syn", +] + +[[package]] +name = "sqlx-macros-core" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1804e8a7c7865599c9c79be146dc8a9fd8cc86935fa641d3ea58e5f0688abaa5" +dependencies = [ + "dotenvy", + "either", + "heck", + "hex", + "once_cell", + "proc-macro2", + "quote", + "serde", + "serde_json", + "sha2", + "sqlx-core", + "sqlx-mysql", + "sqlx-postgres", + "sqlx-sqlite", + "syn", + "tempfile", + "tokio", + "url", +] + +[[package]] +name = "sqlx-mysql" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64bb4714269afa44aef2755150a0fc19d756fb580a67db8885608cf02f47d06a" +dependencies = [ + "atoi", + "base64 0.22.1", + "bitflags", + "byteorder", + "bytes", + "chrono", + "crc", + "digest", + "dotenvy", + "either", + "futures-channel", + "futures-core", + "futures-io", + "futures-util", + "generic-array", + "hex", + "hkdf", + "hmac", + "itoa", + "log", + "md-5", + "memchr", + "once_cell", + "percent-encoding", + "rand", + "rsa", + "serde", + "sha1", + "sha2", + "smallvec", + "sqlx-core", + "stringprep", + "thiserror 1.0.69", + "tracing", + "whoami", +] + +[[package]] +name = "sqlx-postgres" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fa91a732d854c5d7726349bb4bb879bb9478993ceb764247660aee25f67c2f8" +dependencies = [ + "atoi", + "base64 0.22.1", + "bitflags", + "byteorder", + "chrono", + "crc", + "dotenvy", + "etcetera", + "futures-channel", + "futures-core", + "futures-io", + "futures-util", + "hex", + "hkdf", + "hmac", + "home", + "itoa", + "log", + "md-5", + "memchr", + "once_cell", + "rand", + "serde", + "serde_json", + "sha2", + "smallvec", + "sqlx-core", + "stringprep", + "thiserror 1.0.69", + "tracing", + "whoami", +] + +[[package]] +name = "sqlx-sqlite" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5b2cf34a45953bfd3daaf3db0f7a7878ab9b7a6b91b422d24a7a9e4c857b680" +dependencies = [ + "atoi", + "chrono", + "flume", + "futures-channel", + "futures-core", + "futures-executor", + "futures-intrusive", + "futures-util", + "libsqlite3-sys", + "log", + "percent-encoding", + "serde", + "serde_urlencoded", + "sqlx-core", + "tracing", + "url", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "stringprep" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b4df3d392d81bd458a8a621b8bffbd2302a12ffe288a9d931670948749463b1" dependencies = [ - "finl_unicode", "unicode-bidi", "unicode-normalization", + "unicode-properties", ] [[package]] @@ -3572,7 +2598,7 @@ dependencies = [ "proc-macro2", "quote", "structmeta-derive", - "syn 2.0.60", + "syn", ] [[package]] @@ -3583,31 +2609,20 @@ checksum = "152a0b65a590ff6c3da95cabe2353ee04e6167c896b28e3b14478c2636c922fc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn", ] [[package]] name = "subtle" -version = "2.5.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" -version = "1.0.109" +version = "2.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3" +checksum = "d53cbcb5a243bd33b7858b1d7f4aca2153490815872d86d955d6ea29f743c035" dependencies = [ "proc-macro2", "quote", @@ -3616,79 +2631,75 @@ dependencies = [ [[package]] name = "sync_wrapper" -version = "0.1.2" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" - -[[package]] -name = "sync_wrapper" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" +dependencies = [ + "futures-core", +] [[package]] name = "synstructure" -version = "0.12.6" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", - "unicode-xid", -] - -[[package]] -name = "system-configuration" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" -dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" -dependencies = [ - "core-foundation-sys", - "libc", + "syn", ] [[package]] name = "tempfile" -version = "3.10.1" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" dependencies = [ "cfg-if", "fastrand", + "once_cell", "rustix", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "thiserror" -version = "1.0.64" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f072643fd0190df67a8bab670c20ef5d8737177d6ac6b2e9a236cb096206b2cc" +dependencies = [ + "thiserror-impl 2.0.9", ] [[package]] name = "thiserror-impl" -version = "1.0.64" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b50fa271071aae2e6ee85f842e2e28ba8cd2c5fb67f11fcb1fd70b276f9e7d4" +dependencies = [ + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -3703,9 +2714,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.36" +version = "0.3.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +checksum = "35e7868883861bd0e56d9ac6efcaaca0d6d5d82a2a7ec8209ff492c07cf37b21" dependencies = [ "deranged", "itoa", @@ -3724,19 +2735,29 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" +checksum = "2834e6017e3e5e4b9834939793b282bc03b37a3336245fa820e35e233e2a85de" dependencies = [ "num-conv", "time-core", ] [[package]] -name = "tinyvec" -version = "1.6.0" +name = "tinystr" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "022db8904dfa342efe721985167e9fcd16c29b226db4397ed752a761cfce81e8" dependencies = [ "tinyvec_macros", ] @@ -3749,18 +2770,18 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.40.0" +version = "1.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" +checksum = "5cec9b21b0450273377fc97bd4c33a8acffc8c996c987a7c5b319a0083707551" dependencies = [ "backtrace", "bytes", "libc", "mio", - "parking_lot 0.12.1", + "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.6", + "socket2", "tokio-macros", "windows-sys 0.52.0", ] @@ -3773,16 +2794,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", -] - -[[package]] -name = "tokio-native-tls" -version = "0.3.0" -source = "git+https://github.com/pimeys/tls?branch=vendored-openssl#6d0e6fc7a4bf6f290b1033764b47cb3f26d7fceb" -dependencies = [ - "native-tls", - "tokio", + "syn", ] [[package]] @@ -3796,60 +2808,37 @@ dependencies = [ ] [[package]] -name = "tokio-postgres" -version = "0.7.7" -source = "git+https://github.com/pimeys/rust-postgres?rev=064a6a50427542e2c166e870027735aab3b52e77#064a6a50427542e2c166e870027735aab3b52e77" +name = "tokio-rustls" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6d0975eaace0cf0fcadee4e4aaa5da15b5c079146f2cffb67c113be122bf37" 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 0.4.10", + "rustls", "tokio", - "tokio-util", ] [[package]] -name = "tokio-rustls" -version = "0.25.0" +name = "tokio-stream" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" +checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047" dependencies = [ - "rustls", - "rustls-pki-types", + "futures-core", + "pin-project-lite", "tokio", ] [[package]] name = "tokio-util" -version = "0.7.10" +version = "0.7.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +checksum = "d7fcaa8d55a2bdd6b83ace262b016eca0d79ee02818c5c1bcdf0305114081078" dependencies = [ "bytes", "futures-core", "futures-sink", "pin-project-lite", "tokio", - "tracing", -] - -[[package]] -name = "toml" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" -dependencies = [ - "serde", ] [[package]] @@ -3858,11 +2847,6 @@ version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" dependencies = [ - "futures-core", - "futures-util", - "pin-project", - "pin-project-lite", - "tokio", "tower-layer", "tower-service", "tracing", @@ -3870,14 +2854,14 @@ dependencies = [ [[package]] name = "tower" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2873938d487c3cfb9aed7546dc9f2711d867c9f90c46b889989a2cb84eba6b4f" +checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" dependencies = [ "futures-core", "futures-util", "pin-project-lite", - "sync_wrapper 0.1.2", + "sync_wrapper", "tokio", "tower-layer", "tower-service", @@ -3890,10 +2874,10 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e9cd434a998747dd2c4276bc96ee2e0c7a2eadf3cae88e52be55a05fa9053f5" dependencies = [ - "bitflags 2.5.0", + "bitflags", "bytes", - "http 1.1.0", - "http-body 1.0.0", + "http", + "http-body", "http-body-util", "pin-project-lite", "tower-layer", @@ -3902,14 +2886,14 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8437150ab6bbc8c5f0f519e3d5ed4aa883a83dd4cdd3d1b21f9482936046cb97" +checksum = "403fa3b783d4b626a8ad51d766ab03cb6d2dbfc46b1c5d4448395e6628dc9697" dependencies = [ - "bitflags 2.5.0", + "bitflags", "bytes", - "http 1.1.0", - "http-body 1.0.0", + "http", + "http-body", "pin-project-lite", "tower-layer", "tower-service", @@ -3930,9 +2914,9 @@ checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" -version = "0.1.40" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ "log", "pin-project-lite", @@ -3942,56 +2926,25 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.27" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn", ] [[package]] name = "tracing-core" -version = "0.1.32" +version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" dependencies = [ "once_cell", "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.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f751112709b4e791d8ce53e32c4ed2d353565a795ce84da2285393f41557bdf2" -dependencies = [ - "log", - "once_cell", - "tracing-core", -] - [[package]] name = "tracing-log" version = "0.2.0" @@ -4003,25 +2956,11 @@ 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 0.1.4", - "tracing-subscriber", -] - [[package]] name = "tracing-subscriber" -version = "0.3.18" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" dependencies = [ "matchers", "nu-ansi-term", @@ -4032,7 +2971,7 @@ dependencies = [ "thread_local", "tracing", "tracing-core", - "tracing-log 0.2.0", + "tracing-log", ] [[package]] @@ -4047,12 +2986,6 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" -[[package]] -name = "ucd-trie" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" - [[package]] name = "uname" version = "0.1.1" @@ -4064,36 +2997,36 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.15" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" +checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" [[package]] name = "unicode-normalization" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" dependencies = [ "tinyvec", ] [[package]] -name = "unicode-segmentation" -version = "1.11.0" +name = "unicode-properties" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" +checksum = "e70f2a8b45122e719eb623c01822704c4e0907e7e426a05927e1a1cfff5b75d0" [[package]] -name = "unicode-xid" -version = "0.2.4" +name = "unicode-segmentation" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" [[package]] name = "unicode_categories" @@ -4101,15 +3034,6 @@ 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 = "untrusted" version = "0.9.0" @@ -4118,11 +3042,11 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "ureq" -version = "2.9.7" +version = "2.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d11a831e3c0b56e438a28308e7c810799e3c118417f342d30ecec080105395cd" +checksum = "02d1a66277ed75f640d608235660df48c8e3c19f3b4edb6a263315626cc3c01d" dependencies = [ - "base64 0.22.0", + "base64 0.22.1", "log", "native-tls", "once_cell", @@ -4131,9 +3055,9 @@ dependencies = [ [[package]] name = "url" -version = "2.5.0" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ "form_urlencoded", "idna", @@ -4142,36 +3066,24 @@ dependencies = [ ] [[package]] -name = "user-facing-error-macros" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?tag=pcr-0.6.10#c4aeef82dbae310e974d6122160c7e3b5fb6df53" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" [[package]] -name = "user-facing-errors" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?tag=pcr-0.6.10#c4aeef82dbae310e974d6122160c7e3b5fb6df53" -dependencies = [ - "backtrace", - "indoc", - "quaint", - "serde", - "serde_json", - "tracing", - "user-facing-error-macros", -] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" [[package]] name = "uuid" -version = "1.8.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" +checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" dependencies = [ - "getrandom 0.2.14", + "getrandom", "serde", "wasm-bindgen", ] @@ -4190,15 +3102,9 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" 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" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "want" @@ -4209,18 +3115,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.2+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -4228,10 +3122,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] -name = "wasm-bindgen" -version = "0.2.93" +name = "wasite" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" +checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" + +[[package]] +name = "wasm-bindgen" +version = "0.2.99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a474f6281d1d70c17ae7aa6a613c87fce69a127e2624002df63dcb39d6cf6396" dependencies = [ "cfg-if", "once_cell", @@ -4240,36 +3140,36 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.93" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" +checksum = "5f89bb38646b4f81674e8f5c3fb81b562be1fd936d84320f3264486418519c79" dependencies = [ "bumpalo", "log", - "once_cell", "proc-macro2", "quote", - "syn 2.0.60", + "syn", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.43" +version = "0.4.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" +checksum = "38176d9b44ea84e9184eff0bc34cc167ed044f816accfe5922e54d84cf48eca2" dependencies = [ "cfg-if", "js-sys", + "once_cell", "wasm-bindgen", "web-sys", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.93" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" +checksum = "2cc6181fd9a7492eef6fef1f33961e3695e4579b9872a6f7c83aee556666d4fe" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -4277,28 +3177,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.93" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" +checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.93" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" +checksum = "943aab3fdaaa029a6e0271b35ea10b72b943135afe9bffca82384098ad0e06a6" [[package]] name = "wasm-streams" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e072d4e72f700fb3443d8fe94a39315df013eef1104903cdb0a2abd322bbecd" +checksum = "15053d8d85c7eccdbefef60f06769760a563c7f0a9d6902a13d35c7800b0ad65" dependencies = [ "futures-util", "js-sys", @@ -4309,9 +3209,19 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.70" +version = "0.3.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" +checksum = "04dd7223427d52553d3702c004d3b2fe07c148165faa56313cb00211e31c12bc" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" dependencies = [ "js-sys", "wasm-bindgen", @@ -4319,13 +3229,23 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.26.6" +version = "0.26.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +checksum = "5d642ff16b7e79272ae451b7322067cdc17cadf68c23264be9d94a32319efe7e" dependencies = [ "rustls-pki-types", ] +[[package]] +name = "whoami" +version = "1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "372d5b87f58ec45c384ba03563b03544dc5fadc3983e434b286913f5b4a9bb6d" +dependencies = [ + "redox_syscall", + "wasite", +] + [[package]] name = "winapi" version = "0.3.9" @@ -4355,7 +3275,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" dependencies = [ "windows-core", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -4364,7 +3284,37 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-registry" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" +dependencies = [ + "windows-result", + "windows-strings", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result", + "windows-targets 0.52.6", ] [[package]] @@ -4382,7 +3332,16 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", ] [[package]] @@ -4402,18 +3361,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -4424,9 +3383,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -4436,9 +3395,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -4448,15 +3407,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] name = "windows_i686_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -4466,9 +3425,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -4478,9 +3437,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -4490,9 +3449,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -4502,29 +3461,21 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] -name = "winreg" -version = "0.50.0" +name = "write16" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" -dependencies = [ - "cfg-if", - "windows-sys 0.48.0", -] +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" [[package]] -name = "winreg" -version = "0.52.0" +name = "writeable" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" -dependencies = [ - "cfg-if", - "windows-sys 0.48.0", -] +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" [[package]] name = "yaup" @@ -4534,27 +3485,73 @@ checksum = "b0144f1a16a199846cb21024da74edd930b43443463292f536b7110b4855b5c6" dependencies = [ "form_urlencoded", "serde", - "thiserror", + "thiserror 1.0.69", +] + +[[package]] +name = "yoke" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", ] [[package]] name = "zerocopy" -version = "0.7.32" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ + "byteorder", "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.32" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn", +] + +[[package]] +name = "zerofrom" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", ] [[package]] @@ -4562,3 +3559,25 @@ name = "zeroize" version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/Cargo.toml b/Cargo.toml index e900c7c..2a01a44 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,34 +3,28 @@ name = "book_library_server" version = "0.1.0" edition = "2021" -[workspace] -members = [ - "prisma-cli" -] - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -once_cell = "1.20.1" +once_cell = "1.20.2" -prisma-client-rust = { git = "https://github.com/Brendonovich/prisma-client-rust", tag = "0.6.11", default-features = false, features = ["postgresql"] } +tokio = { version = "1.42.0", features = ["full"] } -tokio = { version = "1.40.0", features = ["full"] } +tracing = "0.1.41" +tracing-subscriber = { version = "0.3.19", features = ["env-filter"]} +sentry-tracing = "0.35.0" +tower-http = { version = "0.6.2", features = ["trace"] } -tracing = "0.1.40" -tracing-subscriber = { version = "0.3.18", features = ["env-filter"]} -sentry-tracing = "0.34.0" -tower-http = { version = "0.6.1", features = ["trace"] } - -axum = { version = "0.7.7", features = ["json"] } -axum-extra = { version ="0.9.4", features = ["query"] } +axum = { version = "0.7.9", features = ["json"] } +axum-extra = { version ="0.9.6", features = ["query"] } axum-prometheus = "0.7.0" -serde = { version = "1.0.210", features = ["derive"] } +serde = { version = "1.0.216", features = ["derive"] } -sentry = { version = "0.34.0", features = ["debug-images"] } +sentry = { version = "0.35.0", features = ["debug-images"] } meilisearch-sdk = "0.27.1" rand = "0.8.5" -chrono = "0.4.38" +chrono = { version = "0.4.39", features = ["serde"] } + +sqlx = { version = "0.8.2", features = ["runtime-tokio", "postgres", "macros", "chrono"] } diff --git a/prisma-cli/.gitignore b/prisma-cli/.gitignore deleted file mode 100644 index 11ddd8d..0000000 --- a/prisma-cli/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules -# Keep environment variables out of version control -.env diff --git a/prisma-cli/Cargo.lock b/prisma-cli/Cargo.lock deleted file mode 100644 index 6a9eccd..0000000 --- a/prisma-cli/Cargo.lock +++ /dev/null @@ -1,3195 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "addr2line" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler" -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 = "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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" -dependencies = [ - "memchr", -] - -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - -[[package]] -name = "anyhow" -version = "1.0.72" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b13c32d80ecc7ab747b80c3784bce54ee8a7a0cc4fbda9bf4cda2cf6fe90854" - -[[package]] -name = "ascii" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eab1c04a571841102f5345a8fc0f6bb3d31c315dec879b5c6e42e40ce7ffa34e" - -[[package]] -name = "async-trait" -version = "0.1.72" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc6dde6e4ed435a4c1ee4e73592f5ba9da2151af10076cc04858746af9352d09" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.27", -] - -[[package]] -name = "atomic-shim" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67cd4b51d303cf3501c301e8125df442128d3c6d7c69f71b27833d253de47e77" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "backtrace" -version = "0.3.68" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" -dependencies = [ - "addr2line", - "cc", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - -[[package]] -name = "base64" -version = "0.21.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" - -[[package]] -name = "bigdecimal" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6773ddc0eafc0e509fb60e48dff7f450f8e674a0686ae8605e8d9901bd5eefa" -dependencies = [ - "num-bigint", - "num-integer", - "num-traits", -] - -[[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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" -dependencies = [ - "bit-vec", -] - -[[package]] -name = "bit-vec" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -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.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", -] - -[[package]] -name = "builtin-psl-connectors" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?tag=pcr-0.6.10#7e31dbeb1087c55a71c141c07d87bb39bc3a4e38" -dependencies = [ - "connection-string", - "either", - "enumflags2", - "indoc", - "lsp-types", - "once_cell", - "psl-core", - "regex", -] - -[[package]] -name = "bumpalo" -version = "3.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" - -[[package]] -name = "byteorder" -version = "1.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" - -[[package]] -name = "bytes" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" - -[[package]] -name = "cc" -version = "1.0.79" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "chrono" -version = "0.4.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" -dependencies = [ - "android-tzdata", - "iana-time-zone", - "js-sys", - "num-traits", - "serde", - "time", - "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", -] - -[[package]] -name = "connection-string" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c4ecb0dc8c35d2c626e45ae70bbfcb1050b302f42bcdf025d913cc0c5a0b443" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "convert_case" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb4a24b1aaf0fd0ce8b45161144d6f42cd91677fd5940fd431183eb023b3a2b8" - -[[package]] -name = "core-foundation" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" - -[[package]] -name = "cpufeatures" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" -dependencies = [ - "libc", -] - -[[package]] -name = "crc32fast" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crossbeam-channel" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" -dependencies = [ - "cfg-if", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" -dependencies = [ - "autocfg", - "cfg-if", - "crossbeam-utils", - "memoffset", - "scopeguard", -] - -[[package]] -name = "crossbeam-queue" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1cfb3ea8a53f37c40dea2c7bedcbd88bdfae54f5e2175d6ecaff1c988353add" -dependencies = [ - "cfg-if", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crunchy" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2f4a431c5c9f662e1200b7c7f02c34e91361150e382089a8f2dec3ba680cbda" - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "cuid" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe5d03ac594f5f9cc680b142fff46f3ad9f197e19272042ebf1a40b383fee6fb" -dependencies = [ - "base36", - "bigint", - "cuid2", - "hostname", - "num", - "once_cell", - "rand 0.8.5", -] - -[[package]] -name = "cuid2" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1debbff0c0f0b54e681296c6f064a78f8ecec8e89e7fcc472443d9f85b98ca9a" -dependencies = [ - "num", - "proptest", - "rand 0.8.5", - "sha3", -] - -[[package]] -name = "diagnostics" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?tag=pcr-0.6.10#7e31dbeb1087c55a71c141c07d87bb39bc3a4e38" -dependencies = [ - "colored", - "indoc", - "pest", -] - -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer", - "crypto-common", - "subtle", -] - -[[package]] -name = "directories" -version = "4.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f51c5d4ddabd36886dd3e1438cb358cdcb0d7c499cb99cb4ac2e38e18b5cb210" -dependencies = [ - "dirs-sys", -] - -[[package]] -name = "dirs-sys" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" -dependencies = [ - "libc", - "redox_users", - "winapi", -] - -[[package]] -name = "dml" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?tag=pcr-0.6.10#7e31dbeb1087c55a71c141c07d87bb39bc3a4e38" -dependencies = [ - "chrono", - "cuid", - "either", - "enumflags2", - "indoc", - "prisma-value", - "psl-core", - "schema-ast", - "serde", - "serde_json", - "uuid", -] - -[[package]] -name = "dmmf" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?tag=pcr-0.6.10#7e31dbeb1087c55a71c141c07d87bb39bc3a4e38" -dependencies = [ - "bigdecimal", - "indexmap 1.9.3", - "prisma-models", - "psl", - "schema", - "schema-builder", - "serde", - "serde_json", -] - -[[package]] -name = "either" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" - -[[package]] -name = "encoding_rs" -version = "0.8.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" -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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c041f5090df68b32bcd905365fd51769c8b9d553fe87fde0b683534f10c01bd2" -dependencies = [ - "enumflags2_derive", -] - -[[package]] -name = "enumflags2_derive" -version = "0.7.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e9a1f9f7d83e59740248a6e14ecf93929ade55027844dfcea78beafccc15745" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.27", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" -dependencies = [ - "errno-dragonfly", - "libc", - "windows-sys", -] - -[[package]] -name = "errno-dragonfly" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" -dependencies = [ - "cc", - "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 = "fastrand" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" - -[[package]] -name = "fixedbitset" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86d4de0081402f5e88cdac65c8dcdcc73118c1a7a465e2a05f0da05843a8ea33" - -[[package]] -name = "flate2" -version = "1.0.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743" -dependencies = [ - "crc32fast", - "miniz_oxide", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - -[[package]] -name = "form_urlencoded" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" -dependencies = [ - "percent-encoding", -] - -[[package]] -name = "futures" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" -dependencies = [ - "futures-core", - "futures-sink", -] - -[[package]] -name = "futures-core" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" - -[[package]] -name = "futures-executor" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-io" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" - -[[package]] -name = "futures-macro" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.27", -] - -[[package]] -name = "futures-sink" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" - -[[package]] -name = "futures-task" -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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "slab", -] - -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "getrandom" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" -dependencies = [ - "cfg-if", - "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", - "libc", - "wasi 0.11.0+wasi-snapshot-preview1", -] - -[[package]] -name = "gimli" -version = "0.27.3" -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", - "indexmap 1.9.3", - "thiserror", -] - -[[package]] -name = "h2" -version = "0.3.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http", - "indexmap 2.0.0", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" -dependencies = [ - "ahash", -] - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -dependencies = [ - "ahash", -] - -[[package]] -name = "hashbrown" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" - -[[package]] -name = "hermit-abi" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hmac" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" -dependencies = [ - "digest", -] - -[[package]] -name = "hostname" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867" -dependencies = [ - "libc", - "match_cfg", - "winapi", -] - -[[package]] -name = "http" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - -[[package]] -name = "http-body" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" -dependencies = [ - "bytes", - "http", - "pin-project-lite", -] - -[[package]] -name = "httparse" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" - -[[package]] -name = "httpdate" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" - -[[package]] -name = "hyper" -version = "0.14.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" -dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "socket2", - "tokio", - "tower-service", - "tracing", - "want", -] - -[[package]] -name = "hyper-tls" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" -dependencies = [ - "bytes", - "hyper", - "native-tls", - "tokio", - "tokio-native-tls", -] - -[[package]] -name = "iana-time-zone" -version = "0.1.57" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - -[[package]] -name = "idna" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", - "serde", -] - -[[package]] -name = "indexmap" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" -dependencies = [ - "equivalent", - "hashbrown 0.14.0", -] - -[[package]] -name = "indoc" -version = "1.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa799dd5ed20a7e349f3b4639aa80d74549c81716d9ec4f994c9b5815598306" - -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if", -] - -[[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", - "windows-sys", -] - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "1.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" - -[[package]] -name = "js-sys" -version = "0.3.56" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a38fc24e30fd564ce974c02bf1d337caddff65be6cc4735a1f7eab22a7440f04" -dependencies = [ - "wasm-bindgen", -] - -[[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" - -[[package]] -name = "libc" -version = "0.2.153" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" - -[[package]] -name = "libm" -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.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09fc20d2ca12cb9f044c93e3bd6d32d523e6e2ec3db4f7b2939cd99026ecd3f0" - -[[package]] -name = "lock_api" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" - -[[package]] -name = "md-5" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca" -dependencies = [ - "digest", -] - -[[package]] -name = "memchr" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" - -[[package]] -name = "memoffset" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" -dependencies = [ - "autocfg", -] - -[[package]] -name = "metrics" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e52eb6380b6d2a10eb3434aec0885374490f5b82c8aaf5cd487a183c98be834" -dependencies = [ - "ahash", - "metrics-macros", -] - -[[package]] -name = "metrics" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "142c53885123b68d94108295a09d4afe1a1388ed95b54d5dacd9a454753030f2" -dependencies = [ - "ahash", - "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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" - -[[package]] -name = "minimal-lexical" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" - -[[package]] -name = "miniz_oxide" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" -dependencies = [ - "adler", -] - -[[package]] -name = "mio" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" -dependencies = [ - "libc", - "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys", -] - -[[package]] -name = "mobc" -version = "0.7.3" -source = "git+https://github.com/prisma/mobc?tag=1.0.6#80462c4870a2bf6aab49da15c88c021bae531da8" -dependencies = [ - "async-trait", - "futures-channel", - "futures-core", - "futures-timer", - "futures-util", - "log", - "metrics 0.18.1", - "thiserror", - "tokio", - "tracing", - "tracing-subscriber", -] - -[[package]] -name = "native-tls" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" -dependencies = [ - "lazy_static", - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" -dependencies = [ - "memchr", - "minimal-lexical", -] - -[[package]] -name = "nu-ansi-term" -version = "0.46.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" -dependencies = [ - "overload", - "winapi", -] - -[[package]] -name = "num" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b05180d69e3da0e530ba2a1dae5110317e49e3b7f3d41be227dc5f92e49ee7af" -dependencies = [ - "num-bigint", - "num-complex", - "num-integer", - "num-iter", - "num-rational", - "num-traits", -] - -[[package]] -name = "num-bigint" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-complex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e0d21255c828d6f128a1e41534206671e8c3ea0c62f32291e808dc82cff17d" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-integer" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" -dependencies = [ - "autocfg", - "num-traits", -] - -[[package]] -name = "num-iter" -version = "0.1.43" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-rational" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" -dependencies = [ - "autocfg", - "num-bigint", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" -dependencies = [ - "autocfg", - "libm", -] - -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi", - "libc", -] - -[[package]] -name = "object" -version = "0.31.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" -dependencies = [ - "memchr", -] - -[[package]] -name = "once_cell" -version = "1.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" - -[[package]] -name = "openssl" -version = "0.10.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" -dependencies = [ - "bitflags 2.3.3", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.27", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - -[[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", - "thiserror", - "tokio", -] - -[[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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a86ed3f5f244b372d6b1a00b72ef7f8876d0bc6a78a4c9985c53614041512063" - -[[package]] -name = "overload" -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" -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", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.3.5", - "smallvec", - "windows-targets", -] - -[[package]] -name = "parser-database" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?tag=pcr-0.6.10#7e31dbeb1087c55a71c141c07d87bb39bc3a4e38" -dependencies = [ - "diagnostics", - "either", - "enumflags2", - "indexmap 1.9.3", - "schema-ast", -] - -[[package]] -name = "percent-encoding" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" - -[[package]] -name = "pest" -version = "2.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d2d1d55045829d65aad9d389139882ad623b33b904e7c9f1b10c5b8927298e5" -dependencies = [ - "thiserror", - "ucd-trie", -] - -[[package]] -name = "pest_derive" -version = "2.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f94bca7e7a599d89dea5dfa309e217e7906c3c007fb9c3299c40b10d6a315d3" -dependencies = [ - "pest", - "pest_generator", -] - -[[package]] -name = "pest_generator" -version = "2.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99d490fe7e8556575ff6911e45567ab95e71617f43781e5c05490dc8d75c965c" -dependencies = [ - "pest", - "pest_meta", - "proc-macro2", - "quote", - "syn 2.0.27", -] - -[[package]] -name = "pest_meta" -version = "2.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2674c66ebb4b4d9036012091b537aae5878970d6999f81a265034d85b136b341" -dependencies = [ - "once_cell", - "pest", - "sha2", -] - -[[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", -] - -[[package]] -name = "pin-project" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "030ad2bc4db10a8944cb0d837f158bdfec4d4a4873ab701a95046770d11f8842" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec2e072ecce94ec471b13398d5402c188e76ac03cf74dd1a975161b23a3f6d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.27", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c40d25201921e5ff0c862a505c6557ea88568a4e3ace775ab55e93f2f4f9d57" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - -[[package]] -name = "pkg-config" -version = "0.3.27" -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/pimeys/rust-postgres?branch=pgbouncer-mode#74f0847e9a8ac350c48dd65c4c33e9be5fcf6010" -dependencies = [ - "native-tls", - "tokio", - "tokio-native-tls", - "tokio-postgres", -] - -[[package]] -name = "postgres-protocol" -version = "0.6.4" -source = "git+https://github.com/pimeys/rust-postgres?branch=pgbouncer-mode#74f0847e9a8ac350c48dd65c4c33e9be5fcf6010" -dependencies = [ - "base64 0.13.1", - "byteorder", - "bytes", - "fallible-iterator", - "hmac", - "md-5", - "memchr", - "rand 0.8.5", - "sha2", - "stringprep", -] - -[[package]] -name = "postgres-types" -version = "0.2.4" -source = "git+https://github.com/pimeys/rust-postgres?branch=pgbouncer-mode#74f0847e9a8ac350c48dd65c4c33e9be5fcf6010" -dependencies = [ - "bit-vec", - "bytes", - "chrono", - "fallible-iterator", - "postgres-protocol", - "serde", - "serde_json", - "uuid", -] - -[[package]] -name = "ppv-lite86" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" - -[[package]] -name = "prisma-cli" -version = "0.1.0" -dependencies = [ - "prisma-client-rust-cli", -] - -[[package]] -name = "prisma-client-rust-cli" -version = "0.6.11" -source = "git+https://github.com/Brendonovich/prisma-client-rust?tag=0.6.11#3ac68d0052533d3ae0332d93a56a8ad169c2ee18" -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-sdk" -version = "0.6.11" -source = "git+https://github.com/Brendonovich/prisma-client-rust?tag=0.6.11#3ac68d0052533d3ae0332d93a56a8ad169c2ee18" -dependencies = [ - "convert_case", - "dml", - "dmmf", - "prisma-models", - "proc-macro2", - "psl", - "query-core", - "quote", - "request-handlers", - "serde", - "serde_json", - "serde_path_to_error", - "syn 1.0.109", - "thiserror", -] - -[[package]] -name = "prisma-models" -version = "0.0.0" -source = "git+https://github.com/Brendonovich/prisma-engines?tag=pcr-0.6.10#7e31dbeb1087c55a71c141c07d87bb39bc3a4e38" -dependencies = [ - "bigdecimal", - "chrono", - "itertools", - "once_cell", - "prisma-value", - "psl", - "serde", - "serde_json", - "thiserror", -] - -[[package]] -name = "prisma-value" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?tag=pcr-0.6.10#7e31dbeb1087c55a71c141c07d87bb39bc3a4e38" -dependencies = [ - "base64 0.12.3", - "bigdecimal", - "chrono", - "once_cell", - "regex", - "serde", - "serde_json", - "uuid", -] - -[[package]] -name = "proc-macro2" -version = "1.0.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "proptest" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e35c06b98bf36aba164cc17cb25f7e232f5c4aeea73baa14b8a9f0d92dbfa65" -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", -] - -[[package]] -name = "psl" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?tag=pcr-0.6.10#7e31dbeb1087c55a71c141c07d87bb39bc3a4e38" -dependencies = [ - "builtin-psl-connectors", - "dml", - "psl-core", -] - -[[package]] -name = "psl-core" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?tag=pcr-0.6.10#7e31dbeb1087c55a71c141c07d87bb39bc3a4e38" -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/quaint?tag=0.6.5#2bf0c3620f76d83982c17e567b71da6fc9d65d14" -dependencies = [ - "async-trait", - "base64 0.12.3", - "bigdecimal", - "bit-vec", - "byteorder", - "bytes", - "chrono", - "connection-string", - "futures", - "hex", - "lru-cache", - "metrics 0.18.1", - "mobc", - "native-tls", - "num_cpus", - "percent-encoding", - "postgres-native-tls", - "postgres-types", - "serde_json", - "sqlformat", - "thiserror", - "tokio", - "tokio-postgres", - "tracing", - "tracing-core", - "url", - "uuid", -] - -[[package]] -name = "quanta" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20afe714292d5e879d8b12740aa223c6a88f118af41870e8b6196e39a02238a8" -dependencies = [ - "crossbeam-utils", - "libc", - "mach", - "once_cell", - "raw-cpuid", - "wasi 0.10.2+wasi-snapshot-preview1", - "web-sys", - "winapi", -] - -[[package]] -name = "query-connector" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?tag=pcr-0.6.10#7e31dbeb1087c55a71c141c07d87bb39bc3a4e38" -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?tag=pcr-0.6.10#7e31dbeb1087c55a71c141c07d87bb39bc3a4e38" -dependencies = [ - "async-trait", - "base64 0.12.3", - "bigdecimal", - "chrono", - "connection-string", - "crossbeam-queue", - "cuid", - "enumflags2", - "futures", - "indexmap 1.9.3", - "itertools", - "lazy_static", - "lru", - "once_cell", - "opentelemetry", - "parking_lot 0.12.1", - "petgraph", - "pin-utils", - "prisma-models", - "prisma-value", - "psl", - "query-connector", - "query-engine-metrics", - "schema", - "schema-builder", - "serde", - "serde_json", - "sql-query-connector", - "thiserror", - "tokio", - "tracing", - "tracing-futures", - "tracing-opentelemetry", - "tracing-subscriber", - "url", - "user-facing-errors", - "uuid", -] - -[[package]] -name = "query-engine-metrics" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?tag=pcr-0.6.10#7e31dbeb1087c55a71c141c07d87bb39bc3a4e38" -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.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[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.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 = "redox_syscall" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_users" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" -dependencies = [ - "getrandom 0.2.10", - "redox_syscall 0.2.16", - "thiserror", -] - -[[package]] -name = "regex" -version = "1.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2eae68fc220f7cf2532e4494aded17545fce192d59cd996e0fe7887f4ceb575" -dependencies = [ - "aho-corasick 1.0.2", - "memchr", - "regex-automata", - "regex-syntax 0.7.4", -] - -[[package]] -name = "regex-automata" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39354c10dd07468c2e73926b23bb9c2caca74c5501e38a35da70406f1d923310" -dependencies = [ - "aho-corasick 1.0.2", - "memchr", - "regex-syntax 0.7.4", -] - -[[package]] -name = "regex-syntax" -version = "0.6.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" - -[[package]] -name = "regex-syntax" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" - -[[package]] -name = "request-handlers" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?tag=pcr-0.6.10#7e31dbeb1087c55a71c141c07d87bb39bc3a4e38" -dependencies = [ - "bigdecimal", - "connection-string", - "dmmf", - "futures", - "graphql-parser", - "indexmap 1.9.3", - "itertools", - "psl", - "query-core", - "serde", - "serde_json", - "thiserror", - "tracing", - "url", - "user-facing-errors", -] - -[[package]] -name = "reqwest" -version = "0.11.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" -dependencies = [ - "base64 0.21.2", - "bytes", - "encoding_rs", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "hyper", - "hyper-tls", - "ipnet", - "js-sys", - "log", - "mime", - "native-tls", - "once_cell", - "percent-encoding", - "pin-project-lite", - "serde", - "serde_json", - "serde_urlencoded", - "tokio", - "tokio-native-tls", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "winreg", -] - -[[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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a962918ea88d644592894bc6dc55acc6c0956488adcebbfb6e273506b7fd6e5" -dependencies = [ - "bitflags 2.3.3", - "errno", - "libc", - "linux-raw-sys", - "windows-sys", -] - -[[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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" - -[[package]] -name = "schannel" -version = "0.1.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" -dependencies = [ - "windows-sys", -] - -[[package]] -name = "schema" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?tag=pcr-0.6.10#7e31dbeb1087c55a71c141c07d87bb39bc3a4e38" -dependencies = [ - "once_cell", - "prisma-models", - "psl", -] - -[[package]] -name = "schema-ast" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?tag=pcr-0.6.10#7e31dbeb1087c55a71c141c07d87bb39bc3a4e38" -dependencies = [ - "diagnostics", - "pest", - "pest_derive", -] - -[[package]] -name = "schema-builder" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?tag=pcr-0.6.10#7e31dbeb1087c55a71c141c07d87bb39bc3a4e38" -dependencies = [ - "itertools", - "lazy_static", - "once_cell", - "prisma-models", - "psl", - "schema", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "security-framework" -version = "2.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" -dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "serde" -version = "1.0.174" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b88756493a5bd5e5395d53baa70b194b05764ab85b59e43e4b8f4e1192fa9b1" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.174" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e5c3a298c7f978e53536f95a63bdc4c4a64550582f31a0359a9afda6aede62e" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.27", -] - -[[package]] -name = "serde_json" -version = "1.0.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d03b412469450d4404fe8499a268edd7f8b79fecb074b0d812ad64ca21f4031b" -dependencies = [ - "indexmap 2.0.0", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "serde_path_to_error" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4beec8bce849d58d06238cb50db2e1c417cfeafa4c63f692b15c82b7c80f8335" -dependencies = [ - "itoa", - "serde", -] - -[[package]] -name = "serde_repr" -version = "0.1.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e168eaaf71e8f9bd6037feb05190485708e019f4fd87d161b3c0a0d37daf85e5" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.27", -] - -[[package]] -name = "serde_urlencoded" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" -dependencies = [ - "form_urlencoded", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "sha2" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - -[[package]] -name = "sha3" -version = "0.10.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" -dependencies = [ - "digest", - "keccak", -] - -[[package]] -name = "sharded-slab" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" -dependencies = [ - "lazy_static", -] - -[[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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04d2ecae5fcf33b122e2e6bd520a57ccf152d2dde3b38c71039df1a6867264ee" - -[[package]] -name = "slab" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" -dependencies = [ - "autocfg", -] - -[[package]] -name = "smallvec" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" - -[[package]] -name = "socket2" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "sql-query-connector" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?tag=pcr-0.6.10#7e31dbeb1087c55a71c141c07d87bb39bc3a4e38" -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 = "sqlformat" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c12bc9199d1db8234678b7051747c07f517cdcf019262d1847b94ec8b1aee3e" -dependencies = [ - "itertools", - "nom", - "unicode_categories", -] - -[[package]] -name = "stringprep" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3737bde7edce97102e0e2b15365bf7a20bfdb5f60f4f9e8d7004258a51a8da" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "subtle" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b60f673f44a8255b9c8c657daf66a596d435f2da81a555b06dc644d080ba45e0" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[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 = "tempfile" -version = "3.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5486094ee78b2e5038a6382ed7645bc084dc2ec433426ca4c3cb61e2007b8998" -dependencies = [ - "cfg-if", - "fastrand", - "redox_syscall 0.3.5", - "rustix", - "windows-sys", -] - -[[package]] -name = "thiserror" -version = "1.0.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "611040a08a0439f8248d1990b111c95baa9c704c805fa1f62104b39655fd7f90" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "090198534930841fab3a5d1bb637cde49e339654e606195f8d9c76eeb081dc96" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.27", -] - -[[package]] -name = "thread_local" -version = "1.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" -dependencies = [ - "cfg-if", - "once_cell", -] - -[[package]] -name = "time" -version = "0.1.43" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "tinyvec" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" - -[[package]] -name = "tokio" -version = "1.29.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "532826ff75199d5833b9d2c5fe410f29235e25704ee5f0ef599fb51c21f4a4da" -dependencies = [ - "autocfg", - "backtrace", - "bytes", - "libc", - "mio", - "num_cpus", - "parking_lot 0.12.1", - "pin-project-lite", - "socket2", - "tokio-macros", - "windows-sys", -] - -[[package]] -name = "tokio-macros" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.27", -] - -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - -[[package]] -name = "tokio-postgres" -version = "0.7.7" -source = "git+https://github.com/pimeys/rust-postgres?branch=pgbouncer-mode#74f0847e9a8ac350c48dd65c4c33e9be5fcf6010" -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-util" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", - "tracing", -] - -[[package]] -name = "tower-service" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" - -[[package]] -name = "tracing" -version = "0.1.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" -dependencies = [ - "cfg-if", - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.27", -] - -[[package]] -name = "tracing-core" -version = "0.1.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" -dependencies = [ - "once_cell", - "valuable", -] - -[[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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" -dependencies = [ - "lazy_static", - "log", - "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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77" -dependencies = [ - "nu-ansi-term", - "sharded-slab", - "smallvec", - "thread_local", - "tracing-core", - "tracing-log", -] - -[[package]] -name = "try-lock" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" - -[[package]] -name = "typenum" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" - -[[package]] -name = "ucd-trie" -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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" - -[[package]] -name = "unicode-ident" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" - -[[package]] -name = "unicode-normalization" -version = "0.1.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" -dependencies = [ - "tinyvec", -] - -[[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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" -dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", - "serde", -] - -[[package]] -name = "user-facing-error-macros" -version = "0.1.0" -source = "git+https://github.com/Brendonovich/prisma-engines?tag=pcr-0.6.10#7e31dbeb1087c55a71c141c07d87bb39bc3a4e38" -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?tag=pcr-0.6.10#7e31dbeb1087c55a71c141c07d87bb39bc3a4e38" -dependencies = [ - "backtrace", - "indoc", - "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", - "serde", -] - -[[package]] -name = "valuable" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" - -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - -[[package]] -name = "version_check" -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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" -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.2+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" - -[[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "wasm-bindgen" -version = "0.2.79" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25f1af7423d8588a3d840681122e72e6a24ddbcb3f0ec385cac0d12d24256c06" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.79" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b21c0df030f5a177f3cba22e9bc4322695ec43e7257d865302900290bcdedca" -dependencies = [ - "bumpalo", - "lazy_static", - "log", - "proc-macro2", - "quote", - "syn 1.0.109", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-futures" -version = "0.4.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eb6ec270a31b1d3c7e266b999739109abce8b6c87e4b31fcfcd788b65267395" -dependencies = [ - "cfg-if", - "js-sys", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.79" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f4203d69e40a52ee523b2529a773d5ffc1dc0071801c87b3d270b471b80ed01" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.79" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa8a30d46208db204854cadbb5d4baf5fcf8071ba5bf48190c3e59937962ebc" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.79" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d958d035c4438e28c70e4321a2911302f10135ce78a9c7834c0cab4123d06a2" - -[[package]] -name = "web-sys" -version = "0.3.56" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c060b319f29dd25724f09a2ba1418f142f539b2be99fbf4d2d5a8f7330afb8eb" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-targets" -version = "0.48.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" - -[[package]] -name = "winreg" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" -dependencies = [ - "winapi", -] diff --git a/prisma-cli/Cargo.toml b/prisma-cli/Cargo.toml deleted file mode 100644 index a5effae..0000000 --- a/prisma-cli/Cargo.toml +++ /dev/null @@ -1,9 +0,0 @@ -[package] -name = "prisma-cli" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -prisma-client-rust-cli = { git = "https://github.com/Brendonovich/prisma-client-rust", tag = "0.6.11", default-features = false, features = ["postgresql"] } diff --git a/prisma-cli/src/main.rs b/prisma-cli/src/main.rs deleted file mode 100644 index f758015..0000000 --- a/prisma-cli/src/main.rs +++ /dev/null @@ -1,3 +0,0 @@ -fn main() { - prisma_client_rust_cli::run(); -} diff --git a/prisma/schema.prisma b/prisma/schema.prisma deleted file mode 100644 index 8ce8a56..0000000 --- a/prisma/schema.prisma +++ /dev/null @@ -1,164 +0,0 @@ -generator client { - provider = "cargo prisma" - output = "../src/prisma.rs" -} - -datasource db { - provider = "postgresql" - url = env("DATABASE_URL") -} - -model AuthorAnnotation { - id Int @id @default(autoincrement()) - author_id Int @unique @map("author") - title String @db.VarChar(256) - text String - file String? @db.VarChar(256) - author Author @relation(fields: [author_id], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "fk_author_annotations_authors_id_author") - - @@index([author_id], map: "author_annotation_author_id") - @@map("author_annotations") -} - -model Author { - id Int @id @default(autoincrement()) - source_id Int @map("source") @db.SmallInt - remote_id Int - first_name String @db.VarChar(256) - last_name String @db.VarChar(256) - middle_name String? @db.VarChar(256) - source Source @relation(fields: [source_id], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "fk_authors_sources_id_source") - author_annotation AuthorAnnotation? - book_authors BookAuthor[] - translations Translator[] - - @@unique([source_id, remote_id], map: "uc_authors_source_remote_id") - @@map("authors") -} - -model BookAnnotation { - id Int @id @default(autoincrement()) - book_id Int @unique @map("book") - title String @db.VarChar(256) - text String - file String? @db.VarChar(256) - book Book @relation(fields: [book_id], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "fk_book_annotations_books_id_book") - - @@index([book_id], map: "book_annotation_book_id") - @@map("book_annotations") -} - -model BookAuthor { - id Int @id @default(autoincrement()) - author_id Int @map("author") - book_id Int @map("book") - author Author @relation(fields: [author_id], references: [id], onDelete: Cascade, map: "fk_book_authors_authors_author_id") - book Book @relation(fields: [book_id], references: [id], onDelete: Cascade, map: "fk_book_authors_books_book_id") - - @@unique([book_id, author_id], map: "uc_book_authors_book_author") - @@index([author_id], map: "book_authors_author") - @@index([book_id], map: "book_authors_book") - @@map("book_authors") -} - -model BookGenre { - id Int @id @default(autoincrement()) - genre_id Int @map("genre") - book_id Int @map("book") - book Book @relation(fields: [book_id], references: [id], onDelete: Cascade, map: "fk_book_genres_books_book_id") - genre Genre @relation(fields: [genre_id], references: [id], onDelete: Cascade, map: "fk_book_genres_genres_genre_id") - - @@unique([book_id, genre_id], map: "uc_book_genres_book_genre") - @@index([book_id], map: "book_genres_book") - @@index([genre_id], map: "book_genres_genre") - @@map("book_genres") -} - -model BookSequence { - id Int @id @default(autoincrement()) - position Int @db.SmallInt - sequence_id Int @map("sequence") - book_id Int @map("book") - book Book @relation(fields: [book_id], references: [id], onDelete: Cascade, map: "fk_book_sequences_books_book_id") - sequence Sequence @relation(fields: [sequence_id], references: [id], onDelete: Cascade, map: "fk_book_sequences_sequences_sequence_id") - - @@unique([book_id, sequence_id], map: "uc_book_sequences_book_sequence") - @@index([book_id], map: "book_sequences_book") - @@index([sequence_id], map: "book_sequences_sequence") - @@map("book_sequences") -} - -model Book { - id Int @id @default(autoincrement()) - source_id Int @map("source") @db.SmallInt - remote_id Int - title String @db.VarChar(256) - lang String @db.VarChar(3) - file_type String @db.VarChar(4) - uploaded DateTime @db.Date - is_deleted Boolean @default(false) - pages Int? - year Int @db.SmallInt @default(0) - source Source @relation(fields: [source_id], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "fk_books_sources_id_source") - book_annotation BookAnnotation? - book_authors BookAuthor[] - book_genres BookGenre[] - book_sequences BookSequence[] - translations Translator[] - - @@unique([source_id, remote_id], map: "uc_books_source_remote_id") - @@index([file_type], map: "ix_books_file_type") - @@index([uploaded], map: "ix_books_uploaded") - @@map("books") -} - -model Genre { - id Int @id @default(autoincrement()) - source_id Int @map("source") @db.SmallInt - remote_id Int - code String @db.VarChar(45) - description String @db.VarChar(99) - meta String @db.VarChar(45) - source Source @relation(fields: [source_id], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "fk_genres_sources_id_source") - book_genres BookGenre[] - - @@unique([source_id, remote_id], map: "uc_genres_source_remote_id") - @@map("genres") -} - -model Sequence { - id Int @id @default(autoincrement()) - source_id Int @map("source") @db.SmallInt - remote_id Int - name String @db.VarChar(256) - source Source @relation(fields: [source_id], references: [id], onDelete: NoAction, onUpdate: NoAction, map: "fk_sequences_sources_id_source") - book_sequences BookSequence[] - - @@unique([source_id, remote_id], map: "uc_sequences_source_remote_id") - @@map("sequences") -} - -model Source { - id Int @id @default(autoincrement()) @db.SmallInt - name String @unique @db.VarChar(32) - authors Author[] - books Book[] - genres Genre[] - sequences Sequence[] - - @@map("sources") -} - -model Translator { - id Int @id @default(autoincrement()) - position Int @db.SmallInt - author_id Int @map("author") - book_id Int @map("book") - author Author @relation(fields: [author_id], references: [id], onDelete: Cascade, map: "fk_translations_authors_author_id") - book Book @relation(fields: [book_id], references: [id], onDelete: Cascade, map: "fk_translations_books_book_id") - - @@unique([book_id, author_id], map: "uc_translations_book_author") - @@index([author_id], map: "translations_author") - @@index([book_id], map: "translations_book") - @@map("translations") -} diff --git a/src/db.rs b/src/db.rs index ad34d60..d66431c 100644 --- a/src/db.rs +++ b/src/db.rs @@ -1,8 +1,10 @@ -use crate::{config::CONFIG, prisma::PrismaClient}; +use crate::config::CONFIG; -pub async fn get_prisma_client() -> PrismaClient { +use sqlx::{postgres::PgPoolOptions, PgPool}; + +pub async fn get_postgres_pool() -> PgPool { let database_url: String = format!( - "postgresql://{}:{}@{}:{}/{}?connection_limit=10&pool_timeout=300", + "postgresql://{}:{}@{}:{}/{}", CONFIG.postgres_user, CONFIG.postgres_password, CONFIG.postgres_host, @@ -10,9 +12,10 @@ pub async fn get_prisma_client() -> PrismaClient { CONFIG.postgres_db ); - PrismaClient::_builder() - .with_url(database_url) - .build() + PgPoolOptions::new() + .max_connections(10) + .acquire_timeout(std::time::Duration::from_secs(300)) + .connect(&database_url) .await .unwrap() } diff --git a/src/main.rs b/src/main.rs index b506f78..813e8bb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,7 +1,6 @@ pub mod config; pub mod db; pub mod meilisearch; -pub mod prisma; pub mod serializers; pub mod views; diff --git a/src/prisma.rs b/src/prisma.rs deleted file mode 100644 index 58cb4c2..0000000 --- a/src/prisma.rs +++ /dev/null @@ -1,15957 +0,0 @@ -// Code generated by Prisma Client Rust. DO NOT EDIT - -#![allow(clippy::all)] - -pub static DATAMODEL_STR: &str = include_str!("../prisma/schema.prisma"); -static DATABASE_STR: &str = "postgresql"; -pub async fn new_client() -> Result { - PrismaClient::_builder().build().await -} -pub async fn new_client_with_url( - url: &str, -) -> Result { - PrismaClient::_builder() - .with_url(url.to_string()) - .build() - .await -} -pub mod author_annotation { - - use super::*; - pub const NAME: &str = "AuthorAnnotation"; - pub mod id { - use super::super::*; - - use super::{OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam}; - pub const NAME: &str = "id"; - pub struct Set(pub i32); - impl From for SetParam { - fn from(Set(v): Set) -> Self { - Self::SetId(v) - } - } - impl From for UncheckedSetParam { - fn from(Set(v): Set) -> Self { - Self::Id(v) - } - } - pub fn set>(value: i32) -> T { - Set(value).into() - } - pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { - OrderByParam::Id(direction) - } - pub fn equals>(value: i32) -> T { - UniqueWhereParam::IdEquals(value).into() - } - ::prisma_client_rust::scalar_where_param_fns!(_prisma::read_filters::IntFilter, Id, { - fn in_vec(_: Vec) -> InVec; - fn not_in_vec(_: Vec) -> NotInVec; - fn lt(_: i32) -> Lt; - fn lte(_: i32) -> Lte; - fn gt(_: i32) -> Gt; - fn gte(_: i32) -> Gte; - fn not(_: i32) -> Not; - }); - pub fn increment(value: i32) -> SetParam { - SetParam::IncrementId(value) - } - pub fn decrement(value: i32) -> SetParam { - SetParam::DecrementId(value) - } - pub fn multiply(value: i32) -> SetParam { - SetParam::MultiplyId(value) - } - pub fn divide(value: i32) -> SetParam { - SetParam::DivideId(value) - } - pub struct Include; - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::Id(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - pub struct Select; - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::Id(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - } - pub mod author_id { - use super::super::*; - - use super::{OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam}; - pub const NAME: &str = "author_id"; - pub struct Set(pub i32); - impl From for SetParam { - fn from(Set(v): Set) -> Self { - Self::SetAuthorId(v) - } - } - impl From for UncheckedSetParam { - fn from(Set(v): Set) -> Self { - Self::AuthorId(v) - } - } - pub fn set>(value: i32) -> T { - Set(value).into() - } - pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { - OrderByParam::AuthorId(direction) - } - pub fn equals>(value: i32) -> T { - UniqueWhereParam::AuthorIdEquals(value).into() - } - ::prisma_client_rust::scalar_where_param_fns!( - _prisma::read_filters::IntFilter, - AuthorId, - { - fn in_vec(_: Vec) -> InVec; - fn not_in_vec(_: Vec) -> NotInVec; - fn lt(_: i32) -> Lt; - fn lte(_: i32) -> Lte; - fn gt(_: i32) -> Gt; - fn gte(_: i32) -> Gte; - fn not(_: i32) -> Not; - } - ); - pub fn increment(value: i32) -> SetParam { - SetParam::IncrementAuthorId(value) - } - pub fn decrement(value: i32) -> SetParam { - SetParam::DecrementAuthorId(value) - } - pub fn multiply(value: i32) -> SetParam { - SetParam::MultiplyAuthorId(value) - } - pub fn divide(value: i32) -> SetParam { - SetParam::DivideAuthorId(value) - } - pub struct Include; - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::AuthorId(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - pub struct Select; - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::AuthorId(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - } - pub mod title { - use super::super::*; - - use super::{OrderByParam, SetParam, UncheckedSetParam, WhereParam}; - pub const NAME: &str = "title"; - pub struct Set(pub String); - impl From for SetParam { - fn from(Set(v): Set) -> Self { - Self::SetTitle(v) - } - } - impl From for UncheckedSetParam { - fn from(Set(v): Set) -> Self { - Self::Title(v) - } - } - pub fn set>(value: String) -> T { - Set(value).into() - } - pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { - OrderByParam::Title(direction) - } - pub fn equals(value: String) -> WhereParam { - WhereParam::Title(_prisma::read_filters::StringFilter::Equals(value)) - } - ::prisma_client_rust::scalar_where_param_fns!( - _prisma::read_filters::StringFilter, - Title, - { - fn in_vec(_: Vec) -> InVec; - fn not_in_vec(_: Vec) -> NotInVec; - fn lt(_: String) -> Lt; - fn lte(_: String) -> Lte; - fn gt(_: String) -> Gt; - fn gte(_: String) -> Gte; - fn contains(_: String) -> Contains; - fn starts_with(_: String) -> StartsWith; - fn ends_with(_: String) -> EndsWith; - fn mode(_: super::super::QueryMode) -> Mode; - fn not(_: String) -> Not; - } - ); - pub struct Include; - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::Title(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - pub struct Select; - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::Title(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - } - pub mod text { - use super::super::*; - - use super::{OrderByParam, SetParam, UncheckedSetParam, WhereParam}; - pub const NAME: &str = "text"; - pub struct Set(pub String); - impl From for SetParam { - fn from(Set(v): Set) -> Self { - Self::SetText(v) - } - } - impl From for UncheckedSetParam { - fn from(Set(v): Set) -> Self { - Self::Text(v) - } - } - pub fn set>(value: String) -> T { - Set(value).into() - } - pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { - OrderByParam::Text(direction) - } - pub fn equals(value: String) -> WhereParam { - WhereParam::Text(_prisma::read_filters::StringFilter::Equals(value)) - } - ::prisma_client_rust::scalar_where_param_fns!(_prisma::read_filters::StringFilter, Text, { - fn in_vec(_: Vec) -> InVec; - fn not_in_vec(_: Vec) -> NotInVec; - fn lt(_: String) -> Lt; - fn lte(_: String) -> Lte; - fn gt(_: String) -> Gt; - fn gte(_: String) -> Gte; - fn contains(_: String) -> Contains; - fn starts_with(_: String) -> StartsWith; - fn ends_with(_: String) -> EndsWith; - fn mode(_: super::super::QueryMode) -> Mode; - fn not(_: String) -> Not; - }); - pub struct Include; - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::Text(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - pub struct Select; - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::Text(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - } - pub mod file { - use super::super::*; - - use super::{OrderByParam, SetParam, UncheckedSetParam, WhereParam}; - pub const NAME: &str = "file"; - pub struct Set(pub Option); - impl From for SetParam { - fn from(Set(v): Set) -> Self { - Self::SetFile(v) - } - } - impl From for UncheckedSetParam { - fn from(Set(v): Set) -> Self { - Self::File(v) - } - } - pub fn set>(value: Option) -> T { - Set(value).into() - } - pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { - OrderByParam::File(direction) - } - pub fn equals(value: Option) -> WhereParam { - WhereParam::File(_prisma::read_filters::StringNullableFilter::Equals(value)) - } - ::prisma_client_rust::scalar_where_param_fns!( - _prisma::read_filters::StringNullableFilter, - File, - { - fn in_vec(_: Vec) -> InVec; - fn not_in_vec(_: Vec) -> NotInVec; - fn lt(_: String) -> Lt; - fn lte(_: String) -> Lte; - fn gt(_: String) -> Gt; - fn gte(_: String) -> Gte; - fn contains(_: String) -> Contains; - fn starts_with(_: String) -> StartsWith; - fn ends_with(_: String) -> EndsWith; - fn mode(_: super::super::QueryMode) -> Mode; - fn not(_: Option) -> Not; - } - ); - pub struct Include; - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::File(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - pub struct Select; - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::File(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - } - pub mod author { - use super::super::*; - - use super::{SetParam, WhereParam, WithParam}; - pub const NAME: &str = "author"; - pub struct Fetch(pub author::UniqueArgs); - impl Fetch { - pub fn with(mut self, params: impl Into) -> Self { - self.0 = self.0.with(params.into()); - self - } - } - impl From for WithParam { - fn from(Fetch(v): Fetch) -> Self { - WithParam::Author(v) - } - } - pub fn fetch() -> Fetch { - Fetch(author::UniqueArgs::new()) - } - pub struct Connect(author::UniqueWhereParam); - impl From for SetParam { - fn from(Connect(v): Connect) -> Self { - Self::ConnectAuthor(v) - } - } - pub fn connect>(value: author::UniqueWhereParam) -> T { - Connect(value).into() - } - pub fn is(value: Vec) -> WhereParam { - WhereParam::AuthorIs(value) - } - pub fn is_not(value: Vec) -> WhereParam { - WhereParam::AuthorIsNot(value) - } - pub enum Include { - Select(Vec), - Include(Vec), - Fetch, - } - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::Author(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let selections = match self { - Self::Select(selections) => { - selections.into_iter().map(|s| s.to_selection()).collect() - } - Self::Include(selections) => { - let mut nested_selections = - ::scalar_selections( - ); - nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); - nested_selections - } - Self::Fetch => { - ::scalar_selections() - } - }; - ::prisma_client_rust::Selection::new("author", None, [], selections) - } - pub fn select(nested_selections: Vec) -> Self { - Self::Select(nested_selections) - } - pub fn include(nested_selections: Vec) -> Self { - Self::Include(nested_selections) - } - } - pub enum Select { - Select(Vec), - Include(Vec), - Fetch, - } - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::Author(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let selections = match self { - Self::Select(selections) => { - selections.into_iter().map(|s| s.to_selection()).collect() - } - Self::Include(selections) => { - let mut nested_selections = vec![]; - nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); - nested_selections - } - Self::Fetch => { - ::scalar_selections() - } - }; - ::prisma_client_rust::Selection::new("author", None, [], selections) - } - pub fn select(nested_selections: Vec) -> Self { - Self::Select(nested_selections) - } - pub fn include(nested_selections: Vec) -> Self { - Self::Include(nested_selections) - } - } - } - pub fn create( - title: String, - text: String, - author: super::author::UniqueWhereParam, - _params: Vec, - ) -> ( - String, - String, - super::author::UniqueWhereParam, - Vec, - ) { - (title, text, author, _params) - } - pub fn create_unchecked( - author_id: i32, - title: String, - text: String, - _params: Vec, - ) -> (i32, String, String, Vec) { - (author_id, title, text, _params) - } - #[macro_export] - macro_rules ! _select_author_annotation { ($ (($ ($ func_arg : ident : $ func_arg_ty : ty) , +) =>) ? $ module_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { # [allow (warnings)] pub mod $ module_name { crate :: prisma :: author_annotation :: select ! (@ definitions ; $ module_name ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; use super :: * ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: SelectType for Selection { type Data = Data ; type ModelData = crate :: prisma :: author_annotation :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn select ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: author_annotation :: select ! (@ selections_to_params ; : select { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () ,] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } } ; ({ $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { { crate :: prisma :: author_annotation :: select ! (@ definitions ; ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: SelectType for Selection { type Data = Data ; type ModelData = crate :: prisma :: author_annotation :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: author_annotation :: select ! (@ selections_to_params ; : select { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () ,] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } ; (@ definitions ; $ ($ module_name : ident) ? ; $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) +) => { # [allow (warnings)] enum Fields { id , author_id , title , text , file , author } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] pub struct Data { $ (pub $ field : crate :: prisma :: author_annotation :: select ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } impl :: serde :: Serialize for Data { fn serialize < S > (& self , serializer : S) -> Result < S :: Ok , S :: Error > where S : :: serde :: Serializer , { use :: serde :: ser :: SerializeStruct ; let mut state = serializer . serialize_struct ("Data" , [$ (stringify ! ($ field) ,) +] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: author_annotation :: $ field :: NAME , & self . $ field) ? ;) * state . end () } } impl < 'de > :: serde :: Deserialize < 'de > for Data { fn deserialize < D > (deserializer : D) -> Result < Self , D :: Error > where D : :: serde :: Deserializer < 'de > , { # [allow (warnings)] enum Field { $ ($ field) , + , } impl < 'de > :: serde :: Deserialize < 'de > for Field { fn deserialize < D > (deserializer : D) -> Result < Field , D :: Error > where D : :: serde :: Deserializer < 'de > , { struct FieldVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for FieldVisitor { type Value = Field ; fn expecting (& self , formatter : & mut :: std :: fmt :: Formatter) -> :: std :: fmt :: Result { formatter . write_str (& [$ (crate :: prisma :: author_annotation :: $ field :: NAME) , + ,] . into_iter () . collect :: < Vec < _ >> () . join (", ")) } fn visit_str < E > (self , value : & str) -> Result < Field , E > where E : :: serde :: de :: Error , { match value { $ (crate :: prisma :: author_annotation :: $ field :: NAME => Ok (Field :: $ field)) , * , _ => Err (:: serde :: de :: Error :: unknown_field (value , FIELDS)) , } } } deserializer . deserialize_identifier (FieldVisitor) } } struct DataVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for DataVisitor { type Value = Data ; fn expecting (& self , formatter : & mut std :: fmt :: Formatter) -> std :: fmt :: Result { formatter . write_str ("struct Data") } fn visit_map < V > (self , mut map : V) -> Result < Data , V :: Error > where V : :: serde :: de :: MapAccess < 'de > , { $ (let mut $ field = None ;) * while let Some (key) = map . next_key () ? { match key { $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: author_annotation :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: author_annotation :: $ field :: NAME)) ? ;) * Ok (Data { $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "author_id" , "title" , "text" , "file" , "author"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: author_annotation :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; id) => { i32 } ; (@ field_type ; author_id) => { i32 } ; (@ field_type ; title) => { String } ; (@ field_type ; text) => { String } ; (@ field_type ; file) => { Option < String > } ; (@ field_type ; author : $ selection_mode : ident { $ ($ selections : tt) + }) => { author :: Data } ; (@ field_type ; author) => { crate :: prisma :: author :: Data } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "AuthorAnnotation" , available relations are "id, author_id, title, text, file, author")) } ; (@ field_module ; author : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: author :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; id) => { Into :: < crate :: prisma :: author_annotation :: SelectParam > :: into (crate :: prisma :: author_annotation :: id :: Select) } ; (@ selection_field_to_selection_param ; author_id) => { Into :: < crate :: prisma :: author_annotation :: SelectParam > :: into (crate :: prisma :: author_annotation :: author_id :: Select) } ; (@ selection_field_to_selection_param ; title) => { Into :: < crate :: prisma :: author_annotation :: SelectParam > :: into (crate :: prisma :: author_annotation :: title :: Select) } ; (@ selection_field_to_selection_param ; text) => { Into :: < crate :: prisma :: author_annotation :: SelectParam > :: into (crate :: prisma :: author_annotation :: text :: Select) } ; (@ selection_field_to_selection_param ; file) => { Into :: < crate :: prisma :: author_annotation :: SelectParam > :: into (crate :: prisma :: author_annotation :: file :: Select) } ; (@ selection_field_to_selection_param ; author $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: author_annotation :: SelectParam > :: into (crate :: prisma :: author_annotation :: author :: Select :: $ selection_mode (crate :: prisma :: author :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; author $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: author_annotation :: SelectParam > :: into (crate :: prisma :: author_annotation :: author :: Select :: Fetch) } } ; (@ selection_field_to_selection_param ; $ ($ tokens : tt) *) => { compile_error ! (stringify ! ($ ($ tokens) *)) } ; (@ selections_to_params ; : $ macro_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { [$ (crate :: prisma :: author_annotation :: $ macro_name ! (@ selection_field_to_selection_param ; $ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) ,) +] } ; (@ filters_to_args ;) => { vec ! [] } ; (@ filters_to_args ; $ ($ t : tt) *) => { $ ($ t) * } ; (@ field_serde_name ; id) => { "id" } ; (@ field_serde_name ; author_id) => { "author_id" } ; (@ field_serde_name ; title) => { "title" } ; (@ field_serde_name ; text) => { "text" } ; (@ field_serde_name ; file) => { "file" } ; (@ field_serde_name ; author) => { "author" } ; } - pub use _select_author_annotation as select; - pub enum SelectParam { - Id(id::Select), - AuthorId(author_id::Select), - Title(title::Select), - Text(text::Select), - File(file::Select), - Author(author::Select), - } - impl SelectParam { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - match self { - Self::Id(data) => data.to_selection(), - Self::AuthorId(data) => data.to_selection(), - Self::Title(data) => data.to_selection(), - Self::Text(data) => data.to_selection(), - Self::File(data) => data.to_selection(), - Self::Author(data) => data.to_selection(), - } - } - } - #[macro_export] - macro_rules ! _include_author_annotation { ($ (($ ($ func_arg : ident : $ func_arg_ty : ty) , +) =>) ? $ module_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { # [allow (warnings)] pub mod $ module_name { crate :: prisma :: author_annotation :: include ! (@ definitions ; $ module_name ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; use super :: * ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: IncludeType for Selection { type Data = Data ; type ModelData = crate :: prisma :: author_annotation :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn include ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: author_annotation :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: author_annotation :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } } ; ({ $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { { crate :: prisma :: author_annotation :: include ! (@ definitions ; ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: IncludeType for Selection { type Data = Data ; type ModelData = crate :: prisma :: author_annotation :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: author_annotation :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: author_annotation :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } ; (@ definitions ; $ ($ module_name : ident) ? ; $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) +) => { # [allow (warnings)] enum Fields { author } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] pub struct Data { pub id : i32 , pub author_id : i32 , pub title : String , pub text : String , pub file : Option < String > , $ (pub $ field : crate :: prisma :: author_annotation :: include ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } impl :: serde :: Serialize for Data { fn serialize < S > (& self , serializer : S) -> Result < S :: Ok , S :: Error > where S : :: serde :: Serializer , { use :: serde :: ser :: SerializeStruct ; let mut state = serializer . serialize_struct ("Data" , [$ (stringify ! ($ field) ,) + stringify ! (id) , stringify ! (author_id) , stringify ! (title) , stringify ! (text) , stringify ! (file)] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: author_annotation :: $ field :: NAME , & self . $ field) ? ;) * state . serialize_field (crate :: prisma :: author_annotation :: id :: NAME , & self . id) ? ; state . serialize_field (crate :: prisma :: author_annotation :: author_id :: NAME , & self . author_id) ? ; state . serialize_field (crate :: prisma :: author_annotation :: title :: NAME , & self . title) ? ; state . serialize_field (crate :: prisma :: author_annotation :: text :: NAME , & self . text) ? ; state . serialize_field (crate :: prisma :: author_annotation :: file :: NAME , & self . file) ? ; state . end () } } impl < 'de > :: serde :: Deserialize < 'de > for Data { fn deserialize < D > (deserializer : D) -> Result < Self , D :: Error > where D : :: serde :: Deserializer < 'de > , { # [allow (warnings)] enum Field { $ ($ field) , + , id , author_id , title , text , file } impl < 'de > :: serde :: Deserialize < 'de > for Field { fn deserialize < D > (deserializer : D) -> Result < Field , D :: Error > where D : :: serde :: Deserializer < 'de > , { struct FieldVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for FieldVisitor { type Value = Field ; fn expecting (& self , formatter : & mut :: std :: fmt :: Formatter) -> :: std :: fmt :: Result { formatter . write_str (& [$ (crate :: prisma :: author_annotation :: $ field :: NAME) , + , crate :: prisma :: author_annotation :: id :: NAME , crate :: prisma :: author_annotation :: author_id :: NAME , crate :: prisma :: author_annotation :: title :: NAME , crate :: prisma :: author_annotation :: text :: NAME , crate :: prisma :: author_annotation :: file :: NAME] . into_iter () . collect :: < Vec < _ >> () . join (", ")) } fn visit_str < E > (self , value : & str) -> Result < Field , E > where E : :: serde :: de :: Error , { match value { $ (crate :: prisma :: author_annotation :: $ field :: NAME => Ok (Field :: $ field)) , * , crate :: prisma :: author_annotation :: id :: NAME => Ok (Field :: id) , crate :: prisma :: author_annotation :: author_id :: NAME => Ok (Field :: author_id) , crate :: prisma :: author_annotation :: title :: NAME => Ok (Field :: title) , crate :: prisma :: author_annotation :: text :: NAME => Ok (Field :: text) , crate :: prisma :: author_annotation :: file :: NAME => Ok (Field :: file) , _ => Err (:: serde :: de :: Error :: unknown_field (value , FIELDS)) , } } } deserializer . deserialize_identifier (FieldVisitor) } } struct DataVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for DataVisitor { type Value = Data ; fn expecting (& self , formatter : & mut std :: fmt :: Formatter) -> std :: fmt :: Result { formatter . write_str ("struct Data") } fn visit_map < V > (self , mut map : V) -> Result < Data , V :: Error > where V : :: serde :: de :: MapAccess < 'de > , { $ (let mut $ field = None ;) * let mut id = None ; let mut author_id = None ; let mut title = None ; let mut text = None ; let mut file = None ; while let Some (key) = map . next_key () ? { match key { Field :: id => { if id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: author_annotation :: id :: NAME)) ; } id = Some (map . next_value () ?) ; } Field :: author_id => { if author_id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: author_annotation :: author_id :: NAME)) ; } author_id = Some (map . next_value () ?) ; } Field :: title => { if title . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: author_annotation :: title :: NAME)) ; } title = Some (map . next_value () ?) ; } Field :: text => { if text . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: author_annotation :: text :: NAME)) ; } text = Some (map . next_value () ?) ; } Field :: file => { if file . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: author_annotation :: file :: NAME)) ; } file = Some (map . next_value () ?) ; } $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: author_annotation :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: author_annotation :: $ field :: NAME)) ? ;) * let id = id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: author_annotation :: id :: NAME)) ? ; let author_id = author_id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: author_annotation :: author_id :: NAME)) ? ; let title = title . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: author_annotation :: title :: NAME)) ? ; let text = text . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: author_annotation :: text :: NAME)) ? ; let file = file . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: author_annotation :: file :: NAME)) ? ; Ok (Data { id , author_id , title , text , file , $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "author_id" , "title" , "text" , "file" , "author"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: author_annotation :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; author : $ selection_mode : ident { $ ($ selections : tt) + }) => { author :: Data } ; (@ field_type ; author) => { crate :: prisma :: author :: Data } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "AuthorAnnotation" , available relations are "author")) } ; (@ field_module ; author : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: author :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; author $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: author_annotation :: IncludeParam > :: into (crate :: prisma :: author_annotation :: author :: Include :: $ selection_mode (crate :: prisma :: author :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; author $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: author_annotation :: IncludeParam > :: into (crate :: prisma :: author_annotation :: author :: Include :: Fetch) } } ; (@ selection_field_to_selection_param ; $ ($ tokens : tt) *) => { compile_error ! (stringify ! ($ ($ tokens) *)) } ; (@ selections_to_params ; : $ macro_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { [$ (crate :: prisma :: author_annotation :: $ macro_name ! (@ selection_field_to_selection_param ; $ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) ,) +] } ; (@ filters_to_args ;) => { vec ! [] } ; (@ filters_to_args ; $ ($ t : tt) *) => { $ ($ t) * } ; (@ field_serde_name ; id) => { "id" } ; (@ field_serde_name ; author_id) => { "author_id" } ; (@ field_serde_name ; title) => { "title" } ; (@ field_serde_name ; text) => { "text" } ; (@ field_serde_name ; file) => { "file" } ; (@ field_serde_name ; author) => { "author" } ; } - pub use _include_author_annotation as include; - pub enum IncludeParam { - Id(id::Include), - AuthorId(author_id::Include), - Title(title::Include), - Text(text::Include), - File(file::Include), - Author(author::Include), - } - impl IncludeParam { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - match self { - Self::Id(data) => data.to_selection(), - Self::AuthorId(data) => data.to_selection(), - Self::Title(data) => data.to_selection(), - Self::Text(data) => data.to_selection(), - Self::File(data) => data.to_selection(), - Self::Author(data) => data.to_selection(), - } - } - } - #[macro_export] - macro_rules ! _partial_unchecked_author_annotation { ($ struct_name : ident { $ ($ scalar_field : ident) + }) => { :: prisma_client_rust :: macros :: partial_unchecked ! { crate :: prisma :: author_annotation struct $ struct_name { # [serde (rename = "id")] pub id : i32 , # [serde (rename = "author_id")] pub author_id : i32 , # [serde (rename = "title")] pub title : String , # [serde (rename = "text")] pub text : String , # [serde (rename = "file")] # [serde (default , with = "::prisma_client_rust::serde::double_option")] pub file : Option < String > } [$ ($ scalar_field) , +] } } ; } - pub use _partial_unchecked_author_annotation as partial_unchecked; - #[derive(Debug, Clone, :: serde :: Serialize, :: serde :: Deserialize)] - pub struct Data { - #[serde(rename = "id")] - pub id: i32, - #[serde(rename = "author_id")] - pub author_id: i32, - #[serde(rename = "title")] - pub title: String, - #[serde(rename = "text")] - pub text: String, - #[serde(rename = "file")] - pub file: Option, - #[serde(rename = "author")] - pub author: Option>, - } - impl Data { - pub fn author( - &self, - ) -> Result<&super::author::Data, ::prisma_client_rust::RelationNotFetchedError> { - self.author - .as_ref() - .ok_or(::prisma_client_rust::RelationNotFetchedError::new( - stringify!(author), - )) - .map(|v| v.as_ref()) - } - } - #[derive(Clone)] - pub enum WithParam { - Author(super::author::UniqueArgs), - } - impl Into<::prisma_client_rust::Selection> for WithParam { - fn into(self) -> ::prisma_client_rust::Selection { - match self { - Self::Author(args) => { - let mut selections = < super :: author :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; - selections.extend( - args.with_params - .into_iter() - .map(Into::<::prisma_client_rust::Selection>::into), - ); - ::prisma_client_rust::Selection::new(author::NAME, None, [], selections) - } - } - } - } - #[derive(Clone)] - pub enum SetParam { - SetId(i32), - IncrementId(i32), - DecrementId(i32), - MultiplyId(i32), - DivideId(i32), - SetAuthorId(i32), - IncrementAuthorId(i32), - DecrementAuthorId(i32), - MultiplyAuthorId(i32), - DivideAuthorId(i32), - SetTitle(String), - SetText(String), - SetFile(Option), - ConnectAuthor(super::author::UniqueWhereParam), - } - impl From for (String, ::prisma_client_rust::PrismaValue) { - fn from(param: SetParam) -> Self { - match param { - SetParam::SetId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - ), - SetParam::IncrementId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "increment".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DecrementId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "decrement".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::MultiplyId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "multiply".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DivideId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "divide".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::SetAuthorId(value) => ( - author_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - ), - SetParam::IncrementAuthorId(value) => ( - author_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "increment".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DecrementAuthorId(value) => ( - author_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "decrement".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::MultiplyAuthorId(value) => ( - author_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "multiply".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DivideAuthorId(value) => ( - author_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "divide".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::SetTitle(value) => ( - title::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(value), - ), - SetParam::SetText(value) => ( - text::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(value), - ), - SetParam::SetFile(value) => ( - file::NAME.to_string(), - value - .map(|value| ::prisma_client_rust::PrismaValue::String(value)) - .unwrap_or_else(|| ::prisma_client_rust::PrismaValue::Null), - ), - SetParam::ConnectAuthor(where_param) => ( - author::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "connect".to_string(), - ::prisma_client_rust::PrismaValue::Object( - [where_param] - .into_iter() - .map(Into::::into) - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - } - } - } - #[derive(Clone)] - pub enum UncheckedSetParam { - Id(i32), - AuthorId(i32), - Title(String), - Text(String), - File(Option), - } - impl From for SetParam { - fn from(param: UncheckedSetParam) -> Self { - match param { - UncheckedSetParam::Id(value) => Self::SetId(value), - UncheckedSetParam::AuthorId(value) => Self::SetAuthorId(value), - UncheckedSetParam::Title(value) => Self::SetTitle(value), - UncheckedSetParam::Text(value) => Self::SetText(value), - UncheckedSetParam::File(value) => Self::SetFile(value), - } - } - } - #[derive(Clone)] - pub enum OrderByParam { - Id(::prisma_client_rust::Direction), - AuthorId(::prisma_client_rust::Direction), - Title(::prisma_client_rust::Direction), - Text(::prisma_client_rust::Direction), - File(::prisma_client_rust::Direction), - } - impl Into<(String, ::prisma_client_rust::PrismaValue)> for OrderByParam { - fn into(self) -> (String, ::prisma_client_rust::PrismaValue) { - match self { - Self::Id(direction) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(direction.to_string()), - ), - Self::AuthorId(direction) => ( - author_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(direction.to_string()), - ), - Self::Title(direction) => ( - title::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(direction.to_string()), - ), - Self::Text(direction) => ( - text::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(direction.to_string()), - ), - Self::File(direction) => ( - file::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(direction.to_string()), - ), - } - } - } - #[derive(Clone)] - pub enum WhereParam { - Not(Vec), - Or(Vec), - And(Vec), - Id(_prisma::read_filters::IntFilter), - AuthorId(_prisma::read_filters::IntFilter), - Title(_prisma::read_filters::StringFilter), - Text(_prisma::read_filters::StringFilter), - File(_prisma::read_filters::StringNullableFilter), - AuthorIs(Vec), - AuthorIsNot(Vec), - } - impl ::prisma_client_rust::WhereInput for WhereParam { - fn serialize(self) -> ::prisma_client_rust::SerializedWhereInput { - let (name, value) = match self { - Self::Not(value) => ( - "NOT", - ::prisma_client_rust::SerializedWhereValue::Object( - ::prisma_client_rust::merge_fields( - value - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(Into::into) - .collect(), - ), - ), - ), - Self::Or(value) => ( - "OR", - ::prisma_client_rust::SerializedWhereValue::List( - value - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(Into::into) - .map(|v| vec![v]) - .map(::prisma_client_rust::PrismaValue::Object) - .collect(), - ), - ), - Self::And(value) => ( - "AND", - ::prisma_client_rust::SerializedWhereValue::Object( - ::prisma_client_rust::merge_fields( - value - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(Into::into) - .collect(), - ), - ), - ), - Self::Id(value) => (id::NAME, value.into()), - Self::AuthorId(value) => (author_id::NAME, value.into()), - Self::Title(value) => (title::NAME, value.into()), - Self::Text(value) => (text::NAME, value.into()), - Self::File(value) => (file::NAME, value.into()), - Self::AuthorIs(where_params) => ( - author::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "is".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::AuthorIsNot(where_params) => ( - author::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "isNot".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - }; - ::prisma_client_rust::SerializedWhereInput::new(name, value.into()) - } - } - #[derive(Clone)] - pub enum UniqueWhereParam { - AuthorIdEquals(i32), - IdEquals(i32), - } - impl From for WhereParam { - fn from(value: UniqueWhereParam) -> Self { - match value { - UniqueWhereParam::AuthorIdEquals(value) => { - Self::AuthorId(_prisma::read_filters::IntFilter::Equals(value)) - } - UniqueWhereParam::IdEquals(value) => { - Self::Id(_prisma::read_filters::IntFilter::Equals(value)) - } - } - } - } - impl From<::prisma_client_rust::Operator> for WhereParam { - fn from(op: ::prisma_client_rust::Operator) -> Self { - match op { - ::prisma_client_rust::Operator::Not(value) => Self::Not(value), - ::prisma_client_rust::Operator::And(value) => Self::And(value), - ::prisma_client_rust::Operator::Or(value) => Self::Or(value), - } - } - } - #[derive(Clone)] - pub struct Types; - impl ::prisma_client_rust::ModelTypes for Types { - type Data = Data; - type Where = WhereParam; - type UncheckedSet = UncheckedSetParam; - type Set = SetParam; - type With = WithParam; - type OrderBy = OrderByParam; - type Cursor = UniqueWhereParam; - const MODEL: &'static str = NAME; - fn scalar_selections() -> Vec<::prisma_client_rust::Selection> { - vec![ - ::prisma_client_rust::sel(id::NAME), - ::prisma_client_rust::sel(author_id::NAME), - ::prisma_client_rust::sel(title::NAME), - ::prisma_client_rust::sel(text::NAME), - ::prisma_client_rust::sel(file::NAME), - ] - } - } - pub type UniqueArgs = ::prisma_client_rust::UniqueArgs; - pub type ManyArgs = ::prisma_client_rust::ManyArgs; - pub type Count<'a> = ::prisma_client_rust::Count<'a, Types>; - pub type Create<'a> = ::prisma_client_rust::Create<'a, Types>; - pub type CreateMany<'a> = ::prisma_client_rust::CreateMany<'a, Types>; - pub type FindUnique<'a> = ::prisma_client_rust::FindUnique<'a, Types>; - pub type FindMany<'a> = ::prisma_client_rust::FindMany<'a, Types>; - pub type FindFirst<'a> = ::prisma_client_rust::FindFirst<'a, Types>; - pub type Update<'a> = ::prisma_client_rust::Update<'a, Types>; - pub type UpdateMany<'a> = ::prisma_client_rust::UpdateMany<'a, Types>; - pub type Upsert<'a> = ::prisma_client_rust::Upsert<'a, Types>; - pub type Delete<'a> = ::prisma_client_rust::Delete<'a, Types>; - pub type DeleteMany<'a> = ::prisma_client_rust::DeleteMany<'a, Types>; - #[derive(Clone)] - pub struct Actions<'a> { - pub client: &'a ::prisma_client_rust::PrismaClientInternals, - } - impl<'a> Actions<'a> { - pub fn find_unique(self, _where: UniqueWhereParam) -> FindUnique<'a> { - FindUnique::new(self.client, _where.into()) - } - pub fn find_first(self, _where: Vec) -> FindFirst<'a> { - FindFirst::new(self.client, _where) - } - pub fn find_many(self, _where: Vec) -> FindMany<'a> { - FindMany::new(self.client, _where) - } - pub fn create( - self, - title: String, - text: String, - author: super::author::UniqueWhereParam, - mut _params: Vec, - ) -> Create<'a> { - _params.extend([title::set(title), text::set(text), author::connect(author)]); - Create::new(self.client, _params) - } - pub fn create_unchecked( - self, - author_id: i32, - title: String, - text: String, - mut _params: Vec, - ) -> Create<'a> { - _params.extend([ - author_id::set(author_id), - title::set(title), - text::set(text), - ]); - Create::new(self.client, _params.into_iter().map(Into::into).collect()) - } - pub fn create_many( - self, - data: Vec<(i32, String, String, Vec)>, - ) -> CreateMany<'a> { - let data = data - .into_iter() - .map(|(author_id, title, text, mut _params)| { - _params.extend([ - author_id::set(author_id), - title::set(title), - text::set(text), - ]); - _params - }) - .collect(); - CreateMany::new(self.client, data) - } - pub fn update(self, _where: UniqueWhereParam, _params: Vec) -> Update<'a> { - Update::new(self.client, _where.into(), _params, vec![]) - } - pub fn update_unchecked( - self, - _where: UniqueWhereParam, - _params: Vec, - ) -> Update<'a> { - Update::new( - self.client, - _where.into(), - _params.into_iter().map(Into::into).collect(), - vec![], - ) - } - pub fn update_many( - self, - _where: Vec, - _params: Vec, - ) -> UpdateMany<'a> { - UpdateMany::new(self.client, _where, _params) - } - pub fn upsert( - self, - _where: UniqueWhereParam, - (title, text, author, mut _params): ( - String, - String, - super::author::UniqueWhereParam, - Vec, - ), - _update: Vec, - ) -> Upsert<'a> { - _params.extend([title::set(title), text::set(text), author::connect(author)]); - Upsert::new(self.client, _where.into(), _params, _update) - } - pub fn delete(self, _where: UniqueWhereParam) -> Delete<'a> { - Delete::new(self.client, _where.into(), vec![]) - } - pub fn delete_many(self, _where: Vec) -> DeleteMany<'a> { - DeleteMany::new(self.client, _where) - } - pub fn count(self, _where: Vec) -> Count<'a> { - Count::new(self.client, _where) - } - } -} -pub mod author { - - use super::*; - pub const NAME: &str = "Author"; - pub mod id { - use super::super::*; - - use super::{OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam}; - pub const NAME: &str = "id"; - pub struct Set(pub i32); - impl From for SetParam { - fn from(Set(v): Set) -> Self { - Self::SetId(v) - } - } - impl From for UncheckedSetParam { - fn from(Set(v): Set) -> Self { - Self::Id(v) - } - } - pub fn set>(value: i32) -> T { - Set(value).into() - } - pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { - OrderByParam::Id(direction) - } - pub fn equals>(value: i32) -> T { - UniqueWhereParam::IdEquals(value).into() - } - ::prisma_client_rust::scalar_where_param_fns!(_prisma::read_filters::IntFilter, Id, { - fn in_vec(_: Vec) -> InVec; - fn not_in_vec(_: Vec) -> NotInVec; - fn lt(_: i32) -> Lt; - fn lte(_: i32) -> Lte; - fn gt(_: i32) -> Gt; - fn gte(_: i32) -> Gte; - fn not(_: i32) -> Not; - }); - pub fn increment(value: i32) -> SetParam { - SetParam::IncrementId(value) - } - pub fn decrement(value: i32) -> SetParam { - SetParam::DecrementId(value) - } - pub fn multiply(value: i32) -> SetParam { - SetParam::MultiplyId(value) - } - pub fn divide(value: i32) -> SetParam { - SetParam::DivideId(value) - } - pub struct Include; - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::Id(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - pub struct Select; - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::Id(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - } - pub mod source_id { - use super::super::*; - - use super::{OrderByParam, SetParam, UncheckedSetParam, WhereParam}; - pub const NAME: &str = "source_id"; - pub struct Set(pub i32); - impl From for SetParam { - fn from(Set(v): Set) -> Self { - Self::SetSourceId(v) - } - } - impl From for UncheckedSetParam { - fn from(Set(v): Set) -> Self { - Self::SourceId(v) - } - } - pub fn set>(value: i32) -> T { - Set(value).into() - } - pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { - OrderByParam::SourceId(direction) - } - pub fn equals(value: i32) -> WhereParam { - WhereParam::SourceId(_prisma::read_filters::IntFilter::Equals(value)) - } - ::prisma_client_rust::scalar_where_param_fns!( - _prisma::read_filters::IntFilter, - SourceId, - { - fn in_vec(_: Vec) -> InVec; - fn not_in_vec(_: Vec) -> NotInVec; - fn lt(_: i32) -> Lt; - fn lte(_: i32) -> Lte; - fn gt(_: i32) -> Gt; - fn gte(_: i32) -> Gte; - fn not(_: i32) -> Not; - } - ); - pub fn increment(value: i32) -> SetParam { - SetParam::IncrementSourceId(value) - } - pub fn decrement(value: i32) -> SetParam { - SetParam::DecrementSourceId(value) - } - pub fn multiply(value: i32) -> SetParam { - SetParam::MultiplySourceId(value) - } - pub fn divide(value: i32) -> SetParam { - SetParam::DivideSourceId(value) - } - pub struct Include; - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::SourceId(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - pub struct Select; - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::SourceId(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - } - pub mod remote_id { - use super::super::*; - - use super::{OrderByParam, SetParam, UncheckedSetParam, WhereParam}; - pub const NAME: &str = "remote_id"; - pub struct Set(pub i32); - impl From for SetParam { - fn from(Set(v): Set) -> Self { - Self::SetRemoteId(v) - } - } - impl From for UncheckedSetParam { - fn from(Set(v): Set) -> Self { - Self::RemoteId(v) - } - } - pub fn set>(value: i32) -> T { - Set(value).into() - } - pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { - OrderByParam::RemoteId(direction) - } - pub fn equals(value: i32) -> WhereParam { - WhereParam::RemoteId(_prisma::read_filters::IntFilter::Equals(value)) - } - ::prisma_client_rust::scalar_where_param_fns!( - _prisma::read_filters::IntFilter, - RemoteId, - { - fn in_vec(_: Vec) -> InVec; - fn not_in_vec(_: Vec) -> NotInVec; - fn lt(_: i32) -> Lt; - fn lte(_: i32) -> Lte; - fn gt(_: i32) -> Gt; - fn gte(_: i32) -> Gte; - fn not(_: i32) -> Not; - } - ); - pub fn increment(value: i32) -> SetParam { - SetParam::IncrementRemoteId(value) - } - pub fn decrement(value: i32) -> SetParam { - SetParam::DecrementRemoteId(value) - } - pub fn multiply(value: i32) -> SetParam { - SetParam::MultiplyRemoteId(value) - } - pub fn divide(value: i32) -> SetParam { - SetParam::DivideRemoteId(value) - } - pub struct Include; - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::RemoteId(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - pub struct Select; - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::RemoteId(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - } - pub mod first_name { - use super::super::*; - - use super::{OrderByParam, SetParam, UncheckedSetParam, WhereParam}; - pub const NAME: &str = "first_name"; - pub struct Set(pub String); - impl From for SetParam { - fn from(Set(v): Set) -> Self { - Self::SetFirstName(v) - } - } - impl From for UncheckedSetParam { - fn from(Set(v): Set) -> Self { - Self::FirstName(v) - } - } - pub fn set>(value: String) -> T { - Set(value).into() - } - pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { - OrderByParam::FirstName(direction) - } - pub fn equals(value: String) -> WhereParam { - WhereParam::FirstName(_prisma::read_filters::StringFilter::Equals(value)) - } - ::prisma_client_rust::scalar_where_param_fns!( - _prisma::read_filters::StringFilter, - FirstName, - { - fn in_vec(_: Vec) -> InVec; - fn not_in_vec(_: Vec) -> NotInVec; - fn lt(_: String) -> Lt; - fn lte(_: String) -> Lte; - fn gt(_: String) -> Gt; - fn gte(_: String) -> Gte; - fn contains(_: String) -> Contains; - fn starts_with(_: String) -> StartsWith; - fn ends_with(_: String) -> EndsWith; - fn mode(_: super::super::QueryMode) -> Mode; - fn not(_: String) -> Not; - } - ); - pub struct Include; - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::FirstName(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - pub struct Select; - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::FirstName(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - } - pub mod last_name { - use super::super::*; - - use super::{OrderByParam, SetParam, UncheckedSetParam, WhereParam}; - pub const NAME: &str = "last_name"; - pub struct Set(pub String); - impl From for SetParam { - fn from(Set(v): Set) -> Self { - Self::SetLastName(v) - } - } - impl From for UncheckedSetParam { - fn from(Set(v): Set) -> Self { - Self::LastName(v) - } - } - pub fn set>(value: String) -> T { - Set(value).into() - } - pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { - OrderByParam::LastName(direction) - } - pub fn equals(value: String) -> WhereParam { - WhereParam::LastName(_prisma::read_filters::StringFilter::Equals(value)) - } - ::prisma_client_rust::scalar_where_param_fns!( - _prisma::read_filters::StringFilter, - LastName, - { - fn in_vec(_: Vec) -> InVec; - fn not_in_vec(_: Vec) -> NotInVec; - fn lt(_: String) -> Lt; - fn lte(_: String) -> Lte; - fn gt(_: String) -> Gt; - fn gte(_: String) -> Gte; - fn contains(_: String) -> Contains; - fn starts_with(_: String) -> StartsWith; - fn ends_with(_: String) -> EndsWith; - fn mode(_: super::super::QueryMode) -> Mode; - fn not(_: String) -> Not; - } - ); - pub struct Include; - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::LastName(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - pub struct Select; - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::LastName(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - } - pub mod middle_name { - use super::super::*; - - use super::{OrderByParam, SetParam, UncheckedSetParam, WhereParam}; - pub const NAME: &str = "middle_name"; - pub struct Set(pub Option); - impl From for SetParam { - fn from(Set(v): Set) -> Self { - Self::SetMiddleName(v) - } - } - impl From for UncheckedSetParam { - fn from(Set(v): Set) -> Self { - Self::MiddleName(v) - } - } - pub fn set>(value: Option) -> T { - Set(value).into() - } - pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { - OrderByParam::MiddleName(direction) - } - pub fn equals(value: Option) -> WhereParam { - WhereParam::MiddleName(_prisma::read_filters::StringNullableFilter::Equals(value)) - } - ::prisma_client_rust::scalar_where_param_fns!( - _prisma::read_filters::StringNullableFilter, - MiddleName, - { - fn in_vec(_: Vec) -> InVec; - fn not_in_vec(_: Vec) -> NotInVec; - fn lt(_: String) -> Lt; - fn lte(_: String) -> Lte; - fn gt(_: String) -> Gt; - fn gte(_: String) -> Gte; - fn contains(_: String) -> Contains; - fn starts_with(_: String) -> StartsWith; - fn ends_with(_: String) -> EndsWith; - fn mode(_: super::super::QueryMode) -> Mode; - fn not(_: Option) -> Not; - } - ); - pub struct Include; - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::MiddleName(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - pub struct Select; - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::MiddleName(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - } - pub mod source { - use super::super::*; - - use super::{SetParam, WhereParam, WithParam}; - pub const NAME: &str = "source"; - pub struct Fetch(pub source::UniqueArgs); - impl Fetch { - pub fn with(mut self, params: impl Into) -> Self { - self.0 = self.0.with(params.into()); - self - } - } - impl From for WithParam { - fn from(Fetch(v): Fetch) -> Self { - WithParam::Source(v) - } - } - pub fn fetch() -> Fetch { - Fetch(source::UniqueArgs::new()) - } - pub struct Connect(source::UniqueWhereParam); - impl From for SetParam { - fn from(Connect(v): Connect) -> Self { - Self::ConnectSource(v) - } - } - pub fn connect>(value: source::UniqueWhereParam) -> T { - Connect(value).into() - } - pub fn is(value: Vec) -> WhereParam { - WhereParam::SourceIs(value) - } - pub fn is_not(value: Vec) -> WhereParam { - WhereParam::SourceIsNot(value) - } - pub enum Include { - Select(Vec), - Include(Vec), - Fetch, - } - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::Source(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let selections = match self { - Self::Select(selections) => { - selections.into_iter().map(|s| s.to_selection()).collect() - } - Self::Include(selections) => { - let mut nested_selections = - ::scalar_selections( - ); - nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); - nested_selections - } - Self::Fetch => { - ::scalar_selections() - } - }; - ::prisma_client_rust::Selection::new("source", None, [], selections) - } - pub fn select(nested_selections: Vec) -> Self { - Self::Select(nested_selections) - } - pub fn include(nested_selections: Vec) -> Self { - Self::Include(nested_selections) - } - } - pub enum Select { - Select(Vec), - Include(Vec), - Fetch, - } - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::Source(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let selections = match self { - Self::Select(selections) => { - selections.into_iter().map(|s| s.to_selection()).collect() - } - Self::Include(selections) => { - let mut nested_selections = vec![]; - nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); - nested_selections - } - Self::Fetch => { - ::scalar_selections() - } - }; - ::prisma_client_rust::Selection::new("source", None, [], selections) - } - pub fn select(nested_selections: Vec) -> Self { - Self::Select(nested_selections) - } - pub fn include(nested_selections: Vec) -> Self { - Self::Include(nested_selections) - } - } - } - pub mod author_annotation { - use super::super::*; - - use super::{SetParam, WhereParam, WithParam}; - pub const NAME: &str = "author_annotation"; - pub struct Fetch(pub author_annotation::UniqueArgs); - impl Fetch { - pub fn with(mut self, params: impl Into) -> Self { - self.0 = self.0.with(params.into()); - self - } - } - impl From for WithParam { - fn from(Fetch(v): Fetch) -> Self { - WithParam::AuthorAnnotation(v) - } - } - pub fn fetch() -> Fetch { - Fetch(author_annotation::UniqueArgs::new()) - } - pub struct Connect(author_annotation::UniqueWhereParam); - impl From for SetParam { - fn from(Connect(v): Connect) -> Self { - Self::ConnectAuthorAnnotation(v) - } - } - pub fn connect>(value: author_annotation::UniqueWhereParam) -> T { - Connect(value).into() - } - pub fn disconnect() -> SetParam { - SetParam::DisconnectAuthorAnnotation - } - pub fn is_null() -> WhereParam { - WhereParam::AuthorAnnotationIsNull - } - pub fn is(value: Vec) -> WhereParam { - WhereParam::AuthorAnnotationIs(value) - } - pub fn is_not(value: Vec) -> WhereParam { - WhereParam::AuthorAnnotationIsNot(value) - } - pub enum Include { - Select(Vec), - Include(Vec), - Fetch, - } - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::AuthorAnnotation(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let selections = match self { Self :: Select (selections) => { selections . into_iter () . map (| s | s . to_selection ()) . collect () } , Self :: Include (selections) => { let mut nested_selections = < author_annotation :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections } , Self :: Fetch => { < author_annotation :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () } } ; - ::prisma_client_rust::Selection::new("author_annotation", None, [], selections) - } - pub fn select(nested_selections: Vec) -> Self { - Self::Select(nested_selections) - } - pub fn include(nested_selections: Vec) -> Self { - Self::Include(nested_selections) - } - } - pub enum Select { - Select(Vec), - Include(Vec), - Fetch, - } - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::AuthorAnnotation(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let selections = match self { Self :: Select (selections) => { selections . into_iter () . map (| s | s . to_selection ()) . collect () } , Self :: Include (selections) => { let mut nested_selections = vec ! [] ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections } , Self :: Fetch => { < author_annotation :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () } } ; - ::prisma_client_rust::Selection::new("author_annotation", None, [], selections) - } - pub fn select(nested_selections: Vec) -> Self { - Self::Select(nested_selections) - } - pub fn include(nested_selections: Vec) -> Self { - Self::Include(nested_selections) - } - } - } - pub mod book_authors { - use super::super::*; - - use super::{SetParam, WhereParam, WithParam}; - pub const NAME: &str = "book_authors"; - pub struct Fetch(pub book_author::ManyArgs); - impl Fetch { - pub fn with(mut self, params: impl Into) -> Self { - self.0 = self.0.with(params.into()); - self - } - pub fn order_by(mut self, param: book_author::OrderByParam) -> Self { - self.0 = self.0.order_by(param); - self - } - pub fn skip(mut self, value: i64) -> Self { - self.0 = self.0.skip(value); - self - } - pub fn take(mut self, value: i64) -> Self { - self.0 = self.0.take(value); - self - } - pub fn cursor(mut self, value: book_author::UniqueWhereParam) -> Self { - self.0 = self.0.cursor(value.into()); - self - } - } - impl From for WithParam { - fn from(Fetch(v): Fetch) -> Self { - WithParam::BookAuthors(v) - } - } - pub fn fetch(params: Vec) -> Fetch { - Fetch(book_author::ManyArgs::new(params)) - } - pub struct Connect(pub Vec); - impl From for SetParam { - fn from(Connect(v): Connect) -> Self { - Self::ConnectBookAuthors(v) - } - } - pub fn connect>(params: Vec) -> T { - Connect(params).into() - } - pub fn disconnect(params: Vec) -> SetParam { - SetParam::DisconnectBookAuthors(params) - } - pub fn set(params: Vec) -> SetParam { - SetParam::SetBookAuthors(params) - } - pub fn some(value: Vec) -> WhereParam { - WhereParam::BookAuthorsSome(value) - } - pub fn every(value: Vec) -> WhereParam { - WhereParam::BookAuthorsEvery(value) - } - pub fn none(value: Vec) -> WhereParam { - WhereParam::BookAuthorsNone(value) - } - pub enum Include { - Select(book_author::ManyArgs, Vec), - Include(book_author::ManyArgs, Vec), - Fetch(book_author::ManyArgs), - } - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::BookAuthors(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let (args, selections) = match self { - Self::Select(args, selections) => ( - args.to_graphql().0, - selections.into_iter().map(|s| s.to_selection()).collect(), - ), - Self::Include(args, selections) => (args.to_graphql().0, { - let mut nested_selections = < book_author :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; - nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); - nested_selections - }), - Self::Fetch(args) => ( - args.to_graphql().0, - ::scalar_selections( - ), - ), - }; - ::prisma_client_rust::Selection::new(NAME, None, args, selections) - } - pub fn select( - args: book_author::ManyArgs, - nested_selections: Vec, - ) -> Self { - Self::Select(args, nested_selections) - } - pub fn include( - args: book_author::ManyArgs, - nested_selections: Vec, - ) -> Self { - Self::Include(args, nested_selections) - } - } - pub enum Select { - Select(book_author::ManyArgs, Vec), - Include(book_author::ManyArgs, Vec), - Fetch(book_author::ManyArgs), - } - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::BookAuthors(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let (args, selections) = match self { - Self::Select(args, selections) => ( - args.to_graphql().0, - selections.into_iter().map(|s| s.to_selection()).collect(), - ), - Self::Include(args, selections) => (args.to_graphql().0, { - let mut nested_selections = vec![]; - nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); - nested_selections - }), - Self::Fetch(args) => ( - args.to_graphql().0, - ::scalar_selections( - ), - ), - }; - ::prisma_client_rust::Selection::new(NAME, None, args, selections) - } - pub fn select( - args: book_author::ManyArgs, - nested_selections: Vec, - ) -> Self { - Self::Select(args, nested_selections) - } - pub fn include( - args: book_author::ManyArgs, - nested_selections: Vec, - ) -> Self { - Self::Include(args, nested_selections) - } - } - } - pub mod translations { - use super::super::*; - - use super::{SetParam, WhereParam, WithParam}; - pub const NAME: &str = "translations"; - pub struct Fetch(pub translator::ManyArgs); - impl Fetch { - pub fn with(mut self, params: impl Into) -> Self { - self.0 = self.0.with(params.into()); - self - } - pub fn order_by(mut self, param: translator::OrderByParam) -> Self { - self.0 = self.0.order_by(param); - self - } - pub fn skip(mut self, value: i64) -> Self { - self.0 = self.0.skip(value); - self - } - pub fn take(mut self, value: i64) -> Self { - self.0 = self.0.take(value); - self - } - pub fn cursor(mut self, value: translator::UniqueWhereParam) -> Self { - self.0 = self.0.cursor(value.into()); - self - } - } - impl From for WithParam { - fn from(Fetch(v): Fetch) -> Self { - WithParam::Translations(v) - } - } - pub fn fetch(params: Vec) -> Fetch { - Fetch(translator::ManyArgs::new(params)) - } - pub struct Connect(pub Vec); - impl From for SetParam { - fn from(Connect(v): Connect) -> Self { - Self::ConnectTranslations(v) - } - } - pub fn connect>(params: Vec) -> T { - Connect(params).into() - } - pub fn disconnect(params: Vec) -> SetParam { - SetParam::DisconnectTranslations(params) - } - pub fn set(params: Vec) -> SetParam { - SetParam::SetTranslations(params) - } - pub fn some(value: Vec) -> WhereParam { - WhereParam::TranslationsSome(value) - } - pub fn every(value: Vec) -> WhereParam { - WhereParam::TranslationsEvery(value) - } - pub fn none(value: Vec) -> WhereParam { - WhereParam::TranslationsNone(value) - } - pub enum Include { - Select(translator::ManyArgs, Vec), - Include(translator::ManyArgs, Vec), - Fetch(translator::ManyArgs), - } - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::Translations(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let (args, selections) = match self { - Self::Select(args, selections) => ( - args.to_graphql().0, - selections.into_iter().map(|s| s.to_selection()).collect(), - ), - Self::Include(args, selections) => (args.to_graphql().0, { - let mut nested_selections = < translator :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; - nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); - nested_selections - }), - Self::Fetch(args) => ( - args.to_graphql().0, - ::scalar_selections( - ), - ), - }; - ::prisma_client_rust::Selection::new(NAME, None, args, selections) - } - pub fn select( - args: translator::ManyArgs, - nested_selections: Vec, - ) -> Self { - Self::Select(args, nested_selections) - } - pub fn include( - args: translator::ManyArgs, - nested_selections: Vec, - ) -> Self { - Self::Include(args, nested_selections) - } - } - pub enum Select { - Select(translator::ManyArgs, Vec), - Include(translator::ManyArgs, Vec), - Fetch(translator::ManyArgs), - } - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::Translations(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let (args, selections) = match self { - Self::Select(args, selections) => ( - args.to_graphql().0, - selections.into_iter().map(|s| s.to_selection()).collect(), - ), - Self::Include(args, selections) => (args.to_graphql().0, { - let mut nested_selections = vec![]; - nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); - nested_selections - }), - Self::Fetch(args) => ( - args.to_graphql().0, - ::scalar_selections( - ), - ), - }; - ::prisma_client_rust::Selection::new(NAME, None, args, selections) - } - pub fn select( - args: translator::ManyArgs, - nested_selections: Vec, - ) -> Self { - Self::Select(args, nested_selections) - } - pub fn include( - args: translator::ManyArgs, - nested_selections: Vec, - ) -> Self { - Self::Include(args, nested_selections) - } - } - } - pub fn source_id_remote_id>(source_id: i32, remote_id: i32) -> T { - UniqueWhereParam::SourceIdRemoteIdEquals(source_id, remote_id).into() - } - pub fn create( - remote_id: i32, - first_name: String, - last_name: String, - source: super::source::UniqueWhereParam, - _params: Vec, - ) -> ( - i32, - String, - String, - super::source::UniqueWhereParam, - Vec, - ) { - (remote_id, first_name, last_name, source, _params) - } - pub fn create_unchecked( - source_id: i32, - remote_id: i32, - first_name: String, - last_name: String, - _params: Vec, - ) -> (i32, i32, String, String, Vec) { - (source_id, remote_id, first_name, last_name, _params) - } - #[macro_export] - macro_rules ! _select_author { ($ (($ ($ func_arg : ident : $ func_arg_ty : ty) , +) =>) ? $ module_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { # [allow (warnings)] pub mod $ module_name { crate :: prisma :: author :: select ! (@ definitions ; $ module_name ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; use super :: * ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: SelectType for Selection { type Data = Data ; type ModelData = crate :: prisma :: author :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn select ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: author :: select ! (@ selections_to_params ; : select { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () ,] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } } ; ({ $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { { crate :: prisma :: author :: select ! (@ definitions ; ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: SelectType for Selection { type Data = Data ; type ModelData = crate :: prisma :: author :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: author :: select ! (@ selections_to_params ; : select { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () ,] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } ; (@ definitions ; $ ($ module_name : ident) ? ; $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) +) => { # [allow (warnings)] enum Fields { id , source_id , remote_id , first_name , last_name , middle_name , source , author_annotation , book_authors , translations } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] pub struct Data { $ (pub $ field : crate :: prisma :: author :: select ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } impl :: serde :: Serialize for Data { fn serialize < S > (& self , serializer : S) -> Result < S :: Ok , S :: Error > where S : :: serde :: Serializer , { use :: serde :: ser :: SerializeStruct ; let mut state = serializer . serialize_struct ("Data" , [$ (stringify ! ($ field) ,) +] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: author :: $ field :: NAME , & self . $ field) ? ;) * state . end () } } impl < 'de > :: serde :: Deserialize < 'de > for Data { fn deserialize < D > (deserializer : D) -> Result < Self , D :: Error > where D : :: serde :: Deserializer < 'de > , { # [allow (warnings)] enum Field { $ ($ field) , + , } impl < 'de > :: serde :: Deserialize < 'de > for Field { fn deserialize < D > (deserializer : D) -> Result < Field , D :: Error > where D : :: serde :: Deserializer < 'de > , { struct FieldVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for FieldVisitor { type Value = Field ; fn expecting (& self , formatter : & mut :: std :: fmt :: Formatter) -> :: std :: fmt :: Result { formatter . write_str (& [$ (crate :: prisma :: author :: $ field :: NAME) , + ,] . into_iter () . collect :: < Vec < _ >> () . join (", ")) } fn visit_str < E > (self , value : & str) -> Result < Field , E > where E : :: serde :: de :: Error , { match value { $ (crate :: prisma :: author :: $ field :: NAME => Ok (Field :: $ field)) , * , _ => Err (:: serde :: de :: Error :: unknown_field (value , FIELDS)) , } } } deserializer . deserialize_identifier (FieldVisitor) } } struct DataVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for DataVisitor { type Value = Data ; fn expecting (& self , formatter : & mut std :: fmt :: Formatter) -> std :: fmt :: Result { formatter . write_str ("struct Data") } fn visit_map < V > (self , mut map : V) -> Result < Data , V :: Error > where V : :: serde :: de :: MapAccess < 'de > , { $ (let mut $ field = None ;) * while let Some (key) = map . next_key () ? { match key { $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: author :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: author :: $ field :: NAME)) ? ;) * Ok (Data { $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "source_id" , "remote_id" , "first_name" , "last_name" , "middle_name" , "source" , "author_annotation" , "book_authors" , "translations"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: author :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; id) => { i32 } ; (@ field_type ; source_id) => { i32 } ; (@ field_type ; remote_id) => { i32 } ; (@ field_type ; first_name) => { String } ; (@ field_type ; last_name) => { String } ; (@ field_type ; middle_name) => { Option < String > } ; (@ field_type ; source : $ selection_mode : ident { $ ($ selections : tt) + }) => { source :: Data } ; (@ field_type ; source) => { crate :: prisma :: source :: Data } ; (@ field_type ; author_annotation : $ selection_mode : ident { $ ($ selections : tt) + }) => { Option < author_annotation :: Data > } ; (@ field_type ; author_annotation) => { Option < crate :: prisma :: author_annotation :: Data > } ; (@ field_type ; book_authors : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < book_authors :: Data > } ; (@ field_type ; book_authors) => { Vec < crate :: prisma :: book_author :: Data > } ; (@ field_type ; translations : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < translations :: Data > } ; (@ field_type ; translations) => { Vec < crate :: prisma :: translator :: Data > } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "Author" , available relations are "id, source_id, remote_id, first_name, last_name, middle_name, source, author_annotation, book_authors, translations")) } ; (@ field_module ; source : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: source :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; author_annotation : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: author_annotation :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; book_authors : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: book_author :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; translations : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: translator :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; id) => { Into :: < crate :: prisma :: author :: SelectParam > :: into (crate :: prisma :: author :: id :: Select) } ; (@ selection_field_to_selection_param ; source_id) => { Into :: < crate :: prisma :: author :: SelectParam > :: into (crate :: prisma :: author :: source_id :: Select) } ; (@ selection_field_to_selection_param ; remote_id) => { Into :: < crate :: prisma :: author :: SelectParam > :: into (crate :: prisma :: author :: remote_id :: Select) } ; (@ selection_field_to_selection_param ; first_name) => { Into :: < crate :: prisma :: author :: SelectParam > :: into (crate :: prisma :: author :: first_name :: Select) } ; (@ selection_field_to_selection_param ; last_name) => { Into :: < crate :: prisma :: author :: SelectParam > :: into (crate :: prisma :: author :: last_name :: Select) } ; (@ selection_field_to_selection_param ; middle_name) => { Into :: < crate :: prisma :: author :: SelectParam > :: into (crate :: prisma :: author :: middle_name :: Select) } ; (@ selection_field_to_selection_param ; source $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: author :: SelectParam > :: into (crate :: prisma :: author :: source :: Select :: $ selection_mode (crate :: prisma :: source :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; source $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: author :: SelectParam > :: into (crate :: prisma :: author :: source :: Select :: Fetch) } } ; (@ selection_field_to_selection_param ; author_annotation $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: author :: SelectParam > :: into (crate :: prisma :: author :: author_annotation :: Select :: $ selection_mode (crate :: prisma :: author_annotation :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; author_annotation $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: author :: SelectParam > :: into (crate :: prisma :: author :: author_annotation :: Select :: Fetch) } } ; (@ selection_field_to_selection_param ; book_authors $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: author :: SelectParam > :: into (crate :: prisma :: author :: book_authors :: Select :: $ selection_mode (crate :: prisma :: book_author :: ManyArgs :: new (crate :: prisma :: book_author :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: book_author :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; book_authors $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: author :: SelectParam > :: into (crate :: prisma :: author :: book_authors :: Select :: Fetch (crate :: prisma :: book_author :: ManyArgs :: new (crate :: prisma :: book_author :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; translations $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: author :: SelectParam > :: into (crate :: prisma :: author :: translations :: Select :: $ selection_mode (crate :: prisma :: translator :: ManyArgs :: new (crate :: prisma :: translator :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: translator :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; translations $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: author :: SelectParam > :: into (crate :: prisma :: author :: translations :: Select :: Fetch (crate :: prisma :: translator :: ManyArgs :: new (crate :: prisma :: translator :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; $ ($ tokens : tt) *) => { compile_error ! (stringify ! ($ ($ tokens) *)) } ; (@ selections_to_params ; : $ macro_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { [$ (crate :: prisma :: author :: $ macro_name ! (@ selection_field_to_selection_param ; $ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) ,) +] } ; (@ filters_to_args ;) => { vec ! [] } ; (@ filters_to_args ; $ ($ t : tt) *) => { $ ($ t) * } ; (@ field_serde_name ; id) => { "id" } ; (@ field_serde_name ; source_id) => { "source_id" } ; (@ field_serde_name ; remote_id) => { "remote_id" } ; (@ field_serde_name ; first_name) => { "first_name" } ; (@ field_serde_name ; last_name) => { "last_name" } ; (@ field_serde_name ; middle_name) => { "middle_name" } ; (@ field_serde_name ; source) => { "source" } ; (@ field_serde_name ; author_annotation) => { "author_annotation" } ; (@ field_serde_name ; book_authors) => { "book_authors" } ; (@ field_serde_name ; translations) => { "translations" } ; } - pub use _select_author as select; - pub enum SelectParam { - Id(id::Select), - SourceId(source_id::Select), - RemoteId(remote_id::Select), - FirstName(first_name::Select), - LastName(last_name::Select), - MiddleName(middle_name::Select), - Source(source::Select), - AuthorAnnotation(author_annotation::Select), - BookAuthors(book_authors::Select), - Translations(translations::Select), - } - impl SelectParam { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - match self { - Self::Id(data) => data.to_selection(), - Self::SourceId(data) => data.to_selection(), - Self::RemoteId(data) => data.to_selection(), - Self::FirstName(data) => data.to_selection(), - Self::LastName(data) => data.to_selection(), - Self::MiddleName(data) => data.to_selection(), - Self::Source(data) => data.to_selection(), - Self::AuthorAnnotation(data) => data.to_selection(), - Self::BookAuthors(data) => data.to_selection(), - Self::Translations(data) => data.to_selection(), - } - } - } - #[macro_export] - macro_rules ! _include_author { ($ (($ ($ func_arg : ident : $ func_arg_ty : ty) , +) =>) ? $ module_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { # [allow (warnings)] pub mod $ module_name { crate :: prisma :: author :: include ! (@ definitions ; $ module_name ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; use super :: * ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: IncludeType for Selection { type Data = Data ; type ModelData = crate :: prisma :: author :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn include ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: author :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: author :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } } ; ({ $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { { crate :: prisma :: author :: include ! (@ definitions ; ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: IncludeType for Selection { type Data = Data ; type ModelData = crate :: prisma :: author :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: author :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: author :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } ; (@ definitions ; $ ($ module_name : ident) ? ; $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) +) => { # [allow (warnings)] enum Fields { source , author_annotation , book_authors , translations } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] pub struct Data { pub id : i32 , pub source_id : i32 , pub remote_id : i32 , pub first_name : String , pub last_name : String , pub middle_name : Option < String > , $ (pub $ field : crate :: prisma :: author :: include ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } impl :: serde :: Serialize for Data { fn serialize < S > (& self , serializer : S) -> Result < S :: Ok , S :: Error > where S : :: serde :: Serializer , { use :: serde :: ser :: SerializeStruct ; let mut state = serializer . serialize_struct ("Data" , [$ (stringify ! ($ field) ,) + stringify ! (id) , stringify ! (source_id) , stringify ! (remote_id) , stringify ! (first_name) , stringify ! (last_name) , stringify ! (middle_name)] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: author :: $ field :: NAME , & self . $ field) ? ;) * state . serialize_field (crate :: prisma :: author :: id :: NAME , & self . id) ? ; state . serialize_field (crate :: prisma :: author :: source_id :: NAME , & self . source_id) ? ; state . serialize_field (crate :: prisma :: author :: remote_id :: NAME , & self . remote_id) ? ; state . serialize_field (crate :: prisma :: author :: first_name :: NAME , & self . first_name) ? ; state . serialize_field (crate :: prisma :: author :: last_name :: NAME , & self . last_name) ? ; state . serialize_field (crate :: prisma :: author :: middle_name :: NAME , & self . middle_name) ? ; state . end () } } impl < 'de > :: serde :: Deserialize < 'de > for Data { fn deserialize < D > (deserializer : D) -> Result < Self , D :: Error > where D : :: serde :: Deserializer < 'de > , { # [allow (warnings)] enum Field { $ ($ field) , + , id , source_id , remote_id , first_name , last_name , middle_name } impl < 'de > :: serde :: Deserialize < 'de > for Field { fn deserialize < D > (deserializer : D) -> Result < Field , D :: Error > where D : :: serde :: Deserializer < 'de > , { struct FieldVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for FieldVisitor { type Value = Field ; fn expecting (& self , formatter : & mut :: std :: fmt :: Formatter) -> :: std :: fmt :: Result { formatter . write_str (& [$ (crate :: prisma :: author :: $ field :: NAME) , + , crate :: prisma :: author :: id :: NAME , crate :: prisma :: author :: source_id :: NAME , crate :: prisma :: author :: remote_id :: NAME , crate :: prisma :: author :: first_name :: NAME , crate :: prisma :: author :: last_name :: NAME , crate :: prisma :: author :: middle_name :: NAME] . into_iter () . collect :: < Vec < _ >> () . join (", ")) } fn visit_str < E > (self , value : & str) -> Result < Field , E > where E : :: serde :: de :: Error , { match value { $ (crate :: prisma :: author :: $ field :: NAME => Ok (Field :: $ field)) , * , crate :: prisma :: author :: id :: NAME => Ok (Field :: id) , crate :: prisma :: author :: source_id :: NAME => Ok (Field :: source_id) , crate :: prisma :: author :: remote_id :: NAME => Ok (Field :: remote_id) , crate :: prisma :: author :: first_name :: NAME => Ok (Field :: first_name) , crate :: prisma :: author :: last_name :: NAME => Ok (Field :: last_name) , crate :: prisma :: author :: middle_name :: NAME => Ok (Field :: middle_name) , _ => Err (:: serde :: de :: Error :: unknown_field (value , FIELDS)) , } } } deserializer . deserialize_identifier (FieldVisitor) } } struct DataVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for DataVisitor { type Value = Data ; fn expecting (& self , formatter : & mut std :: fmt :: Formatter) -> std :: fmt :: Result { formatter . write_str ("struct Data") } fn visit_map < V > (self , mut map : V) -> Result < Data , V :: Error > where V : :: serde :: de :: MapAccess < 'de > , { $ (let mut $ field = None ;) * let mut id = None ; let mut source_id = None ; let mut remote_id = None ; let mut first_name = None ; let mut last_name = None ; let mut middle_name = None ; while let Some (key) = map . next_key () ? { match key { Field :: id => { if id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: author :: id :: NAME)) ; } id = Some (map . next_value () ?) ; } Field :: source_id => { if source_id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: author :: source_id :: NAME)) ; } source_id = Some (map . next_value () ?) ; } Field :: remote_id => { if remote_id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: author :: remote_id :: NAME)) ; } remote_id = Some (map . next_value () ?) ; } Field :: first_name => { if first_name . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: author :: first_name :: NAME)) ; } first_name = Some (map . next_value () ?) ; } Field :: last_name => { if last_name . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: author :: last_name :: NAME)) ; } last_name = Some (map . next_value () ?) ; } Field :: middle_name => { if middle_name . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: author :: middle_name :: NAME)) ; } middle_name = Some (map . next_value () ?) ; } $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: author :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: author :: $ field :: NAME)) ? ;) * let id = id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: author :: id :: NAME)) ? ; let source_id = source_id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: author :: source_id :: NAME)) ? ; let remote_id = remote_id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: author :: remote_id :: NAME)) ? ; let first_name = first_name . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: author :: first_name :: NAME)) ? ; let last_name = last_name . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: author :: last_name :: NAME)) ? ; let middle_name = middle_name . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: author :: middle_name :: NAME)) ? ; Ok (Data { id , source_id , remote_id , first_name , last_name , middle_name , $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "source_id" , "remote_id" , "first_name" , "last_name" , "middle_name" , "source" , "author_annotation" , "book_authors" , "translations"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: author :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; source : $ selection_mode : ident { $ ($ selections : tt) + }) => { source :: Data } ; (@ field_type ; source) => { crate :: prisma :: source :: Data } ; (@ field_type ; author_annotation : $ selection_mode : ident { $ ($ selections : tt) + }) => { Option < author_annotation :: Data > } ; (@ field_type ; author_annotation) => { Option < crate :: prisma :: author_annotation :: Data > } ; (@ field_type ; book_authors : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < book_authors :: Data > } ; (@ field_type ; book_authors) => { Vec < crate :: prisma :: book_author :: Data > } ; (@ field_type ; translations : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < translations :: Data > } ; (@ field_type ; translations) => { Vec < crate :: prisma :: translator :: Data > } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "Author" , available relations are "source, author_annotation, book_authors, translations")) } ; (@ field_module ; source : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: source :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; author_annotation : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: author_annotation :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; book_authors : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: book_author :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; translations : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: translator :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; source $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: author :: IncludeParam > :: into (crate :: prisma :: author :: source :: Include :: $ selection_mode (crate :: prisma :: source :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; source $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: author :: IncludeParam > :: into (crate :: prisma :: author :: source :: Include :: Fetch) } } ; (@ selection_field_to_selection_param ; author_annotation $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: author :: IncludeParam > :: into (crate :: prisma :: author :: author_annotation :: Include :: $ selection_mode (crate :: prisma :: author_annotation :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; author_annotation $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: author :: IncludeParam > :: into (crate :: prisma :: author :: author_annotation :: Include :: Fetch) } } ; (@ selection_field_to_selection_param ; book_authors $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: author :: IncludeParam > :: into (crate :: prisma :: author :: book_authors :: Include :: $ selection_mode (crate :: prisma :: book_author :: ManyArgs :: new (crate :: prisma :: book_author :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: book_author :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; book_authors $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: author :: IncludeParam > :: into (crate :: prisma :: author :: book_authors :: Include :: Fetch (crate :: prisma :: book_author :: ManyArgs :: new (crate :: prisma :: book_author :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; translations $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: author :: IncludeParam > :: into (crate :: prisma :: author :: translations :: Include :: $ selection_mode (crate :: prisma :: translator :: ManyArgs :: new (crate :: prisma :: translator :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: translator :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; translations $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: author :: IncludeParam > :: into (crate :: prisma :: author :: translations :: Include :: Fetch (crate :: prisma :: translator :: ManyArgs :: new (crate :: prisma :: translator :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; $ ($ tokens : tt) *) => { compile_error ! (stringify ! ($ ($ tokens) *)) } ; (@ selections_to_params ; : $ macro_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { [$ (crate :: prisma :: author :: $ macro_name ! (@ selection_field_to_selection_param ; $ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) ,) +] } ; (@ filters_to_args ;) => { vec ! [] } ; (@ filters_to_args ; $ ($ t : tt) *) => { $ ($ t) * } ; (@ field_serde_name ; id) => { "id" } ; (@ field_serde_name ; source_id) => { "source_id" } ; (@ field_serde_name ; remote_id) => { "remote_id" } ; (@ field_serde_name ; first_name) => { "first_name" } ; (@ field_serde_name ; last_name) => { "last_name" } ; (@ field_serde_name ; middle_name) => { "middle_name" } ; (@ field_serde_name ; source) => { "source" } ; (@ field_serde_name ; author_annotation) => { "author_annotation" } ; (@ field_serde_name ; book_authors) => { "book_authors" } ; (@ field_serde_name ; translations) => { "translations" } ; } - pub use _include_author as include; - pub enum IncludeParam { - Id(id::Include), - SourceId(source_id::Include), - RemoteId(remote_id::Include), - FirstName(first_name::Include), - LastName(last_name::Include), - MiddleName(middle_name::Include), - Source(source::Include), - AuthorAnnotation(author_annotation::Include), - BookAuthors(book_authors::Include), - Translations(translations::Include), - } - impl IncludeParam { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - match self { - Self::Id(data) => data.to_selection(), - Self::SourceId(data) => data.to_selection(), - Self::RemoteId(data) => data.to_selection(), - Self::FirstName(data) => data.to_selection(), - Self::LastName(data) => data.to_selection(), - Self::MiddleName(data) => data.to_selection(), - Self::Source(data) => data.to_selection(), - Self::AuthorAnnotation(data) => data.to_selection(), - Self::BookAuthors(data) => data.to_selection(), - Self::Translations(data) => data.to_selection(), - } - } - } - #[macro_export] - macro_rules ! _partial_unchecked_author { ($ struct_name : ident { $ ($ scalar_field : ident) + }) => { :: prisma_client_rust :: macros :: partial_unchecked ! { crate :: prisma :: author struct $ struct_name { # [serde (rename = "id")] pub id : i32 , # [serde (rename = "source_id")] pub source_id : i32 , # [serde (rename = "remote_id")] pub remote_id : i32 , # [serde (rename = "first_name")] pub first_name : String , # [serde (rename = "last_name")] pub last_name : String , # [serde (rename = "middle_name")] # [serde (default , with = "::prisma_client_rust::serde::double_option")] pub middle_name : Option < String > } [$ ($ scalar_field) , +] } } ; } - pub use _partial_unchecked_author as partial_unchecked; - #[derive(Debug, Clone, :: serde :: Serialize, :: serde :: Deserialize)] - pub struct Data { - #[serde(rename = "id")] - pub id: i32, - #[serde(rename = "source_id")] - pub source_id: i32, - #[serde(rename = "remote_id")] - pub remote_id: i32, - #[serde(rename = "first_name")] - pub first_name: String, - #[serde(rename = "last_name")] - pub last_name: String, - #[serde(rename = "middle_name")] - pub middle_name: Option, - #[serde(rename = "source")] - pub source: Option>, - #[serde( - rename = "author_annotation", - default, - skip_serializing_if = "Option::is_none", - with = "prisma_client_rust::serde::double_option" - )] - pub author_annotation: Option>>, - #[serde(rename = "book_authors")] - pub book_authors: Option>, - #[serde(rename = "translations")] - pub translations: Option>, - } - impl Data { - pub fn source( - &self, - ) -> Result<&super::source::Data, ::prisma_client_rust::RelationNotFetchedError> { - self.source - .as_ref() - .ok_or(::prisma_client_rust::RelationNotFetchedError::new( - stringify!(source), - )) - .map(|v| v.as_ref()) - } - pub fn author_annotation( - &self, - ) -> Result< - Option<&super::author_annotation::Data>, - ::prisma_client_rust::RelationNotFetchedError, - > { - self.author_annotation - .as_ref() - .ok_or(::prisma_client_rust::RelationNotFetchedError::new( - stringify!(author_annotation), - )) - .map(|v| v.as_ref().map(|v| v.as_ref())) - } - pub fn book_authors( - &self, - ) -> Result<&Vec, ::prisma_client_rust::RelationNotFetchedError> - { - self.book_authors - .as_ref() - .ok_or(::prisma_client_rust::RelationNotFetchedError::new( - stringify!(book_authors), - )) - } - pub fn translations( - &self, - ) -> Result<&Vec, ::prisma_client_rust::RelationNotFetchedError> - { - self.translations - .as_ref() - .ok_or(::prisma_client_rust::RelationNotFetchedError::new( - stringify!(translations), - )) - } - } - #[derive(Clone)] - pub enum WithParam { - Source(super::source::UniqueArgs), - AuthorAnnotation(super::author_annotation::UniqueArgs), - BookAuthors(super::book_author::ManyArgs), - Translations(super::translator::ManyArgs), - } - impl Into<::prisma_client_rust::Selection> for WithParam { - fn into(self) -> ::prisma_client_rust::Selection { - match self { - Self::Source(args) => { - let mut selections = < super :: source :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; - selections.extend( - args.with_params - .into_iter() - .map(Into::<::prisma_client_rust::Selection>::into), - ); - ::prisma_client_rust::Selection::new(source::NAME, None, [], selections) - } - Self::AuthorAnnotation(args) => { - let mut selections = < super :: author_annotation :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; - selections.extend( - args.with_params - .into_iter() - .map(Into::<::prisma_client_rust::Selection>::into), - ); - ::prisma_client_rust::Selection::new( - author_annotation::NAME, - None, - [], - selections, - ) - } - Self::BookAuthors(args) => { - let (arguments, mut nested_selections) = args.to_graphql(); - nested_selections . extend (< super :: book_author :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) ; - ::prisma_client_rust::Selection::new( - book_authors::NAME, - None, - arguments, - nested_selections, - ) - } - Self::Translations(args) => { - let (arguments, mut nested_selections) = args.to_graphql(); - nested_selections . extend (< super :: translator :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) ; - ::prisma_client_rust::Selection::new( - translations::NAME, - None, - arguments, - nested_selections, - ) - } - } - } - } - #[derive(Clone)] - pub enum SetParam { - SetId(i32), - IncrementId(i32), - DecrementId(i32), - MultiplyId(i32), - DivideId(i32), - SetSourceId(i32), - IncrementSourceId(i32), - DecrementSourceId(i32), - MultiplySourceId(i32), - DivideSourceId(i32), - SetRemoteId(i32), - IncrementRemoteId(i32), - DecrementRemoteId(i32), - MultiplyRemoteId(i32), - DivideRemoteId(i32), - SetFirstName(String), - SetLastName(String), - SetMiddleName(Option), - ConnectSource(super::source::UniqueWhereParam), - ConnectAuthorAnnotation(super::author_annotation::UniqueWhereParam), - DisconnectAuthorAnnotation, - ConnectBookAuthors(Vec), - DisconnectBookAuthors(Vec), - SetBookAuthors(Vec), - ConnectTranslations(Vec), - DisconnectTranslations(Vec), - SetTranslations(Vec), - } - impl From for (String, ::prisma_client_rust::PrismaValue) { - fn from(param: SetParam) -> Self { - match param { - SetParam::SetId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - ), - SetParam::IncrementId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "increment".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DecrementId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "decrement".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::MultiplyId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "multiply".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DivideId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "divide".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::SetSourceId(value) => ( - source_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - ), - SetParam::IncrementSourceId(value) => ( - source_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "increment".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DecrementSourceId(value) => ( - source_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "decrement".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::MultiplySourceId(value) => ( - source_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "multiply".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DivideSourceId(value) => ( - source_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "divide".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::SetRemoteId(value) => ( - remote_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - ), - SetParam::IncrementRemoteId(value) => ( - remote_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "increment".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DecrementRemoteId(value) => ( - remote_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "decrement".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::MultiplyRemoteId(value) => ( - remote_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "multiply".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DivideRemoteId(value) => ( - remote_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "divide".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::SetFirstName(value) => ( - first_name::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(value), - ), - SetParam::SetLastName(value) => ( - last_name::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(value), - ), - SetParam::SetMiddleName(value) => ( - middle_name::NAME.to_string(), - value - .map(|value| ::prisma_client_rust::PrismaValue::String(value)) - .unwrap_or_else(|| ::prisma_client_rust::PrismaValue::Null), - ), - SetParam::ConnectSource(where_param) => ( - source::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "connect".to_string(), - ::prisma_client_rust::PrismaValue::Object( - [where_param] - .into_iter() - .map(Into::::into) - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - SetParam::ConnectAuthorAnnotation(where_param) => ( - author_annotation::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "connect".to_string(), - ::prisma_client_rust::PrismaValue::Object( - [where_param] - .into_iter() - .map(Into::::into) - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - SetParam::DisconnectAuthorAnnotation => ( - author_annotation::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "disconnect".to_string(), - ::prisma_client_rust::PrismaValue::Boolean(true), - )]), - ), - SetParam::ConnectBookAuthors(where_params) => ( - book_authors::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "connect".to_string(), - ::prisma_client_rust::PrismaValue::List( - where_params - .into_iter() - .map(Into::::into) - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) - .collect(), - ), - )]), - ), - SetParam::DisconnectBookAuthors(where_params) => ( - book_authors::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "disconnect".to_string(), - ::prisma_client_rust::PrismaValue::List( - where_params - .into_iter() - .map(Into::::into) - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) - .collect(), - ), - )]), - ), - SetParam::SetBookAuthors(where_params) => ( - book_authors::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "set".to_string(), - ::prisma_client_rust::PrismaValue::List( - where_params - .into_iter() - .map(Into::::into) - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) - .collect(), - ), - )]), - ), - SetParam::ConnectTranslations(where_params) => ( - translations::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "connect".to_string(), - ::prisma_client_rust::PrismaValue::List( - where_params - .into_iter() - .map(Into::::into) - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) - .collect(), - ), - )]), - ), - SetParam::DisconnectTranslations(where_params) => ( - translations::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "disconnect".to_string(), - ::prisma_client_rust::PrismaValue::List( - where_params - .into_iter() - .map(Into::::into) - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) - .collect(), - ), - )]), - ), - SetParam::SetTranslations(where_params) => ( - translations::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "set".to_string(), - ::prisma_client_rust::PrismaValue::List( - where_params - .into_iter() - .map(Into::::into) - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) - .collect(), - ), - )]), - ), - } - } - } - #[derive(Clone)] - pub enum UncheckedSetParam { - Id(i32), - SourceId(i32), - RemoteId(i32), - FirstName(String), - LastName(String), - MiddleName(Option), - } - impl From for SetParam { - fn from(param: UncheckedSetParam) -> Self { - match param { - UncheckedSetParam::Id(value) => Self::SetId(value), - UncheckedSetParam::SourceId(value) => Self::SetSourceId(value), - UncheckedSetParam::RemoteId(value) => Self::SetRemoteId(value), - UncheckedSetParam::FirstName(value) => Self::SetFirstName(value), - UncheckedSetParam::LastName(value) => Self::SetLastName(value), - UncheckedSetParam::MiddleName(value) => Self::SetMiddleName(value), - } - } - } - #[derive(Clone)] - pub enum OrderByParam { - Id(::prisma_client_rust::Direction), - SourceId(::prisma_client_rust::Direction), - RemoteId(::prisma_client_rust::Direction), - FirstName(::prisma_client_rust::Direction), - LastName(::prisma_client_rust::Direction), - MiddleName(::prisma_client_rust::Direction), - } - impl Into<(String, ::prisma_client_rust::PrismaValue)> for OrderByParam { - fn into(self) -> (String, ::prisma_client_rust::PrismaValue) { - match self { - Self::Id(direction) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(direction.to_string()), - ), - Self::SourceId(direction) => ( - source_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(direction.to_string()), - ), - Self::RemoteId(direction) => ( - remote_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(direction.to_string()), - ), - Self::FirstName(direction) => ( - first_name::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(direction.to_string()), - ), - Self::LastName(direction) => ( - last_name::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(direction.to_string()), - ), - Self::MiddleName(direction) => ( - middle_name::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(direction.to_string()), - ), - } - } - } - #[derive(Clone)] - pub enum WhereParam { - Not(Vec), - Or(Vec), - And(Vec), - SourceIdRemoteIdEquals(i32, i32), - Id(_prisma::read_filters::IntFilter), - SourceId(_prisma::read_filters::IntFilter), - RemoteId(_prisma::read_filters::IntFilter), - FirstName(_prisma::read_filters::StringFilter), - LastName(_prisma::read_filters::StringFilter), - MiddleName(_prisma::read_filters::StringNullableFilter), - SourceIs(Vec), - SourceIsNot(Vec), - AuthorAnnotationIsNull, - AuthorAnnotationIs(Vec), - AuthorAnnotationIsNot(Vec), - BookAuthorsSome(Vec), - BookAuthorsEvery(Vec), - BookAuthorsNone(Vec), - TranslationsSome(Vec), - TranslationsEvery(Vec), - TranslationsNone(Vec), - } - impl ::prisma_client_rust::WhereInput for WhereParam { - fn serialize(self) -> ::prisma_client_rust::SerializedWhereInput { - let (name, value) = match self { - Self::Not(value) => ( - "NOT", - ::prisma_client_rust::SerializedWhereValue::Object( - ::prisma_client_rust::merge_fields( - value - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(Into::into) - .collect(), - ), - ), - ), - Self::Or(value) => ( - "OR", - ::prisma_client_rust::SerializedWhereValue::List( - value - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(Into::into) - .map(|v| vec![v]) - .map(::prisma_client_rust::PrismaValue::Object) - .collect(), - ), - ), - Self::And(value) => ( - "AND", - ::prisma_client_rust::SerializedWhereValue::Object( - ::prisma_client_rust::merge_fields( - value - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(Into::into) - .collect(), - ), - ), - ), - Self::SourceIdRemoteIdEquals(source_id, remote_id) => ( - "source_id_remote_id", - ::prisma_client_rust::SerializedWhereValue::Object(vec![ - ( - source_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Int(source_id as i64), - ), - ( - remote_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Int(remote_id as i64), - ), - ]), - ), - Self::Id(value) => (id::NAME, value.into()), - Self::SourceId(value) => (source_id::NAME, value.into()), - Self::RemoteId(value) => (remote_id::NAME, value.into()), - Self::FirstName(value) => (first_name::NAME, value.into()), - Self::LastName(value) => (last_name::NAME, value.into()), - Self::MiddleName(value) => (middle_name::NAME, value.into()), - Self::SourceIs(where_params) => ( - source::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "is".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::SourceIsNot(where_params) => ( - source::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "isNot".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::AuthorAnnotationIsNull => ( - author_annotation::NAME, - ::prisma_client_rust::SerializedWhereValue::Value( - ::prisma_client_rust::PrismaValue::Null, - ), - ), - Self::AuthorAnnotationIs(where_params) => ( - author_annotation::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "is".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::AuthorAnnotationIsNot(where_params) => ( - author_annotation::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "isNot".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::BookAuthorsSome(where_params) => ( - book_authors::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "some".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::BookAuthorsEvery(where_params) => ( - book_authors::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "every".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::BookAuthorsNone(where_params) => ( - book_authors::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "none".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::TranslationsSome(where_params) => ( - translations::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "some".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::TranslationsEvery(where_params) => ( - translations::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "every".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::TranslationsNone(where_params) => ( - translations::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "none".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - }; - ::prisma_client_rust::SerializedWhereInput::new(name, value.into()) - } - } - #[derive(Clone)] - pub enum UniqueWhereParam { - SourceIdRemoteIdEquals(i32, i32), - IdEquals(i32), - } - impl From for WhereParam { - fn from(value: UniqueWhereParam) -> Self { - match value { - UniqueWhereParam::SourceIdRemoteIdEquals(source_id, remote_id) => { - Self::SourceIdRemoteIdEquals(source_id, remote_id) - } - UniqueWhereParam::IdEquals(value) => { - Self::Id(_prisma::read_filters::IntFilter::Equals(value)) - } - } - } - } - impl From<::prisma_client_rust::Operator> for WhereParam { - fn from(op: ::prisma_client_rust::Operator) -> Self { - match op { - ::prisma_client_rust::Operator::Not(value) => Self::Not(value), - ::prisma_client_rust::Operator::And(value) => Self::And(value), - ::prisma_client_rust::Operator::Or(value) => Self::Or(value), - } - } - } - #[derive(Clone)] - pub struct Types; - impl ::prisma_client_rust::ModelTypes for Types { - type Data = Data; - type Where = WhereParam; - type UncheckedSet = UncheckedSetParam; - type Set = SetParam; - type With = WithParam; - type OrderBy = OrderByParam; - type Cursor = UniqueWhereParam; - const MODEL: &'static str = NAME; - fn scalar_selections() -> Vec<::prisma_client_rust::Selection> { - vec![ - ::prisma_client_rust::sel(id::NAME), - ::prisma_client_rust::sel(source_id::NAME), - ::prisma_client_rust::sel(remote_id::NAME), - ::prisma_client_rust::sel(first_name::NAME), - ::prisma_client_rust::sel(last_name::NAME), - ::prisma_client_rust::sel(middle_name::NAME), - ] - } - } - pub type UniqueArgs = ::prisma_client_rust::UniqueArgs; - pub type ManyArgs = ::prisma_client_rust::ManyArgs; - pub type Count<'a> = ::prisma_client_rust::Count<'a, Types>; - pub type Create<'a> = ::prisma_client_rust::Create<'a, Types>; - pub type CreateMany<'a> = ::prisma_client_rust::CreateMany<'a, Types>; - pub type FindUnique<'a> = ::prisma_client_rust::FindUnique<'a, Types>; - pub type FindMany<'a> = ::prisma_client_rust::FindMany<'a, Types>; - pub type FindFirst<'a> = ::prisma_client_rust::FindFirst<'a, Types>; - pub type Update<'a> = ::prisma_client_rust::Update<'a, Types>; - pub type UpdateMany<'a> = ::prisma_client_rust::UpdateMany<'a, Types>; - pub type Upsert<'a> = ::prisma_client_rust::Upsert<'a, Types>; - pub type Delete<'a> = ::prisma_client_rust::Delete<'a, Types>; - pub type DeleteMany<'a> = ::prisma_client_rust::DeleteMany<'a, Types>; - #[derive(Clone)] - pub struct Actions<'a> { - pub client: &'a ::prisma_client_rust::PrismaClientInternals, - } - impl<'a> Actions<'a> { - pub fn find_unique(self, _where: UniqueWhereParam) -> FindUnique<'a> { - FindUnique::new(self.client, _where.into()) - } - pub fn find_first(self, _where: Vec) -> FindFirst<'a> { - FindFirst::new(self.client, _where) - } - pub fn find_many(self, _where: Vec) -> FindMany<'a> { - FindMany::new(self.client, _where) - } - pub fn create( - self, - remote_id: i32, - first_name: String, - last_name: String, - source: super::source::UniqueWhereParam, - mut _params: Vec, - ) -> Create<'a> { - _params.extend([ - remote_id::set(remote_id), - first_name::set(first_name), - last_name::set(last_name), - source::connect(source), - ]); - Create::new(self.client, _params) - } - pub fn create_unchecked( - self, - source_id: i32, - remote_id: i32, - first_name: String, - last_name: String, - mut _params: Vec, - ) -> Create<'a> { - _params.extend([ - source_id::set(source_id), - remote_id::set(remote_id), - first_name::set(first_name), - last_name::set(last_name), - ]); - Create::new(self.client, _params.into_iter().map(Into::into).collect()) - } - pub fn create_many( - self, - data: Vec<(i32, i32, String, String, Vec)>, - ) -> CreateMany<'a> { - let data = data - .into_iter() - .map( - |(source_id, remote_id, first_name, last_name, mut _params)| { - _params.extend([ - source_id::set(source_id), - remote_id::set(remote_id), - first_name::set(first_name), - last_name::set(last_name), - ]); - _params - }, - ) - .collect(); - CreateMany::new(self.client, data) - } - pub fn update(self, _where: UniqueWhereParam, _params: Vec) -> Update<'a> { - Update::new(self.client, _where.into(), _params, vec![]) - } - pub fn update_unchecked( - self, - _where: UniqueWhereParam, - _params: Vec, - ) -> Update<'a> { - Update::new( - self.client, - _where.into(), - _params.into_iter().map(Into::into).collect(), - vec![], - ) - } - pub fn update_many( - self, - _where: Vec, - _params: Vec, - ) -> UpdateMany<'a> { - UpdateMany::new(self.client, _where, _params) - } - pub fn upsert( - self, - _where: UniqueWhereParam, - (remote_id, first_name, last_name, source, mut _params): ( - i32, - String, - String, - super::source::UniqueWhereParam, - Vec, - ), - _update: Vec, - ) -> Upsert<'a> { - _params.extend([ - remote_id::set(remote_id), - first_name::set(first_name), - last_name::set(last_name), - source::connect(source), - ]); - Upsert::new(self.client, _where.into(), _params, _update) - } - pub fn delete(self, _where: UniqueWhereParam) -> Delete<'a> { - Delete::new(self.client, _where.into(), vec![]) - } - pub fn delete_many(self, _where: Vec) -> DeleteMany<'a> { - DeleteMany::new(self.client, _where) - } - pub fn count(self, _where: Vec) -> Count<'a> { - Count::new(self.client, _where) - } - } -} -pub mod book_annotation { - - use super::*; - pub const NAME: &str = "BookAnnotation"; - pub mod id { - use super::super::*; - - use super::{OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam}; - pub const NAME: &str = "id"; - pub struct Set(pub i32); - impl From for SetParam { - fn from(Set(v): Set) -> Self { - Self::SetId(v) - } - } - impl From for UncheckedSetParam { - fn from(Set(v): Set) -> Self { - Self::Id(v) - } - } - pub fn set>(value: i32) -> T { - Set(value).into() - } - pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { - OrderByParam::Id(direction) - } - pub fn equals>(value: i32) -> T { - UniqueWhereParam::IdEquals(value).into() - } - ::prisma_client_rust::scalar_where_param_fns!(_prisma::read_filters::IntFilter, Id, { - fn in_vec(_: Vec) -> InVec; - fn not_in_vec(_: Vec) -> NotInVec; - fn lt(_: i32) -> Lt; - fn lte(_: i32) -> Lte; - fn gt(_: i32) -> Gt; - fn gte(_: i32) -> Gte; - fn not(_: i32) -> Not; - }); - pub fn increment(value: i32) -> SetParam { - SetParam::IncrementId(value) - } - pub fn decrement(value: i32) -> SetParam { - SetParam::DecrementId(value) - } - pub fn multiply(value: i32) -> SetParam { - SetParam::MultiplyId(value) - } - pub fn divide(value: i32) -> SetParam { - SetParam::DivideId(value) - } - pub struct Include; - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::Id(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - pub struct Select; - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::Id(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - } - pub mod book_id { - use super::super::*; - - use super::{OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam}; - pub const NAME: &str = "book_id"; - pub struct Set(pub i32); - impl From for SetParam { - fn from(Set(v): Set) -> Self { - Self::SetBookId(v) - } - } - impl From for UncheckedSetParam { - fn from(Set(v): Set) -> Self { - Self::BookId(v) - } - } - pub fn set>(value: i32) -> T { - Set(value).into() - } - pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { - OrderByParam::BookId(direction) - } - pub fn equals>(value: i32) -> T { - UniqueWhereParam::BookIdEquals(value).into() - } - ::prisma_client_rust::scalar_where_param_fns!(_prisma::read_filters::IntFilter, BookId, { - fn in_vec(_: Vec) -> InVec; - fn not_in_vec(_: Vec) -> NotInVec; - fn lt(_: i32) -> Lt; - fn lte(_: i32) -> Lte; - fn gt(_: i32) -> Gt; - fn gte(_: i32) -> Gte; - fn not(_: i32) -> Not; - }); - pub fn increment(value: i32) -> SetParam { - SetParam::IncrementBookId(value) - } - pub fn decrement(value: i32) -> SetParam { - SetParam::DecrementBookId(value) - } - pub fn multiply(value: i32) -> SetParam { - SetParam::MultiplyBookId(value) - } - pub fn divide(value: i32) -> SetParam { - SetParam::DivideBookId(value) - } - pub struct Include; - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::BookId(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - pub struct Select; - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::BookId(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - } - pub mod title { - use super::super::*; - - use super::{OrderByParam, SetParam, UncheckedSetParam, WhereParam}; - pub const NAME: &str = "title"; - pub struct Set(pub String); - impl From for SetParam { - fn from(Set(v): Set) -> Self { - Self::SetTitle(v) - } - } - impl From for UncheckedSetParam { - fn from(Set(v): Set) -> Self { - Self::Title(v) - } - } - pub fn set>(value: String) -> T { - Set(value).into() - } - pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { - OrderByParam::Title(direction) - } - pub fn equals(value: String) -> WhereParam { - WhereParam::Title(_prisma::read_filters::StringFilter::Equals(value)) - } - ::prisma_client_rust::scalar_where_param_fns!( - _prisma::read_filters::StringFilter, - Title, - { - fn in_vec(_: Vec) -> InVec; - fn not_in_vec(_: Vec) -> NotInVec; - fn lt(_: String) -> Lt; - fn lte(_: String) -> Lte; - fn gt(_: String) -> Gt; - fn gte(_: String) -> Gte; - fn contains(_: String) -> Contains; - fn starts_with(_: String) -> StartsWith; - fn ends_with(_: String) -> EndsWith; - fn mode(_: super::super::QueryMode) -> Mode; - fn not(_: String) -> Not; - } - ); - pub struct Include; - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::Title(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - pub struct Select; - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::Title(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - } - pub mod text { - use super::super::*; - - use super::{OrderByParam, SetParam, UncheckedSetParam, WhereParam}; - pub const NAME: &str = "text"; - pub struct Set(pub String); - impl From for SetParam { - fn from(Set(v): Set) -> Self { - Self::SetText(v) - } - } - impl From for UncheckedSetParam { - fn from(Set(v): Set) -> Self { - Self::Text(v) - } - } - pub fn set>(value: String) -> T { - Set(value).into() - } - pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { - OrderByParam::Text(direction) - } - pub fn equals(value: String) -> WhereParam { - WhereParam::Text(_prisma::read_filters::StringFilter::Equals(value)) - } - ::prisma_client_rust::scalar_where_param_fns!(_prisma::read_filters::StringFilter, Text, { - fn in_vec(_: Vec) -> InVec; - fn not_in_vec(_: Vec) -> NotInVec; - fn lt(_: String) -> Lt; - fn lte(_: String) -> Lte; - fn gt(_: String) -> Gt; - fn gte(_: String) -> Gte; - fn contains(_: String) -> Contains; - fn starts_with(_: String) -> StartsWith; - fn ends_with(_: String) -> EndsWith; - fn mode(_: super::super::QueryMode) -> Mode; - fn not(_: String) -> Not; - }); - pub struct Include; - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::Text(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - pub struct Select; - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::Text(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - } - pub mod file { - use super::super::*; - - use super::{OrderByParam, SetParam, UncheckedSetParam, WhereParam}; - pub const NAME: &str = "file"; - pub struct Set(pub Option); - impl From for SetParam { - fn from(Set(v): Set) -> Self { - Self::SetFile(v) - } - } - impl From for UncheckedSetParam { - fn from(Set(v): Set) -> Self { - Self::File(v) - } - } - pub fn set>(value: Option) -> T { - Set(value).into() - } - pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { - OrderByParam::File(direction) - } - pub fn equals(value: Option) -> WhereParam { - WhereParam::File(_prisma::read_filters::StringNullableFilter::Equals(value)) - } - ::prisma_client_rust::scalar_where_param_fns!( - _prisma::read_filters::StringNullableFilter, - File, - { - fn in_vec(_: Vec) -> InVec; - fn not_in_vec(_: Vec) -> NotInVec; - fn lt(_: String) -> Lt; - fn lte(_: String) -> Lte; - fn gt(_: String) -> Gt; - fn gte(_: String) -> Gte; - fn contains(_: String) -> Contains; - fn starts_with(_: String) -> StartsWith; - fn ends_with(_: String) -> EndsWith; - fn mode(_: super::super::QueryMode) -> Mode; - fn not(_: Option) -> Not; - } - ); - pub struct Include; - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::File(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - pub struct Select; - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::File(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - } - pub mod book { - use super::super::*; - - use super::{SetParam, WhereParam, WithParam}; - pub const NAME: &str = "book"; - pub struct Fetch(pub book::UniqueArgs); - impl Fetch { - pub fn with(mut self, params: impl Into) -> Self { - self.0 = self.0.with(params.into()); - self - } - } - impl From for WithParam { - fn from(Fetch(v): Fetch) -> Self { - WithParam::Book(v) - } - } - pub fn fetch() -> Fetch { - Fetch(book::UniqueArgs::new()) - } - pub struct Connect(book::UniqueWhereParam); - impl From for SetParam { - fn from(Connect(v): Connect) -> Self { - Self::ConnectBook(v) - } - } - pub fn connect>(value: book::UniqueWhereParam) -> T { - Connect(value).into() - } - pub fn is(value: Vec) -> WhereParam { - WhereParam::BookIs(value) - } - pub fn is_not(value: Vec) -> WhereParam { - WhereParam::BookIsNot(value) - } - pub enum Include { - Select(Vec), - Include(Vec), - Fetch, - } - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::Book(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let selections = match self { - Self::Select(selections) => { - selections.into_iter().map(|s| s.to_selection()).collect() - } - Self::Include(selections) => { - let mut nested_selections = - ::scalar_selections(); - nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); - nested_selections - } - Self::Fetch => { - ::scalar_selections() - } - }; - ::prisma_client_rust::Selection::new("book", None, [], selections) - } - pub fn select(nested_selections: Vec) -> Self { - Self::Select(nested_selections) - } - pub fn include(nested_selections: Vec) -> Self { - Self::Include(nested_selections) - } - } - pub enum Select { - Select(Vec), - Include(Vec), - Fetch, - } - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::Book(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let selections = match self { - Self::Select(selections) => { - selections.into_iter().map(|s| s.to_selection()).collect() - } - Self::Include(selections) => { - let mut nested_selections = vec![]; - nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); - nested_selections - } - Self::Fetch => { - ::scalar_selections() - } - }; - ::prisma_client_rust::Selection::new("book", None, [], selections) - } - pub fn select(nested_selections: Vec) -> Self { - Self::Select(nested_selections) - } - pub fn include(nested_selections: Vec) -> Self { - Self::Include(nested_selections) - } - } - } - pub fn create( - title: String, - text: String, - book: super::book::UniqueWhereParam, - _params: Vec, - ) -> (String, String, super::book::UniqueWhereParam, Vec) { - (title, text, book, _params) - } - pub fn create_unchecked( - book_id: i32, - title: String, - text: String, - _params: Vec, - ) -> (i32, String, String, Vec) { - (book_id, title, text, _params) - } - #[macro_export] - macro_rules ! _select_book_annotation { ($ (($ ($ func_arg : ident : $ func_arg_ty : ty) , +) =>) ? $ module_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { # [allow (warnings)] pub mod $ module_name { crate :: prisma :: book_annotation :: select ! (@ definitions ; $ module_name ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; use super :: * ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: SelectType for Selection { type Data = Data ; type ModelData = crate :: prisma :: book_annotation :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn select ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: book_annotation :: select ! (@ selections_to_params ; : select { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () ,] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } } ; ({ $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { { crate :: prisma :: book_annotation :: select ! (@ definitions ; ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: SelectType for Selection { type Data = Data ; type ModelData = crate :: prisma :: book_annotation :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: book_annotation :: select ! (@ selections_to_params ; : select { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () ,] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } ; (@ definitions ; $ ($ module_name : ident) ? ; $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) +) => { # [allow (warnings)] enum Fields { id , book_id , title , text , file , book } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] pub struct Data { $ (pub $ field : crate :: prisma :: book_annotation :: select ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } impl :: serde :: Serialize for Data { fn serialize < S > (& self , serializer : S) -> Result < S :: Ok , S :: Error > where S : :: serde :: Serializer , { use :: serde :: ser :: SerializeStruct ; let mut state = serializer . serialize_struct ("Data" , [$ (stringify ! ($ field) ,) +] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: book_annotation :: $ field :: NAME , & self . $ field) ? ;) * state . end () } } impl < 'de > :: serde :: Deserialize < 'de > for Data { fn deserialize < D > (deserializer : D) -> Result < Self , D :: Error > where D : :: serde :: Deserializer < 'de > , { # [allow (warnings)] enum Field { $ ($ field) , + , } impl < 'de > :: serde :: Deserialize < 'de > for Field { fn deserialize < D > (deserializer : D) -> Result < Field , D :: Error > where D : :: serde :: Deserializer < 'de > , { struct FieldVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for FieldVisitor { type Value = Field ; fn expecting (& self , formatter : & mut :: std :: fmt :: Formatter) -> :: std :: fmt :: Result { formatter . write_str (& [$ (crate :: prisma :: book_annotation :: $ field :: NAME) , + ,] . into_iter () . collect :: < Vec < _ >> () . join (", ")) } fn visit_str < E > (self , value : & str) -> Result < Field , E > where E : :: serde :: de :: Error , { match value { $ (crate :: prisma :: book_annotation :: $ field :: NAME => Ok (Field :: $ field)) , * , _ => Err (:: serde :: de :: Error :: unknown_field (value , FIELDS)) , } } } deserializer . deserialize_identifier (FieldVisitor) } } struct DataVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for DataVisitor { type Value = Data ; fn expecting (& self , formatter : & mut std :: fmt :: Formatter) -> std :: fmt :: Result { formatter . write_str ("struct Data") } fn visit_map < V > (self , mut map : V) -> Result < Data , V :: Error > where V : :: serde :: de :: MapAccess < 'de > , { $ (let mut $ field = None ;) * while let Some (key) = map . next_key () ? { match key { $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: book_annotation :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: book_annotation :: $ field :: NAME)) ? ;) * Ok (Data { $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "book_id" , "title" , "text" , "file" , "book"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: book_annotation :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; id) => { i32 } ; (@ field_type ; book_id) => { i32 } ; (@ field_type ; title) => { String } ; (@ field_type ; text) => { String } ; (@ field_type ; file) => { Option < String > } ; (@ field_type ; book : $ selection_mode : ident { $ ($ selections : tt) + }) => { book :: Data } ; (@ field_type ; book) => { crate :: prisma :: book :: Data } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "BookAnnotation" , available relations are "id, book_id, title, text, file, book")) } ; (@ field_module ; book : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: book :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; id) => { Into :: < crate :: prisma :: book_annotation :: SelectParam > :: into (crate :: prisma :: book_annotation :: id :: Select) } ; (@ selection_field_to_selection_param ; book_id) => { Into :: < crate :: prisma :: book_annotation :: SelectParam > :: into (crate :: prisma :: book_annotation :: book_id :: Select) } ; (@ selection_field_to_selection_param ; title) => { Into :: < crate :: prisma :: book_annotation :: SelectParam > :: into (crate :: prisma :: book_annotation :: title :: Select) } ; (@ selection_field_to_selection_param ; text) => { Into :: < crate :: prisma :: book_annotation :: SelectParam > :: into (crate :: prisma :: book_annotation :: text :: Select) } ; (@ selection_field_to_selection_param ; file) => { Into :: < crate :: prisma :: book_annotation :: SelectParam > :: into (crate :: prisma :: book_annotation :: file :: Select) } ; (@ selection_field_to_selection_param ; book $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: book_annotation :: SelectParam > :: into (crate :: prisma :: book_annotation :: book :: Select :: $ selection_mode (crate :: prisma :: book :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; book $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: book_annotation :: SelectParam > :: into (crate :: prisma :: book_annotation :: book :: Select :: Fetch) } } ; (@ selection_field_to_selection_param ; $ ($ tokens : tt) *) => { compile_error ! (stringify ! ($ ($ tokens) *)) } ; (@ selections_to_params ; : $ macro_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { [$ (crate :: prisma :: book_annotation :: $ macro_name ! (@ selection_field_to_selection_param ; $ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) ,) +] } ; (@ filters_to_args ;) => { vec ! [] } ; (@ filters_to_args ; $ ($ t : tt) *) => { $ ($ t) * } ; (@ field_serde_name ; id) => { "id" } ; (@ field_serde_name ; book_id) => { "book_id" } ; (@ field_serde_name ; title) => { "title" } ; (@ field_serde_name ; text) => { "text" } ; (@ field_serde_name ; file) => { "file" } ; (@ field_serde_name ; book) => { "book" } ; } - pub use _select_book_annotation as select; - pub enum SelectParam { - Id(id::Select), - BookId(book_id::Select), - Title(title::Select), - Text(text::Select), - File(file::Select), - Book(book::Select), - } - impl SelectParam { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - match self { - Self::Id(data) => data.to_selection(), - Self::BookId(data) => data.to_selection(), - Self::Title(data) => data.to_selection(), - Self::Text(data) => data.to_selection(), - Self::File(data) => data.to_selection(), - Self::Book(data) => data.to_selection(), - } - } - } - #[macro_export] - macro_rules ! _include_book_annotation { ($ (($ ($ func_arg : ident : $ func_arg_ty : ty) , +) =>) ? $ module_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { # [allow (warnings)] pub mod $ module_name { crate :: prisma :: book_annotation :: include ! (@ definitions ; $ module_name ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; use super :: * ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: IncludeType for Selection { type Data = Data ; type ModelData = crate :: prisma :: book_annotation :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn include ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: book_annotation :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: book_annotation :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } } ; ({ $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { { crate :: prisma :: book_annotation :: include ! (@ definitions ; ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: IncludeType for Selection { type Data = Data ; type ModelData = crate :: prisma :: book_annotation :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: book_annotation :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: book_annotation :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } ; (@ definitions ; $ ($ module_name : ident) ? ; $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) +) => { # [allow (warnings)] enum Fields { book } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] pub struct Data { pub id : i32 , pub book_id : i32 , pub title : String , pub text : String , pub file : Option < String > , $ (pub $ field : crate :: prisma :: book_annotation :: include ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } impl :: serde :: Serialize for Data { fn serialize < S > (& self , serializer : S) -> Result < S :: Ok , S :: Error > where S : :: serde :: Serializer , { use :: serde :: ser :: SerializeStruct ; let mut state = serializer . serialize_struct ("Data" , [$ (stringify ! ($ field) ,) + stringify ! (id) , stringify ! (book_id) , stringify ! (title) , stringify ! (text) , stringify ! (file)] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: book_annotation :: $ field :: NAME , & self . $ field) ? ;) * state . serialize_field (crate :: prisma :: book_annotation :: id :: NAME , & self . id) ? ; state . serialize_field (crate :: prisma :: book_annotation :: book_id :: NAME , & self . book_id) ? ; state . serialize_field (crate :: prisma :: book_annotation :: title :: NAME , & self . title) ? ; state . serialize_field (crate :: prisma :: book_annotation :: text :: NAME , & self . text) ? ; state . serialize_field (crate :: prisma :: book_annotation :: file :: NAME , & self . file) ? ; state . end () } } impl < 'de > :: serde :: Deserialize < 'de > for Data { fn deserialize < D > (deserializer : D) -> Result < Self , D :: Error > where D : :: serde :: Deserializer < 'de > , { # [allow (warnings)] enum Field { $ ($ field) , + , id , book_id , title , text , file } impl < 'de > :: serde :: Deserialize < 'de > for Field { fn deserialize < D > (deserializer : D) -> Result < Field , D :: Error > where D : :: serde :: Deserializer < 'de > , { struct FieldVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for FieldVisitor { type Value = Field ; fn expecting (& self , formatter : & mut :: std :: fmt :: Formatter) -> :: std :: fmt :: Result { formatter . write_str (& [$ (crate :: prisma :: book_annotation :: $ field :: NAME) , + , crate :: prisma :: book_annotation :: id :: NAME , crate :: prisma :: book_annotation :: book_id :: NAME , crate :: prisma :: book_annotation :: title :: NAME , crate :: prisma :: book_annotation :: text :: NAME , crate :: prisma :: book_annotation :: file :: NAME] . into_iter () . collect :: < Vec < _ >> () . join (", ")) } fn visit_str < E > (self , value : & str) -> Result < Field , E > where E : :: serde :: de :: Error , { match value { $ (crate :: prisma :: book_annotation :: $ field :: NAME => Ok (Field :: $ field)) , * , crate :: prisma :: book_annotation :: id :: NAME => Ok (Field :: id) , crate :: prisma :: book_annotation :: book_id :: NAME => Ok (Field :: book_id) , crate :: prisma :: book_annotation :: title :: NAME => Ok (Field :: title) , crate :: prisma :: book_annotation :: text :: NAME => Ok (Field :: text) , crate :: prisma :: book_annotation :: file :: NAME => Ok (Field :: file) , _ => Err (:: serde :: de :: Error :: unknown_field (value , FIELDS)) , } } } deserializer . deserialize_identifier (FieldVisitor) } } struct DataVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for DataVisitor { type Value = Data ; fn expecting (& self , formatter : & mut std :: fmt :: Formatter) -> std :: fmt :: Result { formatter . write_str ("struct Data") } fn visit_map < V > (self , mut map : V) -> Result < Data , V :: Error > where V : :: serde :: de :: MapAccess < 'de > , { $ (let mut $ field = None ;) * let mut id = None ; let mut book_id = None ; let mut title = None ; let mut text = None ; let mut file = None ; while let Some (key) = map . next_key () ? { match key { Field :: id => { if id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: book_annotation :: id :: NAME)) ; } id = Some (map . next_value () ?) ; } Field :: book_id => { if book_id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: book_annotation :: book_id :: NAME)) ; } book_id = Some (map . next_value () ?) ; } Field :: title => { if title . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: book_annotation :: title :: NAME)) ; } title = Some (map . next_value () ?) ; } Field :: text => { if text . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: book_annotation :: text :: NAME)) ; } text = Some (map . next_value () ?) ; } Field :: file => { if file . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: book_annotation :: file :: NAME)) ; } file = Some (map . next_value () ?) ; } $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: book_annotation :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: book_annotation :: $ field :: NAME)) ? ;) * let id = id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: book_annotation :: id :: NAME)) ? ; let book_id = book_id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: book_annotation :: book_id :: NAME)) ? ; let title = title . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: book_annotation :: title :: NAME)) ? ; let text = text . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: book_annotation :: text :: NAME)) ? ; let file = file . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: book_annotation :: file :: NAME)) ? ; Ok (Data { id , book_id , title , text , file , $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "book_id" , "title" , "text" , "file" , "book"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: book_annotation :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; book : $ selection_mode : ident { $ ($ selections : tt) + }) => { book :: Data } ; (@ field_type ; book) => { crate :: prisma :: book :: Data } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "BookAnnotation" , available relations are "book")) } ; (@ field_module ; book : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: book :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; book $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: book_annotation :: IncludeParam > :: into (crate :: prisma :: book_annotation :: book :: Include :: $ selection_mode (crate :: prisma :: book :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; book $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: book_annotation :: IncludeParam > :: into (crate :: prisma :: book_annotation :: book :: Include :: Fetch) } } ; (@ selection_field_to_selection_param ; $ ($ tokens : tt) *) => { compile_error ! (stringify ! ($ ($ tokens) *)) } ; (@ selections_to_params ; : $ macro_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { [$ (crate :: prisma :: book_annotation :: $ macro_name ! (@ selection_field_to_selection_param ; $ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) ,) +] } ; (@ filters_to_args ;) => { vec ! [] } ; (@ filters_to_args ; $ ($ t : tt) *) => { $ ($ t) * } ; (@ field_serde_name ; id) => { "id" } ; (@ field_serde_name ; book_id) => { "book_id" } ; (@ field_serde_name ; title) => { "title" } ; (@ field_serde_name ; text) => { "text" } ; (@ field_serde_name ; file) => { "file" } ; (@ field_serde_name ; book) => { "book" } ; } - pub use _include_book_annotation as include; - pub enum IncludeParam { - Id(id::Include), - BookId(book_id::Include), - Title(title::Include), - Text(text::Include), - File(file::Include), - Book(book::Include), - } - impl IncludeParam { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - match self { - Self::Id(data) => data.to_selection(), - Self::BookId(data) => data.to_selection(), - Self::Title(data) => data.to_selection(), - Self::Text(data) => data.to_selection(), - Self::File(data) => data.to_selection(), - Self::Book(data) => data.to_selection(), - } - } - } - #[macro_export] - macro_rules ! _partial_unchecked_book_annotation { ($ struct_name : ident { $ ($ scalar_field : ident) + }) => { :: prisma_client_rust :: macros :: partial_unchecked ! { crate :: prisma :: book_annotation struct $ struct_name { # [serde (rename = "id")] pub id : i32 , # [serde (rename = "book_id")] pub book_id : i32 , # [serde (rename = "title")] pub title : String , # [serde (rename = "text")] pub text : String , # [serde (rename = "file")] # [serde (default , with = "::prisma_client_rust::serde::double_option")] pub file : Option < String > } [$ ($ scalar_field) , +] } } ; } - pub use _partial_unchecked_book_annotation as partial_unchecked; - #[derive(Debug, Clone, :: serde :: Serialize, :: serde :: Deserialize)] - pub struct Data { - #[serde(rename = "id")] - pub id: i32, - #[serde(rename = "book_id")] - pub book_id: i32, - #[serde(rename = "title")] - pub title: String, - #[serde(rename = "text")] - pub text: String, - #[serde(rename = "file")] - pub file: Option, - #[serde(rename = "book")] - pub book: Option>, - } - impl Data { - pub fn book( - &self, - ) -> Result<&super::book::Data, ::prisma_client_rust::RelationNotFetchedError> { - self.book - .as_ref() - .ok_or(::prisma_client_rust::RelationNotFetchedError::new( - stringify!(book), - )) - .map(|v| v.as_ref()) - } - } - #[derive(Clone)] - pub enum WithParam { - Book(super::book::UniqueArgs), - } - impl Into<::prisma_client_rust::Selection> for WithParam { - fn into(self) -> ::prisma_client_rust::Selection { - match self { - Self::Book(args) => { - let mut selections = - ::scalar_selections( - ); - selections.extend( - args.with_params - .into_iter() - .map(Into::<::prisma_client_rust::Selection>::into), - ); - ::prisma_client_rust::Selection::new(book::NAME, None, [], selections) - } - } - } - } - #[derive(Clone)] - pub enum SetParam { - SetId(i32), - IncrementId(i32), - DecrementId(i32), - MultiplyId(i32), - DivideId(i32), - SetBookId(i32), - IncrementBookId(i32), - DecrementBookId(i32), - MultiplyBookId(i32), - DivideBookId(i32), - SetTitle(String), - SetText(String), - SetFile(Option), - ConnectBook(super::book::UniqueWhereParam), - } - impl From for (String, ::prisma_client_rust::PrismaValue) { - fn from(param: SetParam) -> Self { - match param { - SetParam::SetId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - ), - SetParam::IncrementId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "increment".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DecrementId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "decrement".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::MultiplyId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "multiply".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DivideId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "divide".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::SetBookId(value) => ( - book_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - ), - SetParam::IncrementBookId(value) => ( - book_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "increment".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DecrementBookId(value) => ( - book_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "decrement".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::MultiplyBookId(value) => ( - book_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "multiply".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DivideBookId(value) => ( - book_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "divide".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::SetTitle(value) => ( - title::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(value), - ), - SetParam::SetText(value) => ( - text::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(value), - ), - SetParam::SetFile(value) => ( - file::NAME.to_string(), - value - .map(|value| ::prisma_client_rust::PrismaValue::String(value)) - .unwrap_or_else(|| ::prisma_client_rust::PrismaValue::Null), - ), - SetParam::ConnectBook(where_param) => ( - book::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "connect".to_string(), - ::prisma_client_rust::PrismaValue::Object( - [where_param] - .into_iter() - .map(Into::::into) - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - } - } - } - #[derive(Clone)] - pub enum UncheckedSetParam { - Id(i32), - BookId(i32), - Title(String), - Text(String), - File(Option), - } - impl From for SetParam { - fn from(param: UncheckedSetParam) -> Self { - match param { - UncheckedSetParam::Id(value) => Self::SetId(value), - UncheckedSetParam::BookId(value) => Self::SetBookId(value), - UncheckedSetParam::Title(value) => Self::SetTitle(value), - UncheckedSetParam::Text(value) => Self::SetText(value), - UncheckedSetParam::File(value) => Self::SetFile(value), - } - } - } - #[derive(Clone)] - pub enum OrderByParam { - Id(::prisma_client_rust::Direction), - BookId(::prisma_client_rust::Direction), - Title(::prisma_client_rust::Direction), - Text(::prisma_client_rust::Direction), - File(::prisma_client_rust::Direction), - } - impl Into<(String, ::prisma_client_rust::PrismaValue)> for OrderByParam { - fn into(self) -> (String, ::prisma_client_rust::PrismaValue) { - match self { - Self::Id(direction) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(direction.to_string()), - ), - Self::BookId(direction) => ( - book_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(direction.to_string()), - ), - Self::Title(direction) => ( - title::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(direction.to_string()), - ), - Self::Text(direction) => ( - text::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(direction.to_string()), - ), - Self::File(direction) => ( - file::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(direction.to_string()), - ), - } - } - } - #[derive(Clone)] - pub enum WhereParam { - Not(Vec), - Or(Vec), - And(Vec), - Id(_prisma::read_filters::IntFilter), - BookId(_prisma::read_filters::IntFilter), - Title(_prisma::read_filters::StringFilter), - Text(_prisma::read_filters::StringFilter), - File(_prisma::read_filters::StringNullableFilter), - BookIs(Vec), - BookIsNot(Vec), - } - impl ::prisma_client_rust::WhereInput for WhereParam { - fn serialize(self) -> ::prisma_client_rust::SerializedWhereInput { - let (name, value) = match self { - Self::Not(value) => ( - "NOT", - ::prisma_client_rust::SerializedWhereValue::Object( - ::prisma_client_rust::merge_fields( - value - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(Into::into) - .collect(), - ), - ), - ), - Self::Or(value) => ( - "OR", - ::prisma_client_rust::SerializedWhereValue::List( - value - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(Into::into) - .map(|v| vec![v]) - .map(::prisma_client_rust::PrismaValue::Object) - .collect(), - ), - ), - Self::And(value) => ( - "AND", - ::prisma_client_rust::SerializedWhereValue::Object( - ::prisma_client_rust::merge_fields( - value - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(Into::into) - .collect(), - ), - ), - ), - Self::Id(value) => (id::NAME, value.into()), - Self::BookId(value) => (book_id::NAME, value.into()), - Self::Title(value) => (title::NAME, value.into()), - Self::Text(value) => (text::NAME, value.into()), - Self::File(value) => (file::NAME, value.into()), - Self::BookIs(where_params) => ( - book::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "is".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::BookIsNot(where_params) => ( - book::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "isNot".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - }; - ::prisma_client_rust::SerializedWhereInput::new(name, value.into()) - } - } - #[derive(Clone)] - pub enum UniqueWhereParam { - BookIdEquals(i32), - IdEquals(i32), - } - impl From for WhereParam { - fn from(value: UniqueWhereParam) -> Self { - match value { - UniqueWhereParam::BookIdEquals(value) => { - Self::BookId(_prisma::read_filters::IntFilter::Equals(value)) - } - UniqueWhereParam::IdEquals(value) => { - Self::Id(_prisma::read_filters::IntFilter::Equals(value)) - } - } - } - } - impl From<::prisma_client_rust::Operator> for WhereParam { - fn from(op: ::prisma_client_rust::Operator) -> Self { - match op { - ::prisma_client_rust::Operator::Not(value) => Self::Not(value), - ::prisma_client_rust::Operator::And(value) => Self::And(value), - ::prisma_client_rust::Operator::Or(value) => Self::Or(value), - } - } - } - #[derive(Clone)] - pub struct Types; - impl ::prisma_client_rust::ModelTypes for Types { - type Data = Data; - type Where = WhereParam; - type UncheckedSet = UncheckedSetParam; - type Set = SetParam; - type With = WithParam; - type OrderBy = OrderByParam; - type Cursor = UniqueWhereParam; - const MODEL: &'static str = NAME; - fn scalar_selections() -> Vec<::prisma_client_rust::Selection> { - vec![ - ::prisma_client_rust::sel(id::NAME), - ::prisma_client_rust::sel(book_id::NAME), - ::prisma_client_rust::sel(title::NAME), - ::prisma_client_rust::sel(text::NAME), - ::prisma_client_rust::sel(file::NAME), - ] - } - } - pub type UniqueArgs = ::prisma_client_rust::UniqueArgs; - pub type ManyArgs = ::prisma_client_rust::ManyArgs; - pub type Count<'a> = ::prisma_client_rust::Count<'a, Types>; - pub type Create<'a> = ::prisma_client_rust::Create<'a, Types>; - pub type CreateMany<'a> = ::prisma_client_rust::CreateMany<'a, Types>; - pub type FindUnique<'a> = ::prisma_client_rust::FindUnique<'a, Types>; - pub type FindMany<'a> = ::prisma_client_rust::FindMany<'a, Types>; - pub type FindFirst<'a> = ::prisma_client_rust::FindFirst<'a, Types>; - pub type Update<'a> = ::prisma_client_rust::Update<'a, Types>; - pub type UpdateMany<'a> = ::prisma_client_rust::UpdateMany<'a, Types>; - pub type Upsert<'a> = ::prisma_client_rust::Upsert<'a, Types>; - pub type Delete<'a> = ::prisma_client_rust::Delete<'a, Types>; - pub type DeleteMany<'a> = ::prisma_client_rust::DeleteMany<'a, Types>; - #[derive(Clone)] - pub struct Actions<'a> { - pub client: &'a ::prisma_client_rust::PrismaClientInternals, - } - impl<'a> Actions<'a> { - pub fn find_unique(self, _where: UniqueWhereParam) -> FindUnique<'a> { - FindUnique::new(self.client, _where.into()) - } - pub fn find_first(self, _where: Vec) -> FindFirst<'a> { - FindFirst::new(self.client, _where) - } - pub fn find_many(self, _where: Vec) -> FindMany<'a> { - FindMany::new(self.client, _where) - } - pub fn create( - self, - title: String, - text: String, - book: super::book::UniqueWhereParam, - mut _params: Vec, - ) -> Create<'a> { - _params.extend([title::set(title), text::set(text), book::connect(book)]); - Create::new(self.client, _params) - } - pub fn create_unchecked( - self, - book_id: i32, - title: String, - text: String, - mut _params: Vec, - ) -> Create<'a> { - _params.extend([book_id::set(book_id), title::set(title), text::set(text)]); - Create::new(self.client, _params.into_iter().map(Into::into).collect()) - } - pub fn create_many( - self, - data: Vec<(i32, String, String, Vec)>, - ) -> CreateMany<'a> { - let data = data - .into_iter() - .map(|(book_id, title, text, mut _params)| { - _params.extend([book_id::set(book_id), title::set(title), text::set(text)]); - _params - }) - .collect(); - CreateMany::new(self.client, data) - } - pub fn update(self, _where: UniqueWhereParam, _params: Vec) -> Update<'a> { - Update::new(self.client, _where.into(), _params, vec![]) - } - pub fn update_unchecked( - self, - _where: UniqueWhereParam, - _params: Vec, - ) -> Update<'a> { - Update::new( - self.client, - _where.into(), - _params.into_iter().map(Into::into).collect(), - vec![], - ) - } - pub fn update_many( - self, - _where: Vec, - _params: Vec, - ) -> UpdateMany<'a> { - UpdateMany::new(self.client, _where, _params) - } - pub fn upsert( - self, - _where: UniqueWhereParam, - (title, text, book, mut _params): ( - String, - String, - super::book::UniqueWhereParam, - Vec, - ), - _update: Vec, - ) -> Upsert<'a> { - _params.extend([title::set(title), text::set(text), book::connect(book)]); - Upsert::new(self.client, _where.into(), _params, _update) - } - pub fn delete(self, _where: UniqueWhereParam) -> Delete<'a> { - Delete::new(self.client, _where.into(), vec![]) - } - pub fn delete_many(self, _where: Vec) -> DeleteMany<'a> { - DeleteMany::new(self.client, _where) - } - pub fn count(self, _where: Vec) -> Count<'a> { - Count::new(self.client, _where) - } - } -} -pub mod book_author { - - use super::*; - pub const NAME: &str = "BookAuthor"; - pub mod id { - use super::super::*; - - use super::{OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam}; - pub const NAME: &str = "id"; - pub struct Set(pub i32); - impl From for SetParam { - fn from(Set(v): Set) -> Self { - Self::SetId(v) - } - } - impl From for UncheckedSetParam { - fn from(Set(v): Set) -> Self { - Self::Id(v) - } - } - pub fn set>(value: i32) -> T { - Set(value).into() - } - pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { - OrderByParam::Id(direction) - } - pub fn equals>(value: i32) -> T { - UniqueWhereParam::IdEquals(value).into() - } - ::prisma_client_rust::scalar_where_param_fns!(_prisma::read_filters::IntFilter, Id, { - fn in_vec(_: Vec) -> InVec; - fn not_in_vec(_: Vec) -> NotInVec; - fn lt(_: i32) -> Lt; - fn lte(_: i32) -> Lte; - fn gt(_: i32) -> Gt; - fn gte(_: i32) -> Gte; - fn not(_: i32) -> Not; - }); - pub fn increment(value: i32) -> SetParam { - SetParam::IncrementId(value) - } - pub fn decrement(value: i32) -> SetParam { - SetParam::DecrementId(value) - } - pub fn multiply(value: i32) -> SetParam { - SetParam::MultiplyId(value) - } - pub fn divide(value: i32) -> SetParam { - SetParam::DivideId(value) - } - pub struct Include; - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::Id(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - pub struct Select; - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::Id(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - } - pub mod author_id { - use super::super::*; - - use super::{OrderByParam, SetParam, UncheckedSetParam, WhereParam}; - pub const NAME: &str = "author_id"; - pub struct Set(pub i32); - impl From for SetParam { - fn from(Set(v): Set) -> Self { - Self::SetAuthorId(v) - } - } - impl From for UncheckedSetParam { - fn from(Set(v): Set) -> Self { - Self::AuthorId(v) - } - } - pub fn set>(value: i32) -> T { - Set(value).into() - } - pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { - OrderByParam::AuthorId(direction) - } - pub fn equals(value: i32) -> WhereParam { - WhereParam::AuthorId(_prisma::read_filters::IntFilter::Equals(value)) - } - ::prisma_client_rust::scalar_where_param_fns!( - _prisma::read_filters::IntFilter, - AuthorId, - { - fn in_vec(_: Vec) -> InVec; - fn not_in_vec(_: Vec) -> NotInVec; - fn lt(_: i32) -> Lt; - fn lte(_: i32) -> Lte; - fn gt(_: i32) -> Gt; - fn gte(_: i32) -> Gte; - fn not(_: i32) -> Not; - } - ); - pub fn increment(value: i32) -> SetParam { - SetParam::IncrementAuthorId(value) - } - pub fn decrement(value: i32) -> SetParam { - SetParam::DecrementAuthorId(value) - } - pub fn multiply(value: i32) -> SetParam { - SetParam::MultiplyAuthorId(value) - } - pub fn divide(value: i32) -> SetParam { - SetParam::DivideAuthorId(value) - } - pub struct Include; - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::AuthorId(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - pub struct Select; - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::AuthorId(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - } - pub mod book_id { - use super::super::*; - - use super::{OrderByParam, SetParam, UncheckedSetParam, WhereParam}; - pub const NAME: &str = "book_id"; - pub struct Set(pub i32); - impl From for SetParam { - fn from(Set(v): Set) -> Self { - Self::SetBookId(v) - } - } - impl From for UncheckedSetParam { - fn from(Set(v): Set) -> Self { - Self::BookId(v) - } - } - pub fn set>(value: i32) -> T { - Set(value).into() - } - pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { - OrderByParam::BookId(direction) - } - pub fn equals(value: i32) -> WhereParam { - WhereParam::BookId(_prisma::read_filters::IntFilter::Equals(value)) - } - ::prisma_client_rust::scalar_where_param_fns!(_prisma::read_filters::IntFilter, BookId, { - fn in_vec(_: Vec) -> InVec; - fn not_in_vec(_: Vec) -> NotInVec; - fn lt(_: i32) -> Lt; - fn lte(_: i32) -> Lte; - fn gt(_: i32) -> Gt; - fn gte(_: i32) -> Gte; - fn not(_: i32) -> Not; - }); - pub fn increment(value: i32) -> SetParam { - SetParam::IncrementBookId(value) - } - pub fn decrement(value: i32) -> SetParam { - SetParam::DecrementBookId(value) - } - pub fn multiply(value: i32) -> SetParam { - SetParam::MultiplyBookId(value) - } - pub fn divide(value: i32) -> SetParam { - SetParam::DivideBookId(value) - } - pub struct Include; - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::BookId(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - pub struct Select; - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::BookId(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - } - pub mod author { - use super::super::*; - - use super::{SetParam, WhereParam, WithParam}; - pub const NAME: &str = "author"; - pub struct Fetch(pub author::UniqueArgs); - impl Fetch { - pub fn with(mut self, params: impl Into) -> Self { - self.0 = self.0.with(params.into()); - self - } - } - impl From for WithParam { - fn from(Fetch(v): Fetch) -> Self { - WithParam::Author(v) - } - } - pub fn fetch() -> Fetch { - Fetch(author::UniqueArgs::new()) - } - pub struct Connect(author::UniqueWhereParam); - impl From for SetParam { - fn from(Connect(v): Connect) -> Self { - Self::ConnectAuthor(v) - } - } - pub fn connect>(value: author::UniqueWhereParam) -> T { - Connect(value).into() - } - pub fn is(value: Vec) -> WhereParam { - WhereParam::AuthorIs(value) - } - pub fn is_not(value: Vec) -> WhereParam { - WhereParam::AuthorIsNot(value) - } - pub enum Include { - Select(Vec), - Include(Vec), - Fetch, - } - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::Author(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let selections = match self { - Self::Select(selections) => { - selections.into_iter().map(|s| s.to_selection()).collect() - } - Self::Include(selections) => { - let mut nested_selections = - ::scalar_selections( - ); - nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); - nested_selections - } - Self::Fetch => { - ::scalar_selections() - } - }; - ::prisma_client_rust::Selection::new("author", None, [], selections) - } - pub fn select(nested_selections: Vec) -> Self { - Self::Select(nested_selections) - } - pub fn include(nested_selections: Vec) -> Self { - Self::Include(nested_selections) - } - } - pub enum Select { - Select(Vec), - Include(Vec), - Fetch, - } - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::Author(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let selections = match self { - Self::Select(selections) => { - selections.into_iter().map(|s| s.to_selection()).collect() - } - Self::Include(selections) => { - let mut nested_selections = vec![]; - nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); - nested_selections - } - Self::Fetch => { - ::scalar_selections() - } - }; - ::prisma_client_rust::Selection::new("author", None, [], selections) - } - pub fn select(nested_selections: Vec) -> Self { - Self::Select(nested_selections) - } - pub fn include(nested_selections: Vec) -> Self { - Self::Include(nested_selections) - } - } - } - pub mod book { - use super::super::*; - - use super::{SetParam, WhereParam, WithParam}; - pub const NAME: &str = "book"; - pub struct Fetch(pub book::UniqueArgs); - impl Fetch { - pub fn with(mut self, params: impl Into) -> Self { - self.0 = self.0.with(params.into()); - self - } - } - impl From for WithParam { - fn from(Fetch(v): Fetch) -> Self { - WithParam::Book(v) - } - } - pub fn fetch() -> Fetch { - Fetch(book::UniqueArgs::new()) - } - pub struct Connect(book::UniqueWhereParam); - impl From for SetParam { - fn from(Connect(v): Connect) -> Self { - Self::ConnectBook(v) - } - } - pub fn connect>(value: book::UniqueWhereParam) -> T { - Connect(value).into() - } - pub fn is(value: Vec) -> WhereParam { - WhereParam::BookIs(value) - } - pub fn is_not(value: Vec) -> WhereParam { - WhereParam::BookIsNot(value) - } - pub enum Include { - Select(Vec), - Include(Vec), - Fetch, - } - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::Book(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let selections = match self { - Self::Select(selections) => { - selections.into_iter().map(|s| s.to_selection()).collect() - } - Self::Include(selections) => { - let mut nested_selections = - ::scalar_selections(); - nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); - nested_selections - } - Self::Fetch => { - ::scalar_selections() - } - }; - ::prisma_client_rust::Selection::new("book", None, [], selections) - } - pub fn select(nested_selections: Vec) -> Self { - Self::Select(nested_selections) - } - pub fn include(nested_selections: Vec) -> Self { - Self::Include(nested_selections) - } - } - pub enum Select { - Select(Vec), - Include(Vec), - Fetch, - } - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::Book(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let selections = match self { - Self::Select(selections) => { - selections.into_iter().map(|s| s.to_selection()).collect() - } - Self::Include(selections) => { - let mut nested_selections = vec![]; - nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); - nested_selections - } - Self::Fetch => { - ::scalar_selections() - } - }; - ::prisma_client_rust::Selection::new("book", None, [], selections) - } - pub fn select(nested_selections: Vec) -> Self { - Self::Select(nested_selections) - } - pub fn include(nested_selections: Vec) -> Self { - Self::Include(nested_selections) - } - } - } - pub fn book_id_author_id>(book_id: i32, author_id: i32) -> T { - UniqueWhereParam::BookIdAuthorIdEquals(book_id, author_id).into() - } - pub fn create( - author: super::author::UniqueWhereParam, - book: super::book::UniqueWhereParam, - _params: Vec, - ) -> ( - super::author::UniqueWhereParam, - super::book::UniqueWhereParam, - Vec, - ) { - (author, book, _params) - } - pub fn create_unchecked( - author_id: i32, - book_id: i32, - _params: Vec, - ) -> (i32, i32, Vec) { - (author_id, book_id, _params) - } - #[macro_export] - macro_rules ! _select_book_author { ($ (($ ($ func_arg : ident : $ func_arg_ty : ty) , +) =>) ? $ module_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { # [allow (warnings)] pub mod $ module_name { crate :: prisma :: book_author :: select ! (@ definitions ; $ module_name ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; use super :: * ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: SelectType for Selection { type Data = Data ; type ModelData = crate :: prisma :: book_author :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn select ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: book_author :: select ! (@ selections_to_params ; : select { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () ,] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } } ; ({ $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { { crate :: prisma :: book_author :: select ! (@ definitions ; ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: SelectType for Selection { type Data = Data ; type ModelData = crate :: prisma :: book_author :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: book_author :: select ! (@ selections_to_params ; : select { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () ,] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } ; (@ definitions ; $ ($ module_name : ident) ? ; $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) +) => { # [allow (warnings)] enum Fields { id , author_id , book_id , author , book } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] pub struct Data { $ (pub $ field : crate :: prisma :: book_author :: select ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } impl :: serde :: Serialize for Data { fn serialize < S > (& self , serializer : S) -> Result < S :: Ok , S :: Error > where S : :: serde :: Serializer , { use :: serde :: ser :: SerializeStruct ; let mut state = serializer . serialize_struct ("Data" , [$ (stringify ! ($ field) ,) +] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: book_author :: $ field :: NAME , & self . $ field) ? ;) * state . end () } } impl < 'de > :: serde :: Deserialize < 'de > for Data { fn deserialize < D > (deserializer : D) -> Result < Self , D :: Error > where D : :: serde :: Deserializer < 'de > , { # [allow (warnings)] enum Field { $ ($ field) , + , } impl < 'de > :: serde :: Deserialize < 'de > for Field { fn deserialize < D > (deserializer : D) -> Result < Field , D :: Error > where D : :: serde :: Deserializer < 'de > , { struct FieldVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for FieldVisitor { type Value = Field ; fn expecting (& self , formatter : & mut :: std :: fmt :: Formatter) -> :: std :: fmt :: Result { formatter . write_str (& [$ (crate :: prisma :: book_author :: $ field :: NAME) , + ,] . into_iter () . collect :: < Vec < _ >> () . join (", ")) } fn visit_str < E > (self , value : & str) -> Result < Field , E > where E : :: serde :: de :: Error , { match value { $ (crate :: prisma :: book_author :: $ field :: NAME => Ok (Field :: $ field)) , * , _ => Err (:: serde :: de :: Error :: unknown_field (value , FIELDS)) , } } } deserializer . deserialize_identifier (FieldVisitor) } } struct DataVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for DataVisitor { type Value = Data ; fn expecting (& self , formatter : & mut std :: fmt :: Formatter) -> std :: fmt :: Result { formatter . write_str ("struct Data") } fn visit_map < V > (self , mut map : V) -> Result < Data , V :: Error > where V : :: serde :: de :: MapAccess < 'de > , { $ (let mut $ field = None ;) * while let Some (key) = map . next_key () ? { match key { $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: book_author :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: book_author :: $ field :: NAME)) ? ;) * Ok (Data { $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "author_id" , "book_id" , "author" , "book"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: book_author :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; id) => { i32 } ; (@ field_type ; author_id) => { i32 } ; (@ field_type ; book_id) => { i32 } ; (@ field_type ; author : $ selection_mode : ident { $ ($ selections : tt) + }) => { author :: Data } ; (@ field_type ; author) => { crate :: prisma :: author :: Data } ; (@ field_type ; book : $ selection_mode : ident { $ ($ selections : tt) + }) => { book :: Data } ; (@ field_type ; book) => { crate :: prisma :: book :: Data } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "BookAuthor" , available relations are "id, author_id, book_id, author, book")) } ; (@ field_module ; author : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: author :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; book : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: book :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; id) => { Into :: < crate :: prisma :: book_author :: SelectParam > :: into (crate :: prisma :: book_author :: id :: Select) } ; (@ selection_field_to_selection_param ; author_id) => { Into :: < crate :: prisma :: book_author :: SelectParam > :: into (crate :: prisma :: book_author :: author_id :: Select) } ; (@ selection_field_to_selection_param ; book_id) => { Into :: < crate :: prisma :: book_author :: SelectParam > :: into (crate :: prisma :: book_author :: book_id :: Select) } ; (@ selection_field_to_selection_param ; author $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: book_author :: SelectParam > :: into (crate :: prisma :: book_author :: author :: Select :: $ selection_mode (crate :: prisma :: author :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; author $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: book_author :: SelectParam > :: into (crate :: prisma :: book_author :: author :: Select :: Fetch) } } ; (@ selection_field_to_selection_param ; book $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: book_author :: SelectParam > :: into (crate :: prisma :: book_author :: book :: Select :: $ selection_mode (crate :: prisma :: book :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; book $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: book_author :: SelectParam > :: into (crate :: prisma :: book_author :: book :: Select :: Fetch) } } ; (@ selection_field_to_selection_param ; $ ($ tokens : tt) *) => { compile_error ! (stringify ! ($ ($ tokens) *)) } ; (@ selections_to_params ; : $ macro_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { [$ (crate :: prisma :: book_author :: $ macro_name ! (@ selection_field_to_selection_param ; $ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) ,) +] } ; (@ filters_to_args ;) => { vec ! [] } ; (@ filters_to_args ; $ ($ t : tt) *) => { $ ($ t) * } ; (@ field_serde_name ; id) => { "id" } ; (@ field_serde_name ; author_id) => { "author_id" } ; (@ field_serde_name ; book_id) => { "book_id" } ; (@ field_serde_name ; author) => { "author" } ; (@ field_serde_name ; book) => { "book" } ; } - pub use _select_book_author as select; - pub enum SelectParam { - Id(id::Select), - AuthorId(author_id::Select), - BookId(book_id::Select), - Author(author::Select), - Book(book::Select), - } - impl SelectParam { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - match self { - Self::Id(data) => data.to_selection(), - Self::AuthorId(data) => data.to_selection(), - Self::BookId(data) => data.to_selection(), - Self::Author(data) => data.to_selection(), - Self::Book(data) => data.to_selection(), - } - } - } - #[macro_export] - macro_rules ! _include_book_author { ($ (($ ($ func_arg : ident : $ func_arg_ty : ty) , +) =>) ? $ module_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { # [allow (warnings)] pub mod $ module_name { crate :: prisma :: book_author :: include ! (@ definitions ; $ module_name ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; use super :: * ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: IncludeType for Selection { type Data = Data ; type ModelData = crate :: prisma :: book_author :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn include ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: book_author :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: book_author :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } } ; ({ $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { { crate :: prisma :: book_author :: include ! (@ definitions ; ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: IncludeType for Selection { type Data = Data ; type ModelData = crate :: prisma :: book_author :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: book_author :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: book_author :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } ; (@ definitions ; $ ($ module_name : ident) ? ; $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) +) => { # [allow (warnings)] enum Fields { author , book } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] pub struct Data { pub id : i32 , pub author_id : i32 , pub book_id : i32 , $ (pub $ field : crate :: prisma :: book_author :: include ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } impl :: serde :: Serialize for Data { fn serialize < S > (& self , serializer : S) -> Result < S :: Ok , S :: Error > where S : :: serde :: Serializer , { use :: serde :: ser :: SerializeStruct ; let mut state = serializer . serialize_struct ("Data" , [$ (stringify ! ($ field) ,) + stringify ! (id) , stringify ! (author_id) , stringify ! (book_id)] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: book_author :: $ field :: NAME , & self . $ field) ? ;) * state . serialize_field (crate :: prisma :: book_author :: id :: NAME , & self . id) ? ; state . serialize_field (crate :: prisma :: book_author :: author_id :: NAME , & self . author_id) ? ; state . serialize_field (crate :: prisma :: book_author :: book_id :: NAME , & self . book_id) ? ; state . end () } } impl < 'de > :: serde :: Deserialize < 'de > for Data { fn deserialize < D > (deserializer : D) -> Result < Self , D :: Error > where D : :: serde :: Deserializer < 'de > , { # [allow (warnings)] enum Field { $ ($ field) , + , id , author_id , book_id } impl < 'de > :: serde :: Deserialize < 'de > for Field { fn deserialize < D > (deserializer : D) -> Result < Field , D :: Error > where D : :: serde :: Deserializer < 'de > , { struct FieldVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for FieldVisitor { type Value = Field ; fn expecting (& self , formatter : & mut :: std :: fmt :: Formatter) -> :: std :: fmt :: Result { formatter . write_str (& [$ (crate :: prisma :: book_author :: $ field :: NAME) , + , crate :: prisma :: book_author :: id :: NAME , crate :: prisma :: book_author :: author_id :: NAME , crate :: prisma :: book_author :: book_id :: NAME] . into_iter () . collect :: < Vec < _ >> () . join (", ")) } fn visit_str < E > (self , value : & str) -> Result < Field , E > where E : :: serde :: de :: Error , { match value { $ (crate :: prisma :: book_author :: $ field :: NAME => Ok (Field :: $ field)) , * , crate :: prisma :: book_author :: id :: NAME => Ok (Field :: id) , crate :: prisma :: book_author :: author_id :: NAME => Ok (Field :: author_id) , crate :: prisma :: book_author :: book_id :: NAME => Ok (Field :: book_id) , _ => Err (:: serde :: de :: Error :: unknown_field (value , FIELDS)) , } } } deserializer . deserialize_identifier (FieldVisitor) } } struct DataVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for DataVisitor { type Value = Data ; fn expecting (& self , formatter : & mut std :: fmt :: Formatter) -> std :: fmt :: Result { formatter . write_str ("struct Data") } fn visit_map < V > (self , mut map : V) -> Result < Data , V :: Error > where V : :: serde :: de :: MapAccess < 'de > , { $ (let mut $ field = None ;) * let mut id = None ; let mut author_id = None ; let mut book_id = None ; while let Some (key) = map . next_key () ? { match key { Field :: id => { if id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: book_author :: id :: NAME)) ; } id = Some (map . next_value () ?) ; } Field :: author_id => { if author_id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: book_author :: author_id :: NAME)) ; } author_id = Some (map . next_value () ?) ; } Field :: book_id => { if book_id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: book_author :: book_id :: NAME)) ; } book_id = Some (map . next_value () ?) ; } $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: book_author :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: book_author :: $ field :: NAME)) ? ;) * let id = id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: book_author :: id :: NAME)) ? ; let author_id = author_id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: book_author :: author_id :: NAME)) ? ; let book_id = book_id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: book_author :: book_id :: NAME)) ? ; Ok (Data { id , author_id , book_id , $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "author_id" , "book_id" , "author" , "book"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: book_author :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; author : $ selection_mode : ident { $ ($ selections : tt) + }) => { author :: Data } ; (@ field_type ; author) => { crate :: prisma :: author :: Data } ; (@ field_type ; book : $ selection_mode : ident { $ ($ selections : tt) + }) => { book :: Data } ; (@ field_type ; book) => { crate :: prisma :: book :: Data } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "BookAuthor" , available relations are "author, book")) } ; (@ field_module ; author : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: author :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; book : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: book :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; author $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: book_author :: IncludeParam > :: into (crate :: prisma :: book_author :: author :: Include :: $ selection_mode (crate :: prisma :: author :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; author $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: book_author :: IncludeParam > :: into (crate :: prisma :: book_author :: author :: Include :: Fetch) } } ; (@ selection_field_to_selection_param ; book $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: book_author :: IncludeParam > :: into (crate :: prisma :: book_author :: book :: Include :: $ selection_mode (crate :: prisma :: book :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; book $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: book_author :: IncludeParam > :: into (crate :: prisma :: book_author :: book :: Include :: Fetch) } } ; (@ selection_field_to_selection_param ; $ ($ tokens : tt) *) => { compile_error ! (stringify ! ($ ($ tokens) *)) } ; (@ selections_to_params ; : $ macro_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { [$ (crate :: prisma :: book_author :: $ macro_name ! (@ selection_field_to_selection_param ; $ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) ,) +] } ; (@ filters_to_args ;) => { vec ! [] } ; (@ filters_to_args ; $ ($ t : tt) *) => { $ ($ t) * } ; (@ field_serde_name ; id) => { "id" } ; (@ field_serde_name ; author_id) => { "author_id" } ; (@ field_serde_name ; book_id) => { "book_id" } ; (@ field_serde_name ; author) => { "author" } ; (@ field_serde_name ; book) => { "book" } ; } - pub use _include_book_author as include; - pub enum IncludeParam { - Id(id::Include), - AuthorId(author_id::Include), - BookId(book_id::Include), - Author(author::Include), - Book(book::Include), - } - impl IncludeParam { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - match self { - Self::Id(data) => data.to_selection(), - Self::AuthorId(data) => data.to_selection(), - Self::BookId(data) => data.to_selection(), - Self::Author(data) => data.to_selection(), - Self::Book(data) => data.to_selection(), - } - } - } - #[macro_export] - macro_rules ! _partial_unchecked_book_author { ($ struct_name : ident { $ ($ scalar_field : ident) + }) => { :: prisma_client_rust :: macros :: partial_unchecked ! { crate :: prisma :: book_author struct $ struct_name { # [serde (rename = "id")] pub id : i32 , # [serde (rename = "author_id")] pub author_id : i32 , # [serde (rename = "book_id")] pub book_id : i32 } [$ ($ scalar_field) , +] } } ; } - pub use _partial_unchecked_book_author as partial_unchecked; - #[derive(Debug, Clone, :: serde :: Serialize, :: serde :: Deserialize)] - pub struct Data { - #[serde(rename = "id")] - pub id: i32, - #[serde(rename = "author_id")] - pub author_id: i32, - #[serde(rename = "book_id")] - pub book_id: i32, - #[serde(rename = "author")] - pub author: Option>, - #[serde(rename = "book")] - pub book: Option>, - } - impl Data { - pub fn author( - &self, - ) -> Result<&super::author::Data, ::prisma_client_rust::RelationNotFetchedError> { - self.author - .as_ref() - .ok_or(::prisma_client_rust::RelationNotFetchedError::new( - stringify!(author), - )) - .map(|v| v.as_ref()) - } - pub fn book( - &self, - ) -> Result<&super::book::Data, ::prisma_client_rust::RelationNotFetchedError> { - self.book - .as_ref() - .ok_or(::prisma_client_rust::RelationNotFetchedError::new( - stringify!(book), - )) - .map(|v| v.as_ref()) - } - } - #[derive(Clone)] - pub enum WithParam { - Author(super::author::UniqueArgs), - Book(super::book::UniqueArgs), - } - impl Into<::prisma_client_rust::Selection> for WithParam { - fn into(self) -> ::prisma_client_rust::Selection { - match self { - Self::Author(args) => { - let mut selections = < super :: author :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; - selections.extend( - args.with_params - .into_iter() - .map(Into::<::prisma_client_rust::Selection>::into), - ); - ::prisma_client_rust::Selection::new(author::NAME, None, [], selections) - } - Self::Book(args) => { - let mut selections = - ::scalar_selections( - ); - selections.extend( - args.with_params - .into_iter() - .map(Into::<::prisma_client_rust::Selection>::into), - ); - ::prisma_client_rust::Selection::new(book::NAME, None, [], selections) - } - } - } - } - #[derive(Clone)] - pub enum SetParam { - SetId(i32), - IncrementId(i32), - DecrementId(i32), - MultiplyId(i32), - DivideId(i32), - SetAuthorId(i32), - IncrementAuthorId(i32), - DecrementAuthorId(i32), - MultiplyAuthorId(i32), - DivideAuthorId(i32), - SetBookId(i32), - IncrementBookId(i32), - DecrementBookId(i32), - MultiplyBookId(i32), - DivideBookId(i32), - ConnectAuthor(super::author::UniqueWhereParam), - ConnectBook(super::book::UniqueWhereParam), - } - impl From for (String, ::prisma_client_rust::PrismaValue) { - fn from(param: SetParam) -> Self { - match param { - SetParam::SetId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - ), - SetParam::IncrementId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "increment".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DecrementId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "decrement".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::MultiplyId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "multiply".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DivideId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "divide".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::SetAuthorId(value) => ( - author_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - ), - SetParam::IncrementAuthorId(value) => ( - author_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "increment".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DecrementAuthorId(value) => ( - author_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "decrement".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::MultiplyAuthorId(value) => ( - author_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "multiply".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DivideAuthorId(value) => ( - author_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "divide".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::SetBookId(value) => ( - book_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - ), - SetParam::IncrementBookId(value) => ( - book_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "increment".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DecrementBookId(value) => ( - book_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "decrement".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::MultiplyBookId(value) => ( - book_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "multiply".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DivideBookId(value) => ( - book_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "divide".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::ConnectAuthor(where_param) => ( - author::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "connect".to_string(), - ::prisma_client_rust::PrismaValue::Object( - [where_param] - .into_iter() - .map(Into::::into) - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - SetParam::ConnectBook(where_param) => ( - book::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "connect".to_string(), - ::prisma_client_rust::PrismaValue::Object( - [where_param] - .into_iter() - .map(Into::::into) - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - } - } - } - #[derive(Clone)] - pub enum UncheckedSetParam { - Id(i32), - AuthorId(i32), - BookId(i32), - } - impl From for SetParam { - fn from(param: UncheckedSetParam) -> Self { - match param { - UncheckedSetParam::Id(value) => Self::SetId(value), - UncheckedSetParam::AuthorId(value) => Self::SetAuthorId(value), - UncheckedSetParam::BookId(value) => Self::SetBookId(value), - } - } - } - #[derive(Clone)] - pub enum OrderByParam { - Id(::prisma_client_rust::Direction), - AuthorId(::prisma_client_rust::Direction), - BookId(::prisma_client_rust::Direction), - } - impl Into<(String, ::prisma_client_rust::PrismaValue)> for OrderByParam { - fn into(self) -> (String, ::prisma_client_rust::PrismaValue) { - match self { - Self::Id(direction) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(direction.to_string()), - ), - Self::AuthorId(direction) => ( - author_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(direction.to_string()), - ), - Self::BookId(direction) => ( - book_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(direction.to_string()), - ), - } - } - } - #[derive(Clone)] - pub enum WhereParam { - Not(Vec), - Or(Vec), - And(Vec), - BookIdAuthorIdEquals(i32, i32), - Id(_prisma::read_filters::IntFilter), - AuthorId(_prisma::read_filters::IntFilter), - BookId(_prisma::read_filters::IntFilter), - AuthorIs(Vec), - AuthorIsNot(Vec), - BookIs(Vec), - BookIsNot(Vec), - } - impl ::prisma_client_rust::WhereInput for WhereParam { - fn serialize(self) -> ::prisma_client_rust::SerializedWhereInput { - let (name, value) = match self { - Self::Not(value) => ( - "NOT", - ::prisma_client_rust::SerializedWhereValue::Object( - ::prisma_client_rust::merge_fields( - value - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(Into::into) - .collect(), - ), - ), - ), - Self::Or(value) => ( - "OR", - ::prisma_client_rust::SerializedWhereValue::List( - value - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(Into::into) - .map(|v| vec![v]) - .map(::prisma_client_rust::PrismaValue::Object) - .collect(), - ), - ), - Self::And(value) => ( - "AND", - ::prisma_client_rust::SerializedWhereValue::Object( - ::prisma_client_rust::merge_fields( - value - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(Into::into) - .collect(), - ), - ), - ), - Self::BookIdAuthorIdEquals(book_id, author_id) => ( - "book_id_author_id", - ::prisma_client_rust::SerializedWhereValue::Object(vec![ - ( - book_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Int(book_id as i64), - ), - ( - author_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Int(author_id as i64), - ), - ]), - ), - Self::Id(value) => (id::NAME, value.into()), - Self::AuthorId(value) => (author_id::NAME, value.into()), - Self::BookId(value) => (book_id::NAME, value.into()), - Self::AuthorIs(where_params) => ( - author::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "is".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::AuthorIsNot(where_params) => ( - author::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "isNot".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::BookIs(where_params) => ( - book::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "is".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::BookIsNot(where_params) => ( - book::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "isNot".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - }; - ::prisma_client_rust::SerializedWhereInput::new(name, value.into()) - } - } - #[derive(Clone)] - pub enum UniqueWhereParam { - BookIdAuthorIdEquals(i32, i32), - IdEquals(i32), - } - impl From for WhereParam { - fn from(value: UniqueWhereParam) -> Self { - match value { - UniqueWhereParam::BookIdAuthorIdEquals(book_id, author_id) => { - Self::BookIdAuthorIdEquals(book_id, author_id) - } - UniqueWhereParam::IdEquals(value) => { - Self::Id(_prisma::read_filters::IntFilter::Equals(value)) - } - } - } - } - impl From<::prisma_client_rust::Operator> for WhereParam { - fn from(op: ::prisma_client_rust::Operator) -> Self { - match op { - ::prisma_client_rust::Operator::Not(value) => Self::Not(value), - ::prisma_client_rust::Operator::And(value) => Self::And(value), - ::prisma_client_rust::Operator::Or(value) => Self::Or(value), - } - } - } - #[derive(Clone)] - pub struct Types; - impl ::prisma_client_rust::ModelTypes for Types { - type Data = Data; - type Where = WhereParam; - type UncheckedSet = UncheckedSetParam; - type Set = SetParam; - type With = WithParam; - type OrderBy = OrderByParam; - type Cursor = UniqueWhereParam; - const MODEL: &'static str = NAME; - fn scalar_selections() -> Vec<::prisma_client_rust::Selection> { - vec![ - ::prisma_client_rust::sel(id::NAME), - ::prisma_client_rust::sel(author_id::NAME), - ::prisma_client_rust::sel(book_id::NAME), - ] - } - } - pub type UniqueArgs = ::prisma_client_rust::UniqueArgs; - pub type ManyArgs = ::prisma_client_rust::ManyArgs; - pub type Count<'a> = ::prisma_client_rust::Count<'a, Types>; - pub type Create<'a> = ::prisma_client_rust::Create<'a, Types>; - pub type CreateMany<'a> = ::prisma_client_rust::CreateMany<'a, Types>; - pub type FindUnique<'a> = ::prisma_client_rust::FindUnique<'a, Types>; - pub type FindMany<'a> = ::prisma_client_rust::FindMany<'a, Types>; - pub type FindFirst<'a> = ::prisma_client_rust::FindFirst<'a, Types>; - pub type Update<'a> = ::prisma_client_rust::Update<'a, Types>; - pub type UpdateMany<'a> = ::prisma_client_rust::UpdateMany<'a, Types>; - pub type Upsert<'a> = ::prisma_client_rust::Upsert<'a, Types>; - pub type Delete<'a> = ::prisma_client_rust::Delete<'a, Types>; - pub type DeleteMany<'a> = ::prisma_client_rust::DeleteMany<'a, Types>; - #[derive(Clone)] - pub struct Actions<'a> { - pub client: &'a ::prisma_client_rust::PrismaClientInternals, - } - impl<'a> Actions<'a> { - pub fn find_unique(self, _where: UniqueWhereParam) -> FindUnique<'a> { - FindUnique::new(self.client, _where.into()) - } - pub fn find_first(self, _where: Vec) -> FindFirst<'a> { - FindFirst::new(self.client, _where) - } - pub fn find_many(self, _where: Vec) -> FindMany<'a> { - FindMany::new(self.client, _where) - } - pub fn create( - self, - author: super::author::UniqueWhereParam, - book: super::book::UniqueWhereParam, - mut _params: Vec, - ) -> Create<'a> { - _params.extend([author::connect(author), book::connect(book)]); - Create::new(self.client, _params) - } - pub fn create_unchecked( - self, - author_id: i32, - book_id: i32, - mut _params: Vec, - ) -> Create<'a> { - _params.extend([author_id::set(author_id), book_id::set(book_id)]); - Create::new(self.client, _params.into_iter().map(Into::into).collect()) - } - pub fn create_many(self, data: Vec<(i32, i32, Vec)>) -> CreateMany<'a> { - let data = data - .into_iter() - .map(|(author_id, book_id, mut _params)| { - _params.extend([author_id::set(author_id), book_id::set(book_id)]); - _params - }) - .collect(); - CreateMany::new(self.client, data) - } - pub fn update(self, _where: UniqueWhereParam, _params: Vec) -> Update<'a> { - Update::new(self.client, _where.into(), _params, vec![]) - } - pub fn update_unchecked( - self, - _where: UniqueWhereParam, - _params: Vec, - ) -> Update<'a> { - Update::new( - self.client, - _where.into(), - _params.into_iter().map(Into::into).collect(), - vec![], - ) - } - pub fn update_many( - self, - _where: Vec, - _params: Vec, - ) -> UpdateMany<'a> { - UpdateMany::new(self.client, _where, _params) - } - pub fn upsert( - self, - _where: UniqueWhereParam, - (author, book, mut _params): ( - super::author::UniqueWhereParam, - super::book::UniqueWhereParam, - Vec, - ), - _update: Vec, - ) -> Upsert<'a> { - _params.extend([author::connect(author), book::connect(book)]); - Upsert::new(self.client, _where.into(), _params, _update) - } - pub fn delete(self, _where: UniqueWhereParam) -> Delete<'a> { - Delete::new(self.client, _where.into(), vec![]) - } - pub fn delete_many(self, _where: Vec) -> DeleteMany<'a> { - DeleteMany::new(self.client, _where) - } - pub fn count(self, _where: Vec) -> Count<'a> { - Count::new(self.client, _where) - } - } -} -pub mod book_genre { - - use super::*; - pub const NAME: &str = "BookGenre"; - pub mod id { - use super::super::*; - - use super::{OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam}; - pub const NAME: &str = "id"; - pub struct Set(pub i32); - impl From for SetParam { - fn from(Set(v): Set) -> Self { - Self::SetId(v) - } - } - impl From for UncheckedSetParam { - fn from(Set(v): Set) -> Self { - Self::Id(v) - } - } - pub fn set>(value: i32) -> T { - Set(value).into() - } - pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { - OrderByParam::Id(direction) - } - pub fn equals>(value: i32) -> T { - UniqueWhereParam::IdEquals(value).into() - } - ::prisma_client_rust::scalar_where_param_fns!(_prisma::read_filters::IntFilter, Id, { - fn in_vec(_: Vec) -> InVec; - fn not_in_vec(_: Vec) -> NotInVec; - fn lt(_: i32) -> Lt; - fn lte(_: i32) -> Lte; - fn gt(_: i32) -> Gt; - fn gte(_: i32) -> Gte; - fn not(_: i32) -> Not; - }); - pub fn increment(value: i32) -> SetParam { - SetParam::IncrementId(value) - } - pub fn decrement(value: i32) -> SetParam { - SetParam::DecrementId(value) - } - pub fn multiply(value: i32) -> SetParam { - SetParam::MultiplyId(value) - } - pub fn divide(value: i32) -> SetParam { - SetParam::DivideId(value) - } - pub struct Include; - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::Id(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - pub struct Select; - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::Id(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - } - pub mod genre_id { - use super::super::*; - - use super::{OrderByParam, SetParam, UncheckedSetParam, WhereParam}; - pub const NAME: &str = "genre_id"; - pub struct Set(pub i32); - impl From for SetParam { - fn from(Set(v): Set) -> Self { - Self::SetGenreId(v) - } - } - impl From for UncheckedSetParam { - fn from(Set(v): Set) -> Self { - Self::GenreId(v) - } - } - pub fn set>(value: i32) -> T { - Set(value).into() - } - pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { - OrderByParam::GenreId(direction) - } - pub fn equals(value: i32) -> WhereParam { - WhereParam::GenreId(_prisma::read_filters::IntFilter::Equals(value)) - } - ::prisma_client_rust::scalar_where_param_fns!(_prisma::read_filters::IntFilter, GenreId, { - fn in_vec(_: Vec) -> InVec; - fn not_in_vec(_: Vec) -> NotInVec; - fn lt(_: i32) -> Lt; - fn lte(_: i32) -> Lte; - fn gt(_: i32) -> Gt; - fn gte(_: i32) -> Gte; - fn not(_: i32) -> Not; - }); - pub fn increment(value: i32) -> SetParam { - SetParam::IncrementGenreId(value) - } - pub fn decrement(value: i32) -> SetParam { - SetParam::DecrementGenreId(value) - } - pub fn multiply(value: i32) -> SetParam { - SetParam::MultiplyGenreId(value) - } - pub fn divide(value: i32) -> SetParam { - SetParam::DivideGenreId(value) - } - pub struct Include; - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::GenreId(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - pub struct Select; - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::GenreId(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - } - pub mod book_id { - use super::super::*; - - use super::{OrderByParam, SetParam, UncheckedSetParam, WhereParam}; - pub const NAME: &str = "book_id"; - pub struct Set(pub i32); - impl From for SetParam { - fn from(Set(v): Set) -> Self { - Self::SetBookId(v) - } - } - impl From for UncheckedSetParam { - fn from(Set(v): Set) -> Self { - Self::BookId(v) - } - } - pub fn set>(value: i32) -> T { - Set(value).into() - } - pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { - OrderByParam::BookId(direction) - } - pub fn equals(value: i32) -> WhereParam { - WhereParam::BookId(_prisma::read_filters::IntFilter::Equals(value)) - } - ::prisma_client_rust::scalar_where_param_fns!(_prisma::read_filters::IntFilter, BookId, { - fn in_vec(_: Vec) -> InVec; - fn not_in_vec(_: Vec) -> NotInVec; - fn lt(_: i32) -> Lt; - fn lte(_: i32) -> Lte; - fn gt(_: i32) -> Gt; - fn gte(_: i32) -> Gte; - fn not(_: i32) -> Not; - }); - pub fn increment(value: i32) -> SetParam { - SetParam::IncrementBookId(value) - } - pub fn decrement(value: i32) -> SetParam { - SetParam::DecrementBookId(value) - } - pub fn multiply(value: i32) -> SetParam { - SetParam::MultiplyBookId(value) - } - pub fn divide(value: i32) -> SetParam { - SetParam::DivideBookId(value) - } - pub struct Include; - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::BookId(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - pub struct Select; - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::BookId(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - } - pub mod book { - use super::super::*; - - use super::{SetParam, WhereParam, WithParam}; - pub const NAME: &str = "book"; - pub struct Fetch(pub book::UniqueArgs); - impl Fetch { - pub fn with(mut self, params: impl Into) -> Self { - self.0 = self.0.with(params.into()); - self - } - } - impl From for WithParam { - fn from(Fetch(v): Fetch) -> Self { - WithParam::Book(v) - } - } - pub fn fetch() -> Fetch { - Fetch(book::UniqueArgs::new()) - } - pub struct Connect(book::UniqueWhereParam); - impl From for SetParam { - fn from(Connect(v): Connect) -> Self { - Self::ConnectBook(v) - } - } - pub fn connect>(value: book::UniqueWhereParam) -> T { - Connect(value).into() - } - pub fn is(value: Vec) -> WhereParam { - WhereParam::BookIs(value) - } - pub fn is_not(value: Vec) -> WhereParam { - WhereParam::BookIsNot(value) - } - pub enum Include { - Select(Vec), - Include(Vec), - Fetch, - } - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::Book(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let selections = match self { - Self::Select(selections) => { - selections.into_iter().map(|s| s.to_selection()).collect() - } - Self::Include(selections) => { - let mut nested_selections = - ::scalar_selections(); - nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); - nested_selections - } - Self::Fetch => { - ::scalar_selections() - } - }; - ::prisma_client_rust::Selection::new("book", None, [], selections) - } - pub fn select(nested_selections: Vec) -> Self { - Self::Select(nested_selections) - } - pub fn include(nested_selections: Vec) -> Self { - Self::Include(nested_selections) - } - } - pub enum Select { - Select(Vec), - Include(Vec), - Fetch, - } - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::Book(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let selections = match self { - Self::Select(selections) => { - selections.into_iter().map(|s| s.to_selection()).collect() - } - Self::Include(selections) => { - let mut nested_selections = vec![]; - nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); - nested_selections - } - Self::Fetch => { - ::scalar_selections() - } - }; - ::prisma_client_rust::Selection::new("book", None, [], selections) - } - pub fn select(nested_selections: Vec) -> Self { - Self::Select(nested_selections) - } - pub fn include(nested_selections: Vec) -> Self { - Self::Include(nested_selections) - } - } - } - pub mod genre { - use super::super::*; - - use super::{SetParam, WhereParam, WithParam}; - pub const NAME: &str = "genre"; - pub struct Fetch(pub genre::UniqueArgs); - impl Fetch { - pub fn with(mut self, params: impl Into) -> Self { - self.0 = self.0.with(params.into()); - self - } - } - impl From for WithParam { - fn from(Fetch(v): Fetch) -> Self { - WithParam::Genre(v) - } - } - pub fn fetch() -> Fetch { - Fetch(genre::UniqueArgs::new()) - } - pub struct Connect(genre::UniqueWhereParam); - impl From for SetParam { - fn from(Connect(v): Connect) -> Self { - Self::ConnectGenre(v) - } - } - pub fn connect>(value: genre::UniqueWhereParam) -> T { - Connect(value).into() - } - pub fn is(value: Vec) -> WhereParam { - WhereParam::GenreIs(value) - } - pub fn is_not(value: Vec) -> WhereParam { - WhereParam::GenreIsNot(value) - } - pub enum Include { - Select(Vec), - Include(Vec), - Fetch, - } - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::Genre(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let selections = match self { - Self::Select(selections) => { - selections.into_iter().map(|s| s.to_selection()).collect() - } - Self::Include(selections) => { - let mut nested_selections = - ::scalar_selections(); - nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); - nested_selections - } - Self::Fetch => { - ::scalar_selections() - } - }; - ::prisma_client_rust::Selection::new("genre", None, [], selections) - } - pub fn select(nested_selections: Vec) -> Self { - Self::Select(nested_selections) - } - pub fn include(nested_selections: Vec) -> Self { - Self::Include(nested_selections) - } - } - pub enum Select { - Select(Vec), - Include(Vec), - Fetch, - } - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::Genre(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let selections = match self { - Self::Select(selections) => { - selections.into_iter().map(|s| s.to_selection()).collect() - } - Self::Include(selections) => { - let mut nested_selections = vec![]; - nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); - nested_selections - } - Self::Fetch => { - ::scalar_selections() - } - }; - ::prisma_client_rust::Selection::new("genre", None, [], selections) - } - pub fn select(nested_selections: Vec) -> Self { - Self::Select(nested_selections) - } - pub fn include(nested_selections: Vec) -> Self { - Self::Include(nested_selections) - } - } - } - pub fn book_id_genre_id>(book_id: i32, genre_id: i32) -> T { - UniqueWhereParam::BookIdGenreIdEquals(book_id, genre_id).into() - } - pub fn create( - book: super::book::UniqueWhereParam, - genre: super::genre::UniqueWhereParam, - _params: Vec, - ) -> ( - super::book::UniqueWhereParam, - super::genre::UniqueWhereParam, - Vec, - ) { - (book, genre, _params) - } - pub fn create_unchecked( - genre_id: i32, - book_id: i32, - _params: Vec, - ) -> (i32, i32, Vec) { - (genre_id, book_id, _params) - } - #[macro_export] - macro_rules ! _select_book_genre { ($ (($ ($ func_arg : ident : $ func_arg_ty : ty) , +) =>) ? $ module_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { # [allow (warnings)] pub mod $ module_name { crate :: prisma :: book_genre :: select ! (@ definitions ; $ module_name ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; use super :: * ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: SelectType for Selection { type Data = Data ; type ModelData = crate :: prisma :: book_genre :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn select ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: book_genre :: select ! (@ selections_to_params ; : select { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () ,] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } } ; ({ $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { { crate :: prisma :: book_genre :: select ! (@ definitions ; ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: SelectType for Selection { type Data = Data ; type ModelData = crate :: prisma :: book_genre :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: book_genre :: select ! (@ selections_to_params ; : select { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () ,] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } ; (@ definitions ; $ ($ module_name : ident) ? ; $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) +) => { # [allow (warnings)] enum Fields { id , genre_id , book_id , book , genre } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] pub struct Data { $ (pub $ field : crate :: prisma :: book_genre :: select ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } impl :: serde :: Serialize for Data { fn serialize < S > (& self , serializer : S) -> Result < S :: Ok , S :: Error > where S : :: serde :: Serializer , { use :: serde :: ser :: SerializeStruct ; let mut state = serializer . serialize_struct ("Data" , [$ (stringify ! ($ field) ,) +] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: book_genre :: $ field :: NAME , & self . $ field) ? ;) * state . end () } } impl < 'de > :: serde :: Deserialize < 'de > for Data { fn deserialize < D > (deserializer : D) -> Result < Self , D :: Error > where D : :: serde :: Deserializer < 'de > , { # [allow (warnings)] enum Field { $ ($ field) , + , } impl < 'de > :: serde :: Deserialize < 'de > for Field { fn deserialize < D > (deserializer : D) -> Result < Field , D :: Error > where D : :: serde :: Deserializer < 'de > , { struct FieldVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for FieldVisitor { type Value = Field ; fn expecting (& self , formatter : & mut :: std :: fmt :: Formatter) -> :: std :: fmt :: Result { formatter . write_str (& [$ (crate :: prisma :: book_genre :: $ field :: NAME) , + ,] . into_iter () . collect :: < Vec < _ >> () . join (", ")) } fn visit_str < E > (self , value : & str) -> Result < Field , E > where E : :: serde :: de :: Error , { match value { $ (crate :: prisma :: book_genre :: $ field :: NAME => Ok (Field :: $ field)) , * , _ => Err (:: serde :: de :: Error :: unknown_field (value , FIELDS)) , } } } deserializer . deserialize_identifier (FieldVisitor) } } struct DataVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for DataVisitor { type Value = Data ; fn expecting (& self , formatter : & mut std :: fmt :: Formatter) -> std :: fmt :: Result { formatter . write_str ("struct Data") } fn visit_map < V > (self , mut map : V) -> Result < Data , V :: Error > where V : :: serde :: de :: MapAccess < 'de > , { $ (let mut $ field = None ;) * while let Some (key) = map . next_key () ? { match key { $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: book_genre :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: book_genre :: $ field :: NAME)) ? ;) * Ok (Data { $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "genre_id" , "book_id" , "book" , "genre"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: book_genre :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; id) => { i32 } ; (@ field_type ; genre_id) => { i32 } ; (@ field_type ; book_id) => { i32 } ; (@ field_type ; book : $ selection_mode : ident { $ ($ selections : tt) + }) => { book :: Data } ; (@ field_type ; book) => { crate :: prisma :: book :: Data } ; (@ field_type ; genre : $ selection_mode : ident { $ ($ selections : tt) + }) => { genre :: Data } ; (@ field_type ; genre) => { crate :: prisma :: genre :: Data } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "BookGenre" , available relations are "id, genre_id, book_id, book, genre")) } ; (@ field_module ; book : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: book :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; genre : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: genre :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; id) => { Into :: < crate :: prisma :: book_genre :: SelectParam > :: into (crate :: prisma :: book_genre :: id :: Select) } ; (@ selection_field_to_selection_param ; genre_id) => { Into :: < crate :: prisma :: book_genre :: SelectParam > :: into (crate :: prisma :: book_genre :: genre_id :: Select) } ; (@ selection_field_to_selection_param ; book_id) => { Into :: < crate :: prisma :: book_genre :: SelectParam > :: into (crate :: prisma :: book_genre :: book_id :: Select) } ; (@ selection_field_to_selection_param ; book $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: book_genre :: SelectParam > :: into (crate :: prisma :: book_genre :: book :: Select :: $ selection_mode (crate :: prisma :: book :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; book $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: book_genre :: SelectParam > :: into (crate :: prisma :: book_genre :: book :: Select :: Fetch) } } ; (@ selection_field_to_selection_param ; genre $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: book_genre :: SelectParam > :: into (crate :: prisma :: book_genre :: genre :: Select :: $ selection_mode (crate :: prisma :: genre :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; genre $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: book_genre :: SelectParam > :: into (crate :: prisma :: book_genre :: genre :: Select :: Fetch) } } ; (@ selection_field_to_selection_param ; $ ($ tokens : tt) *) => { compile_error ! (stringify ! ($ ($ tokens) *)) } ; (@ selections_to_params ; : $ macro_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { [$ (crate :: prisma :: book_genre :: $ macro_name ! (@ selection_field_to_selection_param ; $ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) ,) +] } ; (@ filters_to_args ;) => { vec ! [] } ; (@ filters_to_args ; $ ($ t : tt) *) => { $ ($ t) * } ; (@ field_serde_name ; id) => { "id" } ; (@ field_serde_name ; genre_id) => { "genre_id" } ; (@ field_serde_name ; book_id) => { "book_id" } ; (@ field_serde_name ; book) => { "book" } ; (@ field_serde_name ; genre) => { "genre" } ; } - pub use _select_book_genre as select; - pub enum SelectParam { - Id(id::Select), - GenreId(genre_id::Select), - BookId(book_id::Select), - Book(book::Select), - Genre(genre::Select), - } - impl SelectParam { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - match self { - Self::Id(data) => data.to_selection(), - Self::GenreId(data) => data.to_selection(), - Self::BookId(data) => data.to_selection(), - Self::Book(data) => data.to_selection(), - Self::Genre(data) => data.to_selection(), - } - } - } - #[macro_export] - macro_rules ! _include_book_genre { ($ (($ ($ func_arg : ident : $ func_arg_ty : ty) , +) =>) ? $ module_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { # [allow (warnings)] pub mod $ module_name { crate :: prisma :: book_genre :: include ! (@ definitions ; $ module_name ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; use super :: * ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: IncludeType for Selection { type Data = Data ; type ModelData = crate :: prisma :: book_genre :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn include ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: book_genre :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: book_genre :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } } ; ({ $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { { crate :: prisma :: book_genre :: include ! (@ definitions ; ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: IncludeType for Selection { type Data = Data ; type ModelData = crate :: prisma :: book_genre :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: book_genre :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: book_genre :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } ; (@ definitions ; $ ($ module_name : ident) ? ; $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) +) => { # [allow (warnings)] enum Fields { book , genre } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] pub struct Data { pub id : i32 , pub genre_id : i32 , pub book_id : i32 , $ (pub $ field : crate :: prisma :: book_genre :: include ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } impl :: serde :: Serialize for Data { fn serialize < S > (& self , serializer : S) -> Result < S :: Ok , S :: Error > where S : :: serde :: Serializer , { use :: serde :: ser :: SerializeStruct ; let mut state = serializer . serialize_struct ("Data" , [$ (stringify ! ($ field) ,) + stringify ! (id) , stringify ! (genre_id) , stringify ! (book_id)] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: book_genre :: $ field :: NAME , & self . $ field) ? ;) * state . serialize_field (crate :: prisma :: book_genre :: id :: NAME , & self . id) ? ; state . serialize_field (crate :: prisma :: book_genre :: genre_id :: NAME , & self . genre_id) ? ; state . serialize_field (crate :: prisma :: book_genre :: book_id :: NAME , & self . book_id) ? ; state . end () } } impl < 'de > :: serde :: Deserialize < 'de > for Data { fn deserialize < D > (deserializer : D) -> Result < Self , D :: Error > where D : :: serde :: Deserializer < 'de > , { # [allow (warnings)] enum Field { $ ($ field) , + , id , genre_id , book_id } impl < 'de > :: serde :: Deserialize < 'de > for Field { fn deserialize < D > (deserializer : D) -> Result < Field , D :: Error > where D : :: serde :: Deserializer < 'de > , { struct FieldVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for FieldVisitor { type Value = Field ; fn expecting (& self , formatter : & mut :: std :: fmt :: Formatter) -> :: std :: fmt :: Result { formatter . write_str (& [$ (crate :: prisma :: book_genre :: $ field :: NAME) , + , crate :: prisma :: book_genre :: id :: NAME , crate :: prisma :: book_genre :: genre_id :: NAME , crate :: prisma :: book_genre :: book_id :: NAME] . into_iter () . collect :: < Vec < _ >> () . join (", ")) } fn visit_str < E > (self , value : & str) -> Result < Field , E > where E : :: serde :: de :: Error , { match value { $ (crate :: prisma :: book_genre :: $ field :: NAME => Ok (Field :: $ field)) , * , crate :: prisma :: book_genre :: id :: NAME => Ok (Field :: id) , crate :: prisma :: book_genre :: genre_id :: NAME => Ok (Field :: genre_id) , crate :: prisma :: book_genre :: book_id :: NAME => Ok (Field :: book_id) , _ => Err (:: serde :: de :: Error :: unknown_field (value , FIELDS)) , } } } deserializer . deserialize_identifier (FieldVisitor) } } struct DataVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for DataVisitor { type Value = Data ; fn expecting (& self , formatter : & mut std :: fmt :: Formatter) -> std :: fmt :: Result { formatter . write_str ("struct Data") } fn visit_map < V > (self , mut map : V) -> Result < Data , V :: Error > where V : :: serde :: de :: MapAccess < 'de > , { $ (let mut $ field = None ;) * let mut id = None ; let mut genre_id = None ; let mut book_id = None ; while let Some (key) = map . next_key () ? { match key { Field :: id => { if id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: book_genre :: id :: NAME)) ; } id = Some (map . next_value () ?) ; } Field :: genre_id => { if genre_id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: book_genre :: genre_id :: NAME)) ; } genre_id = Some (map . next_value () ?) ; } Field :: book_id => { if book_id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: book_genre :: book_id :: NAME)) ; } book_id = Some (map . next_value () ?) ; } $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: book_genre :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: book_genre :: $ field :: NAME)) ? ;) * let id = id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: book_genre :: id :: NAME)) ? ; let genre_id = genre_id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: book_genre :: genre_id :: NAME)) ? ; let book_id = book_id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: book_genre :: book_id :: NAME)) ? ; Ok (Data { id , genre_id , book_id , $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "genre_id" , "book_id" , "book" , "genre"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: book_genre :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; book : $ selection_mode : ident { $ ($ selections : tt) + }) => { book :: Data } ; (@ field_type ; book) => { crate :: prisma :: book :: Data } ; (@ field_type ; genre : $ selection_mode : ident { $ ($ selections : tt) + }) => { genre :: Data } ; (@ field_type ; genre) => { crate :: prisma :: genre :: Data } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "BookGenre" , available relations are "book, genre")) } ; (@ field_module ; book : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: book :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; genre : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: genre :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; book $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: book_genre :: IncludeParam > :: into (crate :: prisma :: book_genre :: book :: Include :: $ selection_mode (crate :: prisma :: book :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; book $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: book_genre :: IncludeParam > :: into (crate :: prisma :: book_genre :: book :: Include :: Fetch) } } ; (@ selection_field_to_selection_param ; genre $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: book_genre :: IncludeParam > :: into (crate :: prisma :: book_genre :: genre :: Include :: $ selection_mode (crate :: prisma :: genre :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; genre $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: book_genre :: IncludeParam > :: into (crate :: prisma :: book_genre :: genre :: Include :: Fetch) } } ; (@ selection_field_to_selection_param ; $ ($ tokens : tt) *) => { compile_error ! (stringify ! ($ ($ tokens) *)) } ; (@ selections_to_params ; : $ macro_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { [$ (crate :: prisma :: book_genre :: $ macro_name ! (@ selection_field_to_selection_param ; $ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) ,) +] } ; (@ filters_to_args ;) => { vec ! [] } ; (@ filters_to_args ; $ ($ t : tt) *) => { $ ($ t) * } ; (@ field_serde_name ; id) => { "id" } ; (@ field_serde_name ; genre_id) => { "genre_id" } ; (@ field_serde_name ; book_id) => { "book_id" } ; (@ field_serde_name ; book) => { "book" } ; (@ field_serde_name ; genre) => { "genre" } ; } - pub use _include_book_genre as include; - pub enum IncludeParam { - Id(id::Include), - GenreId(genre_id::Include), - BookId(book_id::Include), - Book(book::Include), - Genre(genre::Include), - } - impl IncludeParam { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - match self { - Self::Id(data) => data.to_selection(), - Self::GenreId(data) => data.to_selection(), - Self::BookId(data) => data.to_selection(), - Self::Book(data) => data.to_selection(), - Self::Genre(data) => data.to_selection(), - } - } - } - #[macro_export] - macro_rules ! _partial_unchecked_book_genre { ($ struct_name : ident { $ ($ scalar_field : ident) + }) => { :: prisma_client_rust :: macros :: partial_unchecked ! { crate :: prisma :: book_genre struct $ struct_name { # [serde (rename = "id")] pub id : i32 , # [serde (rename = "genre_id")] pub genre_id : i32 , # [serde (rename = "book_id")] pub book_id : i32 } [$ ($ scalar_field) , +] } } ; } - pub use _partial_unchecked_book_genre as partial_unchecked; - #[derive(Debug, Clone, :: serde :: Serialize, :: serde :: Deserialize)] - pub struct Data { - #[serde(rename = "id")] - pub id: i32, - #[serde(rename = "genre_id")] - pub genre_id: i32, - #[serde(rename = "book_id")] - pub book_id: i32, - #[serde(rename = "book")] - pub book: Option>, - #[serde(rename = "genre")] - pub genre: Option>, - } - impl Data { - pub fn book( - &self, - ) -> Result<&super::book::Data, ::prisma_client_rust::RelationNotFetchedError> { - self.book - .as_ref() - .ok_or(::prisma_client_rust::RelationNotFetchedError::new( - stringify!(book), - )) - .map(|v| v.as_ref()) - } - pub fn genre( - &self, - ) -> Result<&super::genre::Data, ::prisma_client_rust::RelationNotFetchedError> { - self.genre - .as_ref() - .ok_or(::prisma_client_rust::RelationNotFetchedError::new( - stringify!(genre), - )) - .map(|v| v.as_ref()) - } - } - #[derive(Clone)] - pub enum WithParam { - Book(super::book::UniqueArgs), - Genre(super::genre::UniqueArgs), - } - impl Into<::prisma_client_rust::Selection> for WithParam { - fn into(self) -> ::prisma_client_rust::Selection { - match self { - Self::Book(args) => { - let mut selections = - ::scalar_selections( - ); - selections.extend( - args.with_params - .into_iter() - .map(Into::<::prisma_client_rust::Selection>::into), - ); - ::prisma_client_rust::Selection::new(book::NAME, None, [], selections) - } - Self::Genre(args) => { - let mut selections = < super :: genre :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; - selections.extend( - args.with_params - .into_iter() - .map(Into::<::prisma_client_rust::Selection>::into), - ); - ::prisma_client_rust::Selection::new(genre::NAME, None, [], selections) - } - } - } - } - #[derive(Clone)] - pub enum SetParam { - SetId(i32), - IncrementId(i32), - DecrementId(i32), - MultiplyId(i32), - DivideId(i32), - SetGenreId(i32), - IncrementGenreId(i32), - DecrementGenreId(i32), - MultiplyGenreId(i32), - DivideGenreId(i32), - SetBookId(i32), - IncrementBookId(i32), - DecrementBookId(i32), - MultiplyBookId(i32), - DivideBookId(i32), - ConnectBook(super::book::UniqueWhereParam), - ConnectGenre(super::genre::UniqueWhereParam), - } - impl From for (String, ::prisma_client_rust::PrismaValue) { - fn from(param: SetParam) -> Self { - match param { - SetParam::SetId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - ), - SetParam::IncrementId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "increment".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DecrementId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "decrement".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::MultiplyId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "multiply".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DivideId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "divide".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::SetGenreId(value) => ( - genre_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - ), - SetParam::IncrementGenreId(value) => ( - genre_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "increment".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DecrementGenreId(value) => ( - genre_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "decrement".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::MultiplyGenreId(value) => ( - genre_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "multiply".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DivideGenreId(value) => ( - genre_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "divide".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::SetBookId(value) => ( - book_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - ), - SetParam::IncrementBookId(value) => ( - book_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "increment".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DecrementBookId(value) => ( - book_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "decrement".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::MultiplyBookId(value) => ( - book_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "multiply".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DivideBookId(value) => ( - book_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "divide".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::ConnectBook(where_param) => ( - book::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "connect".to_string(), - ::prisma_client_rust::PrismaValue::Object( - [where_param] - .into_iter() - .map(Into::::into) - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - SetParam::ConnectGenre(where_param) => ( - genre::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "connect".to_string(), - ::prisma_client_rust::PrismaValue::Object( - [where_param] - .into_iter() - .map(Into::::into) - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - } - } - } - #[derive(Clone)] - pub enum UncheckedSetParam { - Id(i32), - GenreId(i32), - BookId(i32), - } - impl From for SetParam { - fn from(param: UncheckedSetParam) -> Self { - match param { - UncheckedSetParam::Id(value) => Self::SetId(value), - UncheckedSetParam::GenreId(value) => Self::SetGenreId(value), - UncheckedSetParam::BookId(value) => Self::SetBookId(value), - } - } - } - #[derive(Clone)] - pub enum OrderByParam { - Id(::prisma_client_rust::Direction), - GenreId(::prisma_client_rust::Direction), - BookId(::prisma_client_rust::Direction), - } - impl Into<(String, ::prisma_client_rust::PrismaValue)> for OrderByParam { - fn into(self) -> (String, ::prisma_client_rust::PrismaValue) { - match self { - Self::Id(direction) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(direction.to_string()), - ), - Self::GenreId(direction) => ( - genre_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(direction.to_string()), - ), - Self::BookId(direction) => ( - book_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(direction.to_string()), - ), - } - } - } - #[derive(Clone)] - pub enum WhereParam { - Not(Vec), - Or(Vec), - And(Vec), - BookIdGenreIdEquals(i32, i32), - Id(_prisma::read_filters::IntFilter), - GenreId(_prisma::read_filters::IntFilter), - BookId(_prisma::read_filters::IntFilter), - BookIs(Vec), - BookIsNot(Vec), - GenreIs(Vec), - GenreIsNot(Vec), - } - impl ::prisma_client_rust::WhereInput for WhereParam { - fn serialize(self) -> ::prisma_client_rust::SerializedWhereInput { - let (name, value) = match self { - Self::Not(value) => ( - "NOT", - ::prisma_client_rust::SerializedWhereValue::Object( - ::prisma_client_rust::merge_fields( - value - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(Into::into) - .collect(), - ), - ), - ), - Self::Or(value) => ( - "OR", - ::prisma_client_rust::SerializedWhereValue::List( - value - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(Into::into) - .map(|v| vec![v]) - .map(::prisma_client_rust::PrismaValue::Object) - .collect(), - ), - ), - Self::And(value) => ( - "AND", - ::prisma_client_rust::SerializedWhereValue::Object( - ::prisma_client_rust::merge_fields( - value - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(Into::into) - .collect(), - ), - ), - ), - Self::BookIdGenreIdEquals(book_id, genre_id) => ( - "book_id_genre_id", - ::prisma_client_rust::SerializedWhereValue::Object(vec![ - ( - book_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Int(book_id as i64), - ), - ( - genre_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Int(genre_id as i64), - ), - ]), - ), - Self::Id(value) => (id::NAME, value.into()), - Self::GenreId(value) => (genre_id::NAME, value.into()), - Self::BookId(value) => (book_id::NAME, value.into()), - Self::BookIs(where_params) => ( - book::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "is".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::BookIsNot(where_params) => ( - book::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "isNot".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::GenreIs(where_params) => ( - genre::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "is".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::GenreIsNot(where_params) => ( - genre::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "isNot".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - }; - ::prisma_client_rust::SerializedWhereInput::new(name, value.into()) - } - } - #[derive(Clone)] - pub enum UniqueWhereParam { - BookIdGenreIdEquals(i32, i32), - IdEquals(i32), - } - impl From for WhereParam { - fn from(value: UniqueWhereParam) -> Self { - match value { - UniqueWhereParam::BookIdGenreIdEquals(book_id, genre_id) => { - Self::BookIdGenreIdEquals(book_id, genre_id) - } - UniqueWhereParam::IdEquals(value) => { - Self::Id(_prisma::read_filters::IntFilter::Equals(value)) - } - } - } - } - impl From<::prisma_client_rust::Operator> for WhereParam { - fn from(op: ::prisma_client_rust::Operator) -> Self { - match op { - ::prisma_client_rust::Operator::Not(value) => Self::Not(value), - ::prisma_client_rust::Operator::And(value) => Self::And(value), - ::prisma_client_rust::Operator::Or(value) => Self::Or(value), - } - } - } - #[derive(Clone)] - pub struct Types; - impl ::prisma_client_rust::ModelTypes for Types { - type Data = Data; - type Where = WhereParam; - type UncheckedSet = UncheckedSetParam; - type Set = SetParam; - type With = WithParam; - type OrderBy = OrderByParam; - type Cursor = UniqueWhereParam; - const MODEL: &'static str = NAME; - fn scalar_selections() -> Vec<::prisma_client_rust::Selection> { - vec![ - ::prisma_client_rust::sel(id::NAME), - ::prisma_client_rust::sel(genre_id::NAME), - ::prisma_client_rust::sel(book_id::NAME), - ] - } - } - pub type UniqueArgs = ::prisma_client_rust::UniqueArgs; - pub type ManyArgs = ::prisma_client_rust::ManyArgs; - pub type Count<'a> = ::prisma_client_rust::Count<'a, Types>; - pub type Create<'a> = ::prisma_client_rust::Create<'a, Types>; - pub type CreateMany<'a> = ::prisma_client_rust::CreateMany<'a, Types>; - pub type FindUnique<'a> = ::prisma_client_rust::FindUnique<'a, Types>; - pub type FindMany<'a> = ::prisma_client_rust::FindMany<'a, Types>; - pub type FindFirst<'a> = ::prisma_client_rust::FindFirst<'a, Types>; - pub type Update<'a> = ::prisma_client_rust::Update<'a, Types>; - pub type UpdateMany<'a> = ::prisma_client_rust::UpdateMany<'a, Types>; - pub type Upsert<'a> = ::prisma_client_rust::Upsert<'a, Types>; - pub type Delete<'a> = ::prisma_client_rust::Delete<'a, Types>; - pub type DeleteMany<'a> = ::prisma_client_rust::DeleteMany<'a, Types>; - #[derive(Clone)] - pub struct Actions<'a> { - pub client: &'a ::prisma_client_rust::PrismaClientInternals, - } - impl<'a> Actions<'a> { - pub fn find_unique(self, _where: UniqueWhereParam) -> FindUnique<'a> { - FindUnique::new(self.client, _where.into()) - } - pub fn find_first(self, _where: Vec) -> FindFirst<'a> { - FindFirst::new(self.client, _where) - } - pub fn find_many(self, _where: Vec) -> FindMany<'a> { - FindMany::new(self.client, _where) - } - pub fn create( - self, - book: super::book::UniqueWhereParam, - genre: super::genre::UniqueWhereParam, - mut _params: Vec, - ) -> Create<'a> { - _params.extend([book::connect(book), genre::connect(genre)]); - Create::new(self.client, _params) - } - pub fn create_unchecked( - self, - genre_id: i32, - book_id: i32, - mut _params: Vec, - ) -> Create<'a> { - _params.extend([genre_id::set(genre_id), book_id::set(book_id)]); - Create::new(self.client, _params.into_iter().map(Into::into).collect()) - } - pub fn create_many(self, data: Vec<(i32, i32, Vec)>) -> CreateMany<'a> { - let data = data - .into_iter() - .map(|(genre_id, book_id, mut _params)| { - _params.extend([genre_id::set(genre_id), book_id::set(book_id)]); - _params - }) - .collect(); - CreateMany::new(self.client, data) - } - pub fn update(self, _where: UniqueWhereParam, _params: Vec) -> Update<'a> { - Update::new(self.client, _where.into(), _params, vec![]) - } - pub fn update_unchecked( - self, - _where: UniqueWhereParam, - _params: Vec, - ) -> Update<'a> { - Update::new( - self.client, - _where.into(), - _params.into_iter().map(Into::into).collect(), - vec![], - ) - } - pub fn update_many( - self, - _where: Vec, - _params: Vec, - ) -> UpdateMany<'a> { - UpdateMany::new(self.client, _where, _params) - } - pub fn upsert( - self, - _where: UniqueWhereParam, - (book, genre, mut _params): ( - super::book::UniqueWhereParam, - super::genre::UniqueWhereParam, - Vec, - ), - _update: Vec, - ) -> Upsert<'a> { - _params.extend([book::connect(book), genre::connect(genre)]); - Upsert::new(self.client, _where.into(), _params, _update) - } - pub fn delete(self, _where: UniqueWhereParam) -> Delete<'a> { - Delete::new(self.client, _where.into(), vec![]) - } - pub fn delete_many(self, _where: Vec) -> DeleteMany<'a> { - DeleteMany::new(self.client, _where) - } - pub fn count(self, _where: Vec) -> Count<'a> { - Count::new(self.client, _where) - } - } -} -pub mod book_sequence { - - use super::*; - pub const NAME: &str = "BookSequence"; - pub mod id { - use super::super::*; - - use super::{OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam}; - pub const NAME: &str = "id"; - pub struct Set(pub i32); - impl From for SetParam { - fn from(Set(v): Set) -> Self { - Self::SetId(v) - } - } - impl From for UncheckedSetParam { - fn from(Set(v): Set) -> Self { - Self::Id(v) - } - } - pub fn set>(value: i32) -> T { - Set(value).into() - } - pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { - OrderByParam::Id(direction) - } - pub fn equals>(value: i32) -> T { - UniqueWhereParam::IdEquals(value).into() - } - ::prisma_client_rust::scalar_where_param_fns!(_prisma::read_filters::IntFilter, Id, { - fn in_vec(_: Vec) -> InVec; - fn not_in_vec(_: Vec) -> NotInVec; - fn lt(_: i32) -> Lt; - fn lte(_: i32) -> Lte; - fn gt(_: i32) -> Gt; - fn gte(_: i32) -> Gte; - fn not(_: i32) -> Not; - }); - pub fn increment(value: i32) -> SetParam { - SetParam::IncrementId(value) - } - pub fn decrement(value: i32) -> SetParam { - SetParam::DecrementId(value) - } - pub fn multiply(value: i32) -> SetParam { - SetParam::MultiplyId(value) - } - pub fn divide(value: i32) -> SetParam { - SetParam::DivideId(value) - } - pub struct Include; - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::Id(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - pub struct Select; - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::Id(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - } - pub mod position { - use super::super::*; - - use super::{OrderByParam, SetParam, UncheckedSetParam, WhereParam}; - pub const NAME: &str = "position"; - pub struct Set(pub i32); - impl From for SetParam { - fn from(Set(v): Set) -> Self { - Self::SetPosition(v) - } - } - impl From for UncheckedSetParam { - fn from(Set(v): Set) -> Self { - Self::Position(v) - } - } - pub fn set>(value: i32) -> T { - Set(value).into() - } - pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { - OrderByParam::Position(direction) - } - pub fn equals(value: i32) -> WhereParam { - WhereParam::Position(_prisma::read_filters::IntFilter::Equals(value)) - } - ::prisma_client_rust::scalar_where_param_fns!( - _prisma::read_filters::IntFilter, - Position, - { - fn in_vec(_: Vec) -> InVec; - fn not_in_vec(_: Vec) -> NotInVec; - fn lt(_: i32) -> Lt; - fn lte(_: i32) -> Lte; - fn gt(_: i32) -> Gt; - fn gte(_: i32) -> Gte; - fn not(_: i32) -> Not; - } - ); - pub fn increment(value: i32) -> SetParam { - SetParam::IncrementPosition(value) - } - pub fn decrement(value: i32) -> SetParam { - SetParam::DecrementPosition(value) - } - pub fn multiply(value: i32) -> SetParam { - SetParam::MultiplyPosition(value) - } - pub fn divide(value: i32) -> SetParam { - SetParam::DividePosition(value) - } - pub struct Include; - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::Position(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - pub struct Select; - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::Position(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - } - pub mod sequence_id { - use super::super::*; - - use super::{OrderByParam, SetParam, UncheckedSetParam, WhereParam}; - pub const NAME: &str = "sequence_id"; - pub struct Set(pub i32); - impl From for SetParam { - fn from(Set(v): Set) -> Self { - Self::SetSequenceId(v) - } - } - impl From for UncheckedSetParam { - fn from(Set(v): Set) -> Self { - Self::SequenceId(v) - } - } - pub fn set>(value: i32) -> T { - Set(value).into() - } - pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { - OrderByParam::SequenceId(direction) - } - pub fn equals(value: i32) -> WhereParam { - WhereParam::SequenceId(_prisma::read_filters::IntFilter::Equals(value)) - } - ::prisma_client_rust::scalar_where_param_fns!( - _prisma::read_filters::IntFilter, - SequenceId, - { - fn in_vec(_: Vec) -> InVec; - fn not_in_vec(_: Vec) -> NotInVec; - fn lt(_: i32) -> Lt; - fn lte(_: i32) -> Lte; - fn gt(_: i32) -> Gt; - fn gte(_: i32) -> Gte; - fn not(_: i32) -> Not; - } - ); - pub fn increment(value: i32) -> SetParam { - SetParam::IncrementSequenceId(value) - } - pub fn decrement(value: i32) -> SetParam { - SetParam::DecrementSequenceId(value) - } - pub fn multiply(value: i32) -> SetParam { - SetParam::MultiplySequenceId(value) - } - pub fn divide(value: i32) -> SetParam { - SetParam::DivideSequenceId(value) - } - pub struct Include; - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::SequenceId(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - pub struct Select; - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::SequenceId(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - } - pub mod book_id { - use super::super::*; - - use super::{OrderByParam, SetParam, UncheckedSetParam, WhereParam}; - pub const NAME: &str = "book_id"; - pub struct Set(pub i32); - impl From for SetParam { - fn from(Set(v): Set) -> Self { - Self::SetBookId(v) - } - } - impl From for UncheckedSetParam { - fn from(Set(v): Set) -> Self { - Self::BookId(v) - } - } - pub fn set>(value: i32) -> T { - Set(value).into() - } - pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { - OrderByParam::BookId(direction) - } - pub fn equals(value: i32) -> WhereParam { - WhereParam::BookId(_prisma::read_filters::IntFilter::Equals(value)) - } - ::prisma_client_rust::scalar_where_param_fns!(_prisma::read_filters::IntFilter, BookId, { - fn in_vec(_: Vec) -> InVec; - fn not_in_vec(_: Vec) -> NotInVec; - fn lt(_: i32) -> Lt; - fn lte(_: i32) -> Lte; - fn gt(_: i32) -> Gt; - fn gte(_: i32) -> Gte; - fn not(_: i32) -> Not; - }); - pub fn increment(value: i32) -> SetParam { - SetParam::IncrementBookId(value) - } - pub fn decrement(value: i32) -> SetParam { - SetParam::DecrementBookId(value) - } - pub fn multiply(value: i32) -> SetParam { - SetParam::MultiplyBookId(value) - } - pub fn divide(value: i32) -> SetParam { - SetParam::DivideBookId(value) - } - pub struct Include; - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::BookId(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - pub struct Select; - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::BookId(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - } - pub mod book { - use super::super::*; - - use super::{SetParam, WhereParam, WithParam}; - pub const NAME: &str = "book"; - pub struct Fetch(pub book::UniqueArgs); - impl Fetch { - pub fn with(mut self, params: impl Into) -> Self { - self.0 = self.0.with(params.into()); - self - } - } - impl From for WithParam { - fn from(Fetch(v): Fetch) -> Self { - WithParam::Book(v) - } - } - pub fn fetch() -> Fetch { - Fetch(book::UniqueArgs::new()) - } - pub struct Connect(book::UniqueWhereParam); - impl From for SetParam { - fn from(Connect(v): Connect) -> Self { - Self::ConnectBook(v) - } - } - pub fn connect>(value: book::UniqueWhereParam) -> T { - Connect(value).into() - } - pub fn is(value: Vec) -> WhereParam { - WhereParam::BookIs(value) - } - pub fn is_not(value: Vec) -> WhereParam { - WhereParam::BookIsNot(value) - } - pub enum Include { - Select(Vec), - Include(Vec), - Fetch, - } - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::Book(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let selections = match self { - Self::Select(selections) => { - selections.into_iter().map(|s| s.to_selection()).collect() - } - Self::Include(selections) => { - let mut nested_selections = - ::scalar_selections(); - nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); - nested_selections - } - Self::Fetch => { - ::scalar_selections() - } - }; - ::prisma_client_rust::Selection::new("book", None, [], selections) - } - pub fn select(nested_selections: Vec) -> Self { - Self::Select(nested_selections) - } - pub fn include(nested_selections: Vec) -> Self { - Self::Include(nested_selections) - } - } - pub enum Select { - Select(Vec), - Include(Vec), - Fetch, - } - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::Book(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let selections = match self { - Self::Select(selections) => { - selections.into_iter().map(|s| s.to_selection()).collect() - } - Self::Include(selections) => { - let mut nested_selections = vec![]; - nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); - nested_selections - } - Self::Fetch => { - ::scalar_selections() - } - }; - ::prisma_client_rust::Selection::new("book", None, [], selections) - } - pub fn select(nested_selections: Vec) -> Self { - Self::Select(nested_selections) - } - pub fn include(nested_selections: Vec) -> Self { - Self::Include(nested_selections) - } - } - } - pub mod sequence { - use super::super::*; - - use super::{SetParam, WhereParam, WithParam}; - pub const NAME: &str = "sequence"; - pub struct Fetch(pub sequence::UniqueArgs); - impl Fetch { - pub fn with(mut self, params: impl Into) -> Self { - self.0 = self.0.with(params.into()); - self - } - } - impl From for WithParam { - fn from(Fetch(v): Fetch) -> Self { - WithParam::Sequence(v) - } - } - pub fn fetch() -> Fetch { - Fetch(sequence::UniqueArgs::new()) - } - pub struct Connect(sequence::UniqueWhereParam); - impl From for SetParam { - fn from(Connect(v): Connect) -> Self { - Self::ConnectSequence(v) - } - } - pub fn connect>(value: sequence::UniqueWhereParam) -> T { - Connect(value).into() - } - pub fn is(value: Vec) -> WhereParam { - WhereParam::SequenceIs(value) - } - pub fn is_not(value: Vec) -> WhereParam { - WhereParam::SequenceIsNot(value) - } - pub enum Include { - Select(Vec), - Include(Vec), - Fetch, - } - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::Sequence(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let selections = match self { - Self::Select(selections) => { - selections.into_iter().map(|s| s.to_selection()).collect() - } - Self::Include(selections) => { - let mut nested_selections = < sequence :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; - nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); - nested_selections - } - Self::Fetch => { - ::scalar_selections() - } - }; - ::prisma_client_rust::Selection::new("sequence", None, [], selections) - } - pub fn select(nested_selections: Vec) -> Self { - Self::Select(nested_selections) - } - pub fn include(nested_selections: Vec) -> Self { - Self::Include(nested_selections) - } - } - pub enum Select { - Select(Vec), - Include(Vec), - Fetch, - } - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::Sequence(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let selections = match self { - Self::Select(selections) => { - selections.into_iter().map(|s| s.to_selection()).collect() - } - Self::Include(selections) => { - let mut nested_selections = vec![]; - nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); - nested_selections - } - Self::Fetch => { - ::scalar_selections() - } - }; - ::prisma_client_rust::Selection::new("sequence", None, [], selections) - } - pub fn select(nested_selections: Vec) -> Self { - Self::Select(nested_selections) - } - pub fn include(nested_selections: Vec) -> Self { - Self::Include(nested_selections) - } - } - } - pub fn book_id_sequence_id>(book_id: i32, sequence_id: i32) -> T { - UniqueWhereParam::BookIdSequenceIdEquals(book_id, sequence_id).into() - } - pub fn create( - position: i32, - book: super::book::UniqueWhereParam, - sequence: super::sequence::UniqueWhereParam, - _params: Vec, - ) -> ( - i32, - super::book::UniqueWhereParam, - super::sequence::UniqueWhereParam, - Vec, - ) { - (position, book, sequence, _params) - } - pub fn create_unchecked( - position: i32, - sequence_id: i32, - book_id: i32, - _params: Vec, - ) -> (i32, i32, i32, Vec) { - (position, sequence_id, book_id, _params) - } - #[macro_export] - macro_rules ! _select_book_sequence { ($ (($ ($ func_arg : ident : $ func_arg_ty : ty) , +) =>) ? $ module_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { # [allow (warnings)] pub mod $ module_name { crate :: prisma :: book_sequence :: select ! (@ definitions ; $ module_name ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; use super :: * ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: SelectType for Selection { type Data = Data ; type ModelData = crate :: prisma :: book_sequence :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn select ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: book_sequence :: select ! (@ selections_to_params ; : select { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () ,] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } } ; ({ $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { { crate :: prisma :: book_sequence :: select ! (@ definitions ; ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: SelectType for Selection { type Data = Data ; type ModelData = crate :: prisma :: book_sequence :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: book_sequence :: select ! (@ selections_to_params ; : select { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () ,] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } ; (@ definitions ; $ ($ module_name : ident) ? ; $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) +) => { # [allow (warnings)] enum Fields { id , position , sequence_id , book_id , book , sequence } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] pub struct Data { $ (pub $ field : crate :: prisma :: book_sequence :: select ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } impl :: serde :: Serialize for Data { fn serialize < S > (& self , serializer : S) -> Result < S :: Ok , S :: Error > where S : :: serde :: Serializer , { use :: serde :: ser :: SerializeStruct ; let mut state = serializer . serialize_struct ("Data" , [$ (stringify ! ($ field) ,) +] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: book_sequence :: $ field :: NAME , & self . $ field) ? ;) * state . end () } } impl < 'de > :: serde :: Deserialize < 'de > for Data { fn deserialize < D > (deserializer : D) -> Result < Self , D :: Error > where D : :: serde :: Deserializer < 'de > , { # [allow (warnings)] enum Field { $ ($ field) , + , } impl < 'de > :: serde :: Deserialize < 'de > for Field { fn deserialize < D > (deserializer : D) -> Result < Field , D :: Error > where D : :: serde :: Deserializer < 'de > , { struct FieldVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for FieldVisitor { type Value = Field ; fn expecting (& self , formatter : & mut :: std :: fmt :: Formatter) -> :: std :: fmt :: Result { formatter . write_str (& [$ (crate :: prisma :: book_sequence :: $ field :: NAME) , + ,] . into_iter () . collect :: < Vec < _ >> () . join (", ")) } fn visit_str < E > (self , value : & str) -> Result < Field , E > where E : :: serde :: de :: Error , { match value { $ (crate :: prisma :: book_sequence :: $ field :: NAME => Ok (Field :: $ field)) , * , _ => Err (:: serde :: de :: Error :: unknown_field (value , FIELDS)) , } } } deserializer . deserialize_identifier (FieldVisitor) } } struct DataVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for DataVisitor { type Value = Data ; fn expecting (& self , formatter : & mut std :: fmt :: Formatter) -> std :: fmt :: Result { formatter . write_str ("struct Data") } fn visit_map < V > (self , mut map : V) -> Result < Data , V :: Error > where V : :: serde :: de :: MapAccess < 'de > , { $ (let mut $ field = None ;) * while let Some (key) = map . next_key () ? { match key { $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: book_sequence :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: book_sequence :: $ field :: NAME)) ? ;) * Ok (Data { $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "position" , "sequence_id" , "book_id" , "book" , "sequence"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: book_sequence :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; id) => { i32 } ; (@ field_type ; position) => { i32 } ; (@ field_type ; sequence_id) => { i32 } ; (@ field_type ; book_id) => { i32 } ; (@ field_type ; book : $ selection_mode : ident { $ ($ selections : tt) + }) => { book :: Data } ; (@ field_type ; book) => { crate :: prisma :: book :: Data } ; (@ field_type ; sequence : $ selection_mode : ident { $ ($ selections : tt) + }) => { sequence :: Data } ; (@ field_type ; sequence) => { crate :: prisma :: sequence :: Data } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "BookSequence" , available relations are "id, position, sequence_id, book_id, book, sequence")) } ; (@ field_module ; book : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: book :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; sequence : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: sequence :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; id) => { Into :: < crate :: prisma :: book_sequence :: SelectParam > :: into (crate :: prisma :: book_sequence :: id :: Select) } ; (@ selection_field_to_selection_param ; position) => { Into :: < crate :: prisma :: book_sequence :: SelectParam > :: into (crate :: prisma :: book_sequence :: position :: Select) } ; (@ selection_field_to_selection_param ; sequence_id) => { Into :: < crate :: prisma :: book_sequence :: SelectParam > :: into (crate :: prisma :: book_sequence :: sequence_id :: Select) } ; (@ selection_field_to_selection_param ; book_id) => { Into :: < crate :: prisma :: book_sequence :: SelectParam > :: into (crate :: prisma :: book_sequence :: book_id :: Select) } ; (@ selection_field_to_selection_param ; book $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: book_sequence :: SelectParam > :: into (crate :: prisma :: book_sequence :: book :: Select :: $ selection_mode (crate :: prisma :: book :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; book $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: book_sequence :: SelectParam > :: into (crate :: prisma :: book_sequence :: book :: Select :: Fetch) } } ; (@ selection_field_to_selection_param ; sequence $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: book_sequence :: SelectParam > :: into (crate :: prisma :: book_sequence :: sequence :: Select :: $ selection_mode (crate :: prisma :: sequence :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; sequence $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: book_sequence :: SelectParam > :: into (crate :: prisma :: book_sequence :: sequence :: Select :: Fetch) } } ; (@ selection_field_to_selection_param ; $ ($ tokens : tt) *) => { compile_error ! (stringify ! ($ ($ tokens) *)) } ; (@ selections_to_params ; : $ macro_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { [$ (crate :: prisma :: book_sequence :: $ macro_name ! (@ selection_field_to_selection_param ; $ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) ,) +] } ; (@ filters_to_args ;) => { vec ! [] } ; (@ filters_to_args ; $ ($ t : tt) *) => { $ ($ t) * } ; (@ field_serde_name ; id) => { "id" } ; (@ field_serde_name ; position) => { "position" } ; (@ field_serde_name ; sequence_id) => { "sequence_id" } ; (@ field_serde_name ; book_id) => { "book_id" } ; (@ field_serde_name ; book) => { "book" } ; (@ field_serde_name ; sequence) => { "sequence" } ; } - pub use _select_book_sequence as select; - pub enum SelectParam { - Id(id::Select), - Position(position::Select), - SequenceId(sequence_id::Select), - BookId(book_id::Select), - Book(book::Select), - Sequence(sequence::Select), - } - impl SelectParam { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - match self { - Self::Id(data) => data.to_selection(), - Self::Position(data) => data.to_selection(), - Self::SequenceId(data) => data.to_selection(), - Self::BookId(data) => data.to_selection(), - Self::Book(data) => data.to_selection(), - Self::Sequence(data) => data.to_selection(), - } - } - } - #[macro_export] - macro_rules ! _include_book_sequence { ($ (($ ($ func_arg : ident : $ func_arg_ty : ty) , +) =>) ? $ module_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { # [allow (warnings)] pub mod $ module_name { crate :: prisma :: book_sequence :: include ! (@ definitions ; $ module_name ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; use super :: * ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: IncludeType for Selection { type Data = Data ; type ModelData = crate :: prisma :: book_sequence :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn include ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: book_sequence :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: book_sequence :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } } ; ({ $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { { crate :: prisma :: book_sequence :: include ! (@ definitions ; ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: IncludeType for Selection { type Data = Data ; type ModelData = crate :: prisma :: book_sequence :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: book_sequence :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: book_sequence :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } ; (@ definitions ; $ ($ module_name : ident) ? ; $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) +) => { # [allow (warnings)] enum Fields { book , sequence } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] pub struct Data { pub id : i32 , pub position : i32 , pub sequence_id : i32 , pub book_id : i32 , $ (pub $ field : crate :: prisma :: book_sequence :: include ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } impl :: serde :: Serialize for Data { fn serialize < S > (& self , serializer : S) -> Result < S :: Ok , S :: Error > where S : :: serde :: Serializer , { use :: serde :: ser :: SerializeStruct ; let mut state = serializer . serialize_struct ("Data" , [$ (stringify ! ($ field) ,) + stringify ! (id) , stringify ! (position) , stringify ! (sequence_id) , stringify ! (book_id)] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: book_sequence :: $ field :: NAME , & self . $ field) ? ;) * state . serialize_field (crate :: prisma :: book_sequence :: id :: NAME , & self . id) ? ; state . serialize_field (crate :: prisma :: book_sequence :: position :: NAME , & self . position) ? ; state . serialize_field (crate :: prisma :: book_sequence :: sequence_id :: NAME , & self . sequence_id) ? ; state . serialize_field (crate :: prisma :: book_sequence :: book_id :: NAME , & self . book_id) ? ; state . end () } } impl < 'de > :: serde :: Deserialize < 'de > for Data { fn deserialize < D > (deserializer : D) -> Result < Self , D :: Error > where D : :: serde :: Deserializer < 'de > , { # [allow (warnings)] enum Field { $ ($ field) , + , id , position , sequence_id , book_id } impl < 'de > :: serde :: Deserialize < 'de > for Field { fn deserialize < D > (deserializer : D) -> Result < Field , D :: Error > where D : :: serde :: Deserializer < 'de > , { struct FieldVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for FieldVisitor { type Value = Field ; fn expecting (& self , formatter : & mut :: std :: fmt :: Formatter) -> :: std :: fmt :: Result { formatter . write_str (& [$ (crate :: prisma :: book_sequence :: $ field :: NAME) , + , crate :: prisma :: book_sequence :: id :: NAME , crate :: prisma :: book_sequence :: position :: NAME , crate :: prisma :: book_sequence :: sequence_id :: NAME , crate :: prisma :: book_sequence :: book_id :: NAME] . into_iter () . collect :: < Vec < _ >> () . join (", ")) } fn visit_str < E > (self , value : & str) -> Result < Field , E > where E : :: serde :: de :: Error , { match value { $ (crate :: prisma :: book_sequence :: $ field :: NAME => Ok (Field :: $ field)) , * , crate :: prisma :: book_sequence :: id :: NAME => Ok (Field :: id) , crate :: prisma :: book_sequence :: position :: NAME => Ok (Field :: position) , crate :: prisma :: book_sequence :: sequence_id :: NAME => Ok (Field :: sequence_id) , crate :: prisma :: book_sequence :: book_id :: NAME => Ok (Field :: book_id) , _ => Err (:: serde :: de :: Error :: unknown_field (value , FIELDS)) , } } } deserializer . deserialize_identifier (FieldVisitor) } } struct DataVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for DataVisitor { type Value = Data ; fn expecting (& self , formatter : & mut std :: fmt :: Formatter) -> std :: fmt :: Result { formatter . write_str ("struct Data") } fn visit_map < V > (self , mut map : V) -> Result < Data , V :: Error > where V : :: serde :: de :: MapAccess < 'de > , { $ (let mut $ field = None ;) * let mut id = None ; let mut position = None ; let mut sequence_id = None ; let mut book_id = None ; while let Some (key) = map . next_key () ? { match key { Field :: id => { if id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: book_sequence :: id :: NAME)) ; } id = Some (map . next_value () ?) ; } Field :: position => { if position . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: book_sequence :: position :: NAME)) ; } position = Some (map . next_value () ?) ; } Field :: sequence_id => { if sequence_id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: book_sequence :: sequence_id :: NAME)) ; } sequence_id = Some (map . next_value () ?) ; } Field :: book_id => { if book_id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: book_sequence :: book_id :: NAME)) ; } book_id = Some (map . next_value () ?) ; } $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: book_sequence :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: book_sequence :: $ field :: NAME)) ? ;) * let id = id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: book_sequence :: id :: NAME)) ? ; let position = position . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: book_sequence :: position :: NAME)) ? ; let sequence_id = sequence_id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: book_sequence :: sequence_id :: NAME)) ? ; let book_id = book_id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: book_sequence :: book_id :: NAME)) ? ; Ok (Data { id , position , sequence_id , book_id , $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "position" , "sequence_id" , "book_id" , "book" , "sequence"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: book_sequence :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; book : $ selection_mode : ident { $ ($ selections : tt) + }) => { book :: Data } ; (@ field_type ; book) => { crate :: prisma :: book :: Data } ; (@ field_type ; sequence : $ selection_mode : ident { $ ($ selections : tt) + }) => { sequence :: Data } ; (@ field_type ; sequence) => { crate :: prisma :: sequence :: Data } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "BookSequence" , available relations are "book, sequence")) } ; (@ field_module ; book : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: book :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; sequence : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: sequence :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; book $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: book_sequence :: IncludeParam > :: into (crate :: prisma :: book_sequence :: book :: Include :: $ selection_mode (crate :: prisma :: book :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; book $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: book_sequence :: IncludeParam > :: into (crate :: prisma :: book_sequence :: book :: Include :: Fetch) } } ; (@ selection_field_to_selection_param ; sequence $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: book_sequence :: IncludeParam > :: into (crate :: prisma :: book_sequence :: sequence :: Include :: $ selection_mode (crate :: prisma :: sequence :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; sequence $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: book_sequence :: IncludeParam > :: into (crate :: prisma :: book_sequence :: sequence :: Include :: Fetch) } } ; (@ selection_field_to_selection_param ; $ ($ tokens : tt) *) => { compile_error ! (stringify ! ($ ($ tokens) *)) } ; (@ selections_to_params ; : $ macro_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { [$ (crate :: prisma :: book_sequence :: $ macro_name ! (@ selection_field_to_selection_param ; $ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) ,) +] } ; (@ filters_to_args ;) => { vec ! [] } ; (@ filters_to_args ; $ ($ t : tt) *) => { $ ($ t) * } ; (@ field_serde_name ; id) => { "id" } ; (@ field_serde_name ; position) => { "position" } ; (@ field_serde_name ; sequence_id) => { "sequence_id" } ; (@ field_serde_name ; book_id) => { "book_id" } ; (@ field_serde_name ; book) => { "book" } ; (@ field_serde_name ; sequence) => { "sequence" } ; } - pub use _include_book_sequence as include; - pub enum IncludeParam { - Id(id::Include), - Position(position::Include), - SequenceId(sequence_id::Include), - BookId(book_id::Include), - Book(book::Include), - Sequence(sequence::Include), - } - impl IncludeParam { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - match self { - Self::Id(data) => data.to_selection(), - Self::Position(data) => data.to_selection(), - Self::SequenceId(data) => data.to_selection(), - Self::BookId(data) => data.to_selection(), - Self::Book(data) => data.to_selection(), - Self::Sequence(data) => data.to_selection(), - } - } - } - #[macro_export] - macro_rules ! _partial_unchecked_book_sequence { ($ struct_name : ident { $ ($ scalar_field : ident) + }) => { :: prisma_client_rust :: macros :: partial_unchecked ! { crate :: prisma :: book_sequence struct $ struct_name { # [serde (rename = "id")] pub id : i32 , # [serde (rename = "position")] pub position : i32 , # [serde (rename = "sequence_id")] pub sequence_id : i32 , # [serde (rename = "book_id")] pub book_id : i32 } [$ ($ scalar_field) , +] } } ; } - pub use _partial_unchecked_book_sequence as partial_unchecked; - #[derive(Debug, Clone, :: serde :: Serialize, :: serde :: Deserialize)] - pub struct Data { - #[serde(rename = "id")] - pub id: i32, - #[serde(rename = "position")] - pub position: i32, - #[serde(rename = "sequence_id")] - pub sequence_id: i32, - #[serde(rename = "book_id")] - pub book_id: i32, - #[serde(rename = "book")] - pub book: Option>, - #[serde(rename = "sequence")] - pub sequence: Option>, - } - impl Data { - pub fn book( - &self, - ) -> Result<&super::book::Data, ::prisma_client_rust::RelationNotFetchedError> { - self.book - .as_ref() - .ok_or(::prisma_client_rust::RelationNotFetchedError::new( - stringify!(book), - )) - .map(|v| v.as_ref()) - } - pub fn sequence( - &self, - ) -> Result<&super::sequence::Data, ::prisma_client_rust::RelationNotFetchedError> { - self.sequence - .as_ref() - .ok_or(::prisma_client_rust::RelationNotFetchedError::new( - stringify!(sequence), - )) - .map(|v| v.as_ref()) - } - } - #[derive(Clone)] - pub enum WithParam { - Book(super::book::UniqueArgs), - Sequence(super::sequence::UniqueArgs), - } - impl Into<::prisma_client_rust::Selection> for WithParam { - fn into(self) -> ::prisma_client_rust::Selection { - match self { - Self::Book(args) => { - let mut selections = - ::scalar_selections( - ); - selections.extend( - args.with_params - .into_iter() - .map(Into::<::prisma_client_rust::Selection>::into), - ); - ::prisma_client_rust::Selection::new(book::NAME, None, [], selections) - } - Self::Sequence(args) => { - let mut selections = < super :: sequence :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; - selections.extend( - args.with_params - .into_iter() - .map(Into::<::prisma_client_rust::Selection>::into), - ); - ::prisma_client_rust::Selection::new(sequence::NAME, None, [], selections) - } - } - } - } - #[derive(Clone)] - pub enum SetParam { - SetId(i32), - IncrementId(i32), - DecrementId(i32), - MultiplyId(i32), - DivideId(i32), - SetPosition(i32), - IncrementPosition(i32), - DecrementPosition(i32), - MultiplyPosition(i32), - DividePosition(i32), - SetSequenceId(i32), - IncrementSequenceId(i32), - DecrementSequenceId(i32), - MultiplySequenceId(i32), - DivideSequenceId(i32), - SetBookId(i32), - IncrementBookId(i32), - DecrementBookId(i32), - MultiplyBookId(i32), - DivideBookId(i32), - ConnectBook(super::book::UniqueWhereParam), - ConnectSequence(super::sequence::UniqueWhereParam), - } - impl From for (String, ::prisma_client_rust::PrismaValue) { - fn from(param: SetParam) -> Self { - match param { - SetParam::SetId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - ), - SetParam::IncrementId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "increment".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DecrementId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "decrement".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::MultiplyId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "multiply".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DivideId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "divide".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::SetPosition(value) => ( - position::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - ), - SetParam::IncrementPosition(value) => ( - position::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "increment".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DecrementPosition(value) => ( - position::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "decrement".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::MultiplyPosition(value) => ( - position::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "multiply".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DividePosition(value) => ( - position::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "divide".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::SetSequenceId(value) => ( - sequence_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - ), - SetParam::IncrementSequenceId(value) => ( - sequence_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "increment".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DecrementSequenceId(value) => ( - sequence_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "decrement".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::MultiplySequenceId(value) => ( - sequence_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "multiply".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DivideSequenceId(value) => ( - sequence_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "divide".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::SetBookId(value) => ( - book_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - ), - SetParam::IncrementBookId(value) => ( - book_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "increment".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DecrementBookId(value) => ( - book_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "decrement".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::MultiplyBookId(value) => ( - book_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "multiply".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DivideBookId(value) => ( - book_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "divide".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::ConnectBook(where_param) => ( - book::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "connect".to_string(), - ::prisma_client_rust::PrismaValue::Object( - [where_param] - .into_iter() - .map(Into::::into) - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - SetParam::ConnectSequence(where_param) => ( - sequence::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "connect".to_string(), - ::prisma_client_rust::PrismaValue::Object( - [where_param] - .into_iter() - .map(Into::::into) - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - } - } - } - #[derive(Clone)] - pub enum UncheckedSetParam { - Id(i32), - Position(i32), - SequenceId(i32), - BookId(i32), - } - impl From for SetParam { - fn from(param: UncheckedSetParam) -> Self { - match param { - UncheckedSetParam::Id(value) => Self::SetId(value), - UncheckedSetParam::Position(value) => Self::SetPosition(value), - UncheckedSetParam::SequenceId(value) => Self::SetSequenceId(value), - UncheckedSetParam::BookId(value) => Self::SetBookId(value), - } - } - } - #[derive(Clone)] - pub enum OrderByParam { - Id(::prisma_client_rust::Direction), - Position(::prisma_client_rust::Direction), - SequenceId(::prisma_client_rust::Direction), - BookId(::prisma_client_rust::Direction), - } - impl Into<(String, ::prisma_client_rust::PrismaValue)> for OrderByParam { - fn into(self) -> (String, ::prisma_client_rust::PrismaValue) { - match self { - Self::Id(direction) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(direction.to_string()), - ), - Self::Position(direction) => ( - position::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(direction.to_string()), - ), - Self::SequenceId(direction) => ( - sequence_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(direction.to_string()), - ), - Self::BookId(direction) => ( - book_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(direction.to_string()), - ), - } - } - } - #[derive(Clone)] - pub enum WhereParam { - Not(Vec), - Or(Vec), - And(Vec), - BookIdSequenceIdEquals(i32, i32), - Id(_prisma::read_filters::IntFilter), - Position(_prisma::read_filters::IntFilter), - SequenceId(_prisma::read_filters::IntFilter), - BookId(_prisma::read_filters::IntFilter), - BookIs(Vec), - BookIsNot(Vec), - SequenceIs(Vec), - SequenceIsNot(Vec), - } - impl ::prisma_client_rust::WhereInput for WhereParam { - fn serialize(self) -> ::prisma_client_rust::SerializedWhereInput { - let (name, value) = match self { - Self::Not(value) => ( - "NOT", - ::prisma_client_rust::SerializedWhereValue::Object( - ::prisma_client_rust::merge_fields( - value - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(Into::into) - .collect(), - ), - ), - ), - Self::Or(value) => ( - "OR", - ::prisma_client_rust::SerializedWhereValue::List( - value - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(Into::into) - .map(|v| vec![v]) - .map(::prisma_client_rust::PrismaValue::Object) - .collect(), - ), - ), - Self::And(value) => ( - "AND", - ::prisma_client_rust::SerializedWhereValue::Object( - ::prisma_client_rust::merge_fields( - value - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(Into::into) - .collect(), - ), - ), - ), - Self::BookIdSequenceIdEquals(book_id, sequence_id) => ( - "book_id_sequence_id", - ::prisma_client_rust::SerializedWhereValue::Object(vec![ - ( - book_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Int(book_id as i64), - ), - ( - sequence_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Int(sequence_id as i64), - ), - ]), - ), - Self::Id(value) => (id::NAME, value.into()), - Self::Position(value) => (position::NAME, value.into()), - Self::SequenceId(value) => (sequence_id::NAME, value.into()), - Self::BookId(value) => (book_id::NAME, value.into()), - Self::BookIs(where_params) => ( - book::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "is".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::BookIsNot(where_params) => ( - book::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "isNot".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::SequenceIs(where_params) => ( - sequence::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "is".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::SequenceIsNot(where_params) => ( - sequence::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "isNot".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - }; - ::prisma_client_rust::SerializedWhereInput::new(name, value.into()) - } - } - #[derive(Clone)] - pub enum UniqueWhereParam { - BookIdSequenceIdEquals(i32, i32), - IdEquals(i32), - } - impl From for WhereParam { - fn from(value: UniqueWhereParam) -> Self { - match value { - UniqueWhereParam::BookIdSequenceIdEquals(book_id, sequence_id) => { - Self::BookIdSequenceIdEquals(book_id, sequence_id) - } - UniqueWhereParam::IdEquals(value) => { - Self::Id(_prisma::read_filters::IntFilter::Equals(value)) - } - } - } - } - impl From<::prisma_client_rust::Operator> for WhereParam { - fn from(op: ::prisma_client_rust::Operator) -> Self { - match op { - ::prisma_client_rust::Operator::Not(value) => Self::Not(value), - ::prisma_client_rust::Operator::And(value) => Self::And(value), - ::prisma_client_rust::Operator::Or(value) => Self::Or(value), - } - } - } - #[derive(Clone)] - pub struct Types; - impl ::prisma_client_rust::ModelTypes for Types { - type Data = Data; - type Where = WhereParam; - type UncheckedSet = UncheckedSetParam; - type Set = SetParam; - type With = WithParam; - type OrderBy = OrderByParam; - type Cursor = UniqueWhereParam; - const MODEL: &'static str = NAME; - fn scalar_selections() -> Vec<::prisma_client_rust::Selection> { - vec![ - ::prisma_client_rust::sel(id::NAME), - ::prisma_client_rust::sel(position::NAME), - ::prisma_client_rust::sel(sequence_id::NAME), - ::prisma_client_rust::sel(book_id::NAME), - ] - } - } - pub type UniqueArgs = ::prisma_client_rust::UniqueArgs; - pub type ManyArgs = ::prisma_client_rust::ManyArgs; - pub type Count<'a> = ::prisma_client_rust::Count<'a, Types>; - pub type Create<'a> = ::prisma_client_rust::Create<'a, Types>; - pub type CreateMany<'a> = ::prisma_client_rust::CreateMany<'a, Types>; - pub type FindUnique<'a> = ::prisma_client_rust::FindUnique<'a, Types>; - pub type FindMany<'a> = ::prisma_client_rust::FindMany<'a, Types>; - pub type FindFirst<'a> = ::prisma_client_rust::FindFirst<'a, Types>; - pub type Update<'a> = ::prisma_client_rust::Update<'a, Types>; - pub type UpdateMany<'a> = ::prisma_client_rust::UpdateMany<'a, Types>; - pub type Upsert<'a> = ::prisma_client_rust::Upsert<'a, Types>; - pub type Delete<'a> = ::prisma_client_rust::Delete<'a, Types>; - pub type DeleteMany<'a> = ::prisma_client_rust::DeleteMany<'a, Types>; - #[derive(Clone)] - pub struct Actions<'a> { - pub client: &'a ::prisma_client_rust::PrismaClientInternals, - } - impl<'a> Actions<'a> { - pub fn find_unique(self, _where: UniqueWhereParam) -> FindUnique<'a> { - FindUnique::new(self.client, _where.into()) - } - pub fn find_first(self, _where: Vec) -> FindFirst<'a> { - FindFirst::new(self.client, _where) - } - pub fn find_many(self, _where: Vec) -> FindMany<'a> { - FindMany::new(self.client, _where) - } - pub fn create( - self, - position: i32, - book: super::book::UniqueWhereParam, - sequence: super::sequence::UniqueWhereParam, - mut _params: Vec, - ) -> Create<'a> { - _params.extend([ - position::set(position), - book::connect(book), - sequence::connect(sequence), - ]); - Create::new(self.client, _params) - } - pub fn create_unchecked( - self, - position: i32, - sequence_id: i32, - book_id: i32, - mut _params: Vec, - ) -> Create<'a> { - _params.extend([ - position::set(position), - sequence_id::set(sequence_id), - book_id::set(book_id), - ]); - Create::new(self.client, _params.into_iter().map(Into::into).collect()) - } - pub fn create_many(self, data: Vec<(i32, i32, i32, Vec)>) -> CreateMany<'a> { - let data = data - .into_iter() - .map(|(position, sequence_id, book_id, mut _params)| { - _params.extend([ - position::set(position), - sequence_id::set(sequence_id), - book_id::set(book_id), - ]); - _params - }) - .collect(); - CreateMany::new(self.client, data) - } - pub fn update(self, _where: UniqueWhereParam, _params: Vec) -> Update<'a> { - Update::new(self.client, _where.into(), _params, vec![]) - } - pub fn update_unchecked( - self, - _where: UniqueWhereParam, - _params: Vec, - ) -> Update<'a> { - Update::new( - self.client, - _where.into(), - _params.into_iter().map(Into::into).collect(), - vec![], - ) - } - pub fn update_many( - self, - _where: Vec, - _params: Vec, - ) -> UpdateMany<'a> { - UpdateMany::new(self.client, _where, _params) - } - pub fn upsert( - self, - _where: UniqueWhereParam, - (position, book, sequence, mut _params): ( - i32, - super::book::UniqueWhereParam, - super::sequence::UniqueWhereParam, - Vec, - ), - _update: Vec, - ) -> Upsert<'a> { - _params.extend([ - position::set(position), - book::connect(book), - sequence::connect(sequence), - ]); - Upsert::new(self.client, _where.into(), _params, _update) - } - pub fn delete(self, _where: UniqueWhereParam) -> Delete<'a> { - Delete::new(self.client, _where.into(), vec![]) - } - pub fn delete_many(self, _where: Vec) -> DeleteMany<'a> { - DeleteMany::new(self.client, _where) - } - pub fn count(self, _where: Vec) -> Count<'a> { - Count::new(self.client, _where) - } - } -} -pub mod book { - - use super::*; - pub const NAME: &str = "Book"; - pub mod id { - use super::super::*; - - use super::{OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam}; - pub const NAME: &str = "id"; - pub struct Set(pub i32); - impl From for SetParam { - fn from(Set(v): Set) -> Self { - Self::SetId(v) - } - } - impl From for UncheckedSetParam { - fn from(Set(v): Set) -> Self { - Self::Id(v) - } - } - pub fn set>(value: i32) -> T { - Set(value).into() - } - pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { - OrderByParam::Id(direction) - } - pub fn equals>(value: i32) -> T { - UniqueWhereParam::IdEquals(value).into() - } - ::prisma_client_rust::scalar_where_param_fns!(_prisma::read_filters::IntFilter, Id, { - fn in_vec(_: Vec) -> InVec; - fn not_in_vec(_: Vec) -> NotInVec; - fn lt(_: i32) -> Lt; - fn lte(_: i32) -> Lte; - fn gt(_: i32) -> Gt; - fn gte(_: i32) -> Gte; - fn not(_: i32) -> Not; - }); - pub fn increment(value: i32) -> SetParam { - SetParam::IncrementId(value) - } - pub fn decrement(value: i32) -> SetParam { - SetParam::DecrementId(value) - } - pub fn multiply(value: i32) -> SetParam { - SetParam::MultiplyId(value) - } - pub fn divide(value: i32) -> SetParam { - SetParam::DivideId(value) - } - pub struct Include; - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::Id(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - pub struct Select; - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::Id(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - } - pub mod source_id { - use super::super::*; - - use super::{OrderByParam, SetParam, UncheckedSetParam, WhereParam}; - pub const NAME: &str = "source_id"; - pub struct Set(pub i32); - impl From for SetParam { - fn from(Set(v): Set) -> Self { - Self::SetSourceId(v) - } - } - impl From for UncheckedSetParam { - fn from(Set(v): Set) -> Self { - Self::SourceId(v) - } - } - pub fn set>(value: i32) -> T { - Set(value).into() - } - pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { - OrderByParam::SourceId(direction) - } - pub fn equals(value: i32) -> WhereParam { - WhereParam::SourceId(_prisma::read_filters::IntFilter::Equals(value)) - } - ::prisma_client_rust::scalar_where_param_fns!( - _prisma::read_filters::IntFilter, - SourceId, - { - fn in_vec(_: Vec) -> InVec; - fn not_in_vec(_: Vec) -> NotInVec; - fn lt(_: i32) -> Lt; - fn lte(_: i32) -> Lte; - fn gt(_: i32) -> Gt; - fn gte(_: i32) -> Gte; - fn not(_: i32) -> Not; - } - ); - pub fn increment(value: i32) -> SetParam { - SetParam::IncrementSourceId(value) - } - pub fn decrement(value: i32) -> SetParam { - SetParam::DecrementSourceId(value) - } - pub fn multiply(value: i32) -> SetParam { - SetParam::MultiplySourceId(value) - } - pub fn divide(value: i32) -> SetParam { - SetParam::DivideSourceId(value) - } - pub struct Include; - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::SourceId(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - pub struct Select; - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::SourceId(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - } - pub mod remote_id { - use super::super::*; - - use super::{OrderByParam, SetParam, UncheckedSetParam, WhereParam}; - pub const NAME: &str = "remote_id"; - pub struct Set(pub i32); - impl From for SetParam { - fn from(Set(v): Set) -> Self { - Self::SetRemoteId(v) - } - } - impl From for UncheckedSetParam { - fn from(Set(v): Set) -> Self { - Self::RemoteId(v) - } - } - pub fn set>(value: i32) -> T { - Set(value).into() - } - pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { - OrderByParam::RemoteId(direction) - } - pub fn equals(value: i32) -> WhereParam { - WhereParam::RemoteId(_prisma::read_filters::IntFilter::Equals(value)) - } - ::prisma_client_rust::scalar_where_param_fns!( - _prisma::read_filters::IntFilter, - RemoteId, - { - fn in_vec(_: Vec) -> InVec; - fn not_in_vec(_: Vec) -> NotInVec; - fn lt(_: i32) -> Lt; - fn lte(_: i32) -> Lte; - fn gt(_: i32) -> Gt; - fn gte(_: i32) -> Gte; - fn not(_: i32) -> Not; - } - ); - pub fn increment(value: i32) -> SetParam { - SetParam::IncrementRemoteId(value) - } - pub fn decrement(value: i32) -> SetParam { - SetParam::DecrementRemoteId(value) - } - pub fn multiply(value: i32) -> SetParam { - SetParam::MultiplyRemoteId(value) - } - pub fn divide(value: i32) -> SetParam { - SetParam::DivideRemoteId(value) - } - pub struct Include; - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::RemoteId(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - pub struct Select; - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::RemoteId(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - } - pub mod title { - use super::super::*; - - use super::{OrderByParam, SetParam, UncheckedSetParam, WhereParam}; - pub const NAME: &str = "title"; - pub struct Set(pub String); - impl From for SetParam { - fn from(Set(v): Set) -> Self { - Self::SetTitle(v) - } - } - impl From for UncheckedSetParam { - fn from(Set(v): Set) -> Self { - Self::Title(v) - } - } - pub fn set>(value: String) -> T { - Set(value).into() - } - pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { - OrderByParam::Title(direction) - } - pub fn equals(value: String) -> WhereParam { - WhereParam::Title(_prisma::read_filters::StringFilter::Equals(value)) - } - ::prisma_client_rust::scalar_where_param_fns!( - _prisma::read_filters::StringFilter, - Title, - { - fn in_vec(_: Vec) -> InVec; - fn not_in_vec(_: Vec) -> NotInVec; - fn lt(_: String) -> Lt; - fn lte(_: String) -> Lte; - fn gt(_: String) -> Gt; - fn gte(_: String) -> Gte; - fn contains(_: String) -> Contains; - fn starts_with(_: String) -> StartsWith; - fn ends_with(_: String) -> EndsWith; - fn mode(_: super::super::QueryMode) -> Mode; - fn not(_: String) -> Not; - } - ); - pub struct Include; - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::Title(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - pub struct Select; - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::Title(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - } - pub mod lang { - use super::super::*; - - use super::{OrderByParam, SetParam, UncheckedSetParam, WhereParam}; - pub const NAME: &str = "lang"; - pub struct Set(pub String); - impl From for SetParam { - fn from(Set(v): Set) -> Self { - Self::SetLang(v) - } - } - impl From for UncheckedSetParam { - fn from(Set(v): Set) -> Self { - Self::Lang(v) - } - } - pub fn set>(value: String) -> T { - Set(value).into() - } - pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { - OrderByParam::Lang(direction) - } - pub fn equals(value: String) -> WhereParam { - WhereParam::Lang(_prisma::read_filters::StringFilter::Equals(value)) - } - ::prisma_client_rust::scalar_where_param_fns!(_prisma::read_filters::StringFilter, Lang, { - fn in_vec(_: Vec) -> InVec; - fn not_in_vec(_: Vec) -> NotInVec; - fn lt(_: String) -> Lt; - fn lte(_: String) -> Lte; - fn gt(_: String) -> Gt; - fn gte(_: String) -> Gte; - fn contains(_: String) -> Contains; - fn starts_with(_: String) -> StartsWith; - fn ends_with(_: String) -> EndsWith; - fn mode(_: super::super::QueryMode) -> Mode; - fn not(_: String) -> Not; - }); - pub struct Include; - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::Lang(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - pub struct Select; - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::Lang(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - } - pub mod file_type { - use super::super::*; - - use super::{OrderByParam, SetParam, UncheckedSetParam, WhereParam}; - pub const NAME: &str = "file_type"; - pub struct Set(pub String); - impl From for SetParam { - fn from(Set(v): Set) -> Self { - Self::SetFileType(v) - } - } - impl From for UncheckedSetParam { - fn from(Set(v): Set) -> Self { - Self::FileType(v) - } - } - pub fn set>(value: String) -> T { - Set(value).into() - } - pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { - OrderByParam::FileType(direction) - } - pub fn equals(value: String) -> WhereParam { - WhereParam::FileType(_prisma::read_filters::StringFilter::Equals(value)) - } - ::prisma_client_rust::scalar_where_param_fns!( - _prisma::read_filters::StringFilter, - FileType, - { - fn in_vec(_: Vec) -> InVec; - fn not_in_vec(_: Vec) -> NotInVec; - fn lt(_: String) -> Lt; - fn lte(_: String) -> Lte; - fn gt(_: String) -> Gt; - fn gte(_: String) -> Gte; - fn contains(_: String) -> Contains; - fn starts_with(_: String) -> StartsWith; - fn ends_with(_: String) -> EndsWith; - fn mode(_: super::super::QueryMode) -> Mode; - fn not(_: String) -> Not; - } - ); - pub struct Include; - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::FileType(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - pub struct Select; - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::FileType(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - } - pub mod uploaded { - use super::super::*; - - use super::{OrderByParam, SetParam, UncheckedSetParam, WhereParam}; - pub const NAME: &str = "uploaded"; - pub struct Set( - pub ::prisma_client_rust::chrono::DateTime<::prisma_client_rust::chrono::FixedOffset>, - ); - impl From for SetParam { - fn from(Set(v): Set) -> Self { - Self::SetUploaded(v) - } - } - impl From for UncheckedSetParam { - fn from(Set(v): Set) -> Self { - Self::Uploaded(v) - } - } - pub fn set>( - value: ::prisma_client_rust::chrono::DateTime< - ::prisma_client_rust::chrono::FixedOffset, - >, - ) -> T { - Set(value).into() - } - pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { - OrderByParam::Uploaded(direction) - } - pub fn equals( - value: ::prisma_client_rust::chrono::DateTime< - ::prisma_client_rust::chrono::FixedOffset, - >, - ) -> WhereParam { - WhereParam::Uploaded(_prisma::read_filters::DateTimeFilter::Equals(value)) - } - ::prisma_client_rust::scalar_where_param_fns!( - _prisma::read_filters::DateTimeFilter, - Uploaded, - { - fn in_vec( - _: Vec< - ::prisma_client_rust::chrono::DateTime< - ::prisma_client_rust::chrono::FixedOffset, - >, - >, - ) -> InVec; - fn not_in_vec( - _: Vec< - ::prisma_client_rust::chrono::DateTime< - ::prisma_client_rust::chrono::FixedOffset, - >, - >, - ) -> NotInVec; - fn lt( - _: ::prisma_client_rust::chrono::DateTime< - ::prisma_client_rust::chrono::FixedOffset, - >, - ) -> Lt; - fn lte( - _: ::prisma_client_rust::chrono::DateTime< - ::prisma_client_rust::chrono::FixedOffset, - >, - ) -> Lte; - fn gt( - _: ::prisma_client_rust::chrono::DateTime< - ::prisma_client_rust::chrono::FixedOffset, - >, - ) -> Gt; - fn gte( - _: ::prisma_client_rust::chrono::DateTime< - ::prisma_client_rust::chrono::FixedOffset, - >, - ) -> Gte; - fn not( - _: ::prisma_client_rust::chrono::DateTime< - ::prisma_client_rust::chrono::FixedOffset, - >, - ) -> Not; - } - ); - pub struct Include; - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::Uploaded(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - pub struct Select; - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::Uploaded(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - } - pub mod is_deleted { - use super::super::*; - - use super::{OrderByParam, SetParam, UncheckedSetParam, WhereParam}; - pub const NAME: &str = "is_deleted"; - pub struct Set(pub bool); - impl From for SetParam { - fn from(Set(v): Set) -> Self { - Self::SetIsDeleted(v) - } - } - impl From for UncheckedSetParam { - fn from(Set(v): Set) -> Self { - Self::IsDeleted(v) - } - } - pub fn set>(value: bool) -> T { - Set(value).into() - } - pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { - OrderByParam::IsDeleted(direction) - } - pub fn equals(value: bool) -> WhereParam { - WhereParam::IsDeleted(_prisma::read_filters::BoolFilter::Equals(value)) - } - ::prisma_client_rust::scalar_where_param_fns!( - _prisma::read_filters::BoolFilter, - IsDeleted, - { - fn not(_: bool) -> Not; - } - ); - pub struct Include; - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::IsDeleted(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - pub struct Select; - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::IsDeleted(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - } - pub mod pages { - use super::super::*; - - use super::{OrderByParam, SetParam, UncheckedSetParam, WhereParam}; - pub const NAME: &str = "pages"; - pub struct Set(pub Option); - impl From for SetParam { - fn from(Set(v): Set) -> Self { - Self::SetPages(v) - } - } - impl From for UncheckedSetParam { - fn from(Set(v): Set) -> Self { - Self::Pages(v) - } - } - pub fn set>(value: Option) -> T { - Set(value).into() - } - pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { - OrderByParam::Pages(direction) - } - pub fn equals(value: Option) -> WhereParam { - WhereParam::Pages(_prisma::read_filters::IntNullableFilter::Equals(value)) - } - ::prisma_client_rust::scalar_where_param_fns!( - _prisma::read_filters::IntNullableFilter, - Pages, - { - fn in_vec(_: Vec) -> InVec; - fn not_in_vec(_: Vec) -> NotInVec; - fn lt(_: i32) -> Lt; - fn lte(_: i32) -> Lte; - fn gt(_: i32) -> Gt; - fn gte(_: i32) -> Gte; - fn not(_: Option) -> Not; - } - ); - pub fn increment(value: i32) -> SetParam { - SetParam::IncrementPages(value) - } - pub fn decrement(value: i32) -> SetParam { - SetParam::DecrementPages(value) - } - pub fn multiply(value: i32) -> SetParam { - SetParam::MultiplyPages(value) - } - pub fn divide(value: i32) -> SetParam { - SetParam::DividePages(value) - } - pub struct Include; - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::Pages(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - pub struct Select; - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::Pages(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - } - pub mod year { - use super::super::*; - - use super::{OrderByParam, SetParam, UncheckedSetParam, WhereParam}; - pub const NAME: &str = "year"; - pub struct Set(pub i32); - impl From for SetParam { - fn from(Set(v): Set) -> Self { - Self::SetYear(v) - } - } - impl From for UncheckedSetParam { - fn from(Set(v): Set) -> Self { - Self::Year(v) - } - } - pub fn set>(value: i32) -> T { - Set(value).into() - } - pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { - OrderByParam::Year(direction) - } - pub fn equals(value: i32) -> WhereParam { - WhereParam::Year(_prisma::read_filters::IntFilter::Equals(value)) - } - ::prisma_client_rust::scalar_where_param_fns!(_prisma::read_filters::IntFilter, Year, { - fn in_vec(_: Vec) -> InVec; - fn not_in_vec(_: Vec) -> NotInVec; - fn lt(_: i32) -> Lt; - fn lte(_: i32) -> Lte; - fn gt(_: i32) -> Gt; - fn gte(_: i32) -> Gte; - fn not(_: i32) -> Not; - }); - pub fn increment(value: i32) -> SetParam { - SetParam::IncrementYear(value) - } - pub fn decrement(value: i32) -> SetParam { - SetParam::DecrementYear(value) - } - pub fn multiply(value: i32) -> SetParam { - SetParam::MultiplyYear(value) - } - pub fn divide(value: i32) -> SetParam { - SetParam::DivideYear(value) - } - pub struct Include; - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::Year(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - pub struct Select; - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::Year(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - } - pub mod source { - use super::super::*; - - use super::{SetParam, WhereParam, WithParam}; - pub const NAME: &str = "source"; - pub struct Fetch(pub source::UniqueArgs); - impl Fetch { - pub fn with(mut self, params: impl Into) -> Self { - self.0 = self.0.with(params.into()); - self - } - } - impl From for WithParam { - fn from(Fetch(v): Fetch) -> Self { - WithParam::Source(v) - } - } - pub fn fetch() -> Fetch { - Fetch(source::UniqueArgs::new()) - } - pub struct Connect(source::UniqueWhereParam); - impl From for SetParam { - fn from(Connect(v): Connect) -> Self { - Self::ConnectSource(v) - } - } - pub fn connect>(value: source::UniqueWhereParam) -> T { - Connect(value).into() - } - pub fn is(value: Vec) -> WhereParam { - WhereParam::SourceIs(value) - } - pub fn is_not(value: Vec) -> WhereParam { - WhereParam::SourceIsNot(value) - } - pub enum Include { - Select(Vec), - Include(Vec), - Fetch, - } - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::Source(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let selections = match self { - Self::Select(selections) => { - selections.into_iter().map(|s| s.to_selection()).collect() - } - Self::Include(selections) => { - let mut nested_selections = - ::scalar_selections( - ); - nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); - nested_selections - } - Self::Fetch => { - ::scalar_selections() - } - }; - ::prisma_client_rust::Selection::new("source", None, [], selections) - } - pub fn select(nested_selections: Vec) -> Self { - Self::Select(nested_selections) - } - pub fn include(nested_selections: Vec) -> Self { - Self::Include(nested_selections) - } - } - pub enum Select { - Select(Vec), - Include(Vec), - Fetch, - } - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::Source(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let selections = match self { - Self::Select(selections) => { - selections.into_iter().map(|s| s.to_selection()).collect() - } - Self::Include(selections) => { - let mut nested_selections = vec![]; - nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); - nested_selections - } - Self::Fetch => { - ::scalar_selections() - } - }; - ::prisma_client_rust::Selection::new("source", None, [], selections) - } - pub fn select(nested_selections: Vec) -> Self { - Self::Select(nested_selections) - } - pub fn include(nested_selections: Vec) -> Self { - Self::Include(nested_selections) - } - } - } - pub mod book_annotation { - use super::super::*; - - use super::{SetParam, WhereParam, WithParam}; - pub const NAME: &str = "book_annotation"; - pub struct Fetch(pub book_annotation::UniqueArgs); - impl Fetch { - pub fn with(mut self, params: impl Into) -> Self { - self.0 = self.0.with(params.into()); - self - } - } - impl From for WithParam { - fn from(Fetch(v): Fetch) -> Self { - WithParam::BookAnnotation(v) - } - } - pub fn fetch() -> Fetch { - Fetch(book_annotation::UniqueArgs::new()) - } - pub struct Connect(book_annotation::UniqueWhereParam); - impl From for SetParam { - fn from(Connect(v): Connect) -> Self { - Self::ConnectBookAnnotation(v) - } - } - pub fn connect>(value: book_annotation::UniqueWhereParam) -> T { - Connect(value).into() - } - pub fn disconnect() -> SetParam { - SetParam::DisconnectBookAnnotation - } - pub fn is_null() -> WhereParam { - WhereParam::BookAnnotationIsNull - } - pub fn is(value: Vec) -> WhereParam { - WhereParam::BookAnnotationIs(value) - } - pub fn is_not(value: Vec) -> WhereParam { - WhereParam::BookAnnotationIsNot(value) - } - pub enum Include { - Select(Vec), - Include(Vec), - Fetch, - } - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::BookAnnotation(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let selections = match self { Self :: Select (selections) => { selections . into_iter () . map (| s | s . to_selection ()) . collect () } , Self :: Include (selections) => { let mut nested_selections = < book_annotation :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections } , Self :: Fetch => { < book_annotation :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () } } ; - ::prisma_client_rust::Selection::new("book_annotation", None, [], selections) - } - pub fn select(nested_selections: Vec) -> Self { - Self::Select(nested_selections) - } - pub fn include(nested_selections: Vec) -> Self { - Self::Include(nested_selections) - } - } - pub enum Select { - Select(Vec), - Include(Vec), - Fetch, - } - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::BookAnnotation(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let selections = match self { Self :: Select (selections) => { selections . into_iter () . map (| s | s . to_selection ()) . collect () } , Self :: Include (selections) => { let mut nested_selections = vec ! [] ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections } , Self :: Fetch => { < book_annotation :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () } } ; - ::prisma_client_rust::Selection::new("book_annotation", None, [], selections) - } - pub fn select(nested_selections: Vec) -> Self { - Self::Select(nested_selections) - } - pub fn include(nested_selections: Vec) -> Self { - Self::Include(nested_selections) - } - } - } - pub mod book_authors { - use super::super::*; - - use super::{SetParam, WhereParam, WithParam}; - pub const NAME: &str = "book_authors"; - pub struct Fetch(pub book_author::ManyArgs); - impl Fetch { - pub fn with(mut self, params: impl Into) -> Self { - self.0 = self.0.with(params.into()); - self - } - pub fn order_by(mut self, param: book_author::OrderByParam) -> Self { - self.0 = self.0.order_by(param); - self - } - pub fn skip(mut self, value: i64) -> Self { - self.0 = self.0.skip(value); - self - } - pub fn take(mut self, value: i64) -> Self { - self.0 = self.0.take(value); - self - } - pub fn cursor(mut self, value: book_author::UniqueWhereParam) -> Self { - self.0 = self.0.cursor(value.into()); - self - } - } - impl From for WithParam { - fn from(Fetch(v): Fetch) -> Self { - WithParam::BookAuthors(v) - } - } - pub fn fetch(params: Vec) -> Fetch { - Fetch(book_author::ManyArgs::new(params)) - } - pub struct Connect(pub Vec); - impl From for SetParam { - fn from(Connect(v): Connect) -> Self { - Self::ConnectBookAuthors(v) - } - } - pub fn connect>(params: Vec) -> T { - Connect(params).into() - } - pub fn disconnect(params: Vec) -> SetParam { - SetParam::DisconnectBookAuthors(params) - } - pub fn set(params: Vec) -> SetParam { - SetParam::SetBookAuthors(params) - } - pub fn some(value: Vec) -> WhereParam { - WhereParam::BookAuthorsSome(value) - } - pub fn every(value: Vec) -> WhereParam { - WhereParam::BookAuthorsEvery(value) - } - pub fn none(value: Vec) -> WhereParam { - WhereParam::BookAuthorsNone(value) - } - pub enum Include { - Select(book_author::ManyArgs, Vec), - Include(book_author::ManyArgs, Vec), - Fetch(book_author::ManyArgs), - } - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::BookAuthors(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let (args, selections) = match self { - Self::Select(args, selections) => ( - args.to_graphql().0, - selections.into_iter().map(|s| s.to_selection()).collect(), - ), - Self::Include(args, selections) => (args.to_graphql().0, { - let mut nested_selections = < book_author :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; - nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); - nested_selections - }), - Self::Fetch(args) => ( - args.to_graphql().0, - ::scalar_selections( - ), - ), - }; - ::prisma_client_rust::Selection::new(NAME, None, args, selections) - } - pub fn select( - args: book_author::ManyArgs, - nested_selections: Vec, - ) -> Self { - Self::Select(args, nested_selections) - } - pub fn include( - args: book_author::ManyArgs, - nested_selections: Vec, - ) -> Self { - Self::Include(args, nested_selections) - } - } - pub enum Select { - Select(book_author::ManyArgs, Vec), - Include(book_author::ManyArgs, Vec), - Fetch(book_author::ManyArgs), - } - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::BookAuthors(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let (args, selections) = match self { - Self::Select(args, selections) => ( - args.to_graphql().0, - selections.into_iter().map(|s| s.to_selection()).collect(), - ), - Self::Include(args, selections) => (args.to_graphql().0, { - let mut nested_selections = vec![]; - nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); - nested_selections - }), - Self::Fetch(args) => ( - args.to_graphql().0, - ::scalar_selections( - ), - ), - }; - ::prisma_client_rust::Selection::new(NAME, None, args, selections) - } - pub fn select( - args: book_author::ManyArgs, - nested_selections: Vec, - ) -> Self { - Self::Select(args, nested_selections) - } - pub fn include( - args: book_author::ManyArgs, - nested_selections: Vec, - ) -> Self { - Self::Include(args, nested_selections) - } - } - } - pub mod book_genres { - use super::super::*; - - use super::{SetParam, WhereParam, WithParam}; - pub const NAME: &str = "book_genres"; - pub struct Fetch(pub book_genre::ManyArgs); - impl Fetch { - pub fn with(mut self, params: impl Into) -> Self { - self.0 = self.0.with(params.into()); - self - } - pub fn order_by(mut self, param: book_genre::OrderByParam) -> Self { - self.0 = self.0.order_by(param); - self - } - pub fn skip(mut self, value: i64) -> Self { - self.0 = self.0.skip(value); - self - } - pub fn take(mut self, value: i64) -> Self { - self.0 = self.0.take(value); - self - } - pub fn cursor(mut self, value: book_genre::UniqueWhereParam) -> Self { - self.0 = self.0.cursor(value.into()); - self - } - } - impl From for WithParam { - fn from(Fetch(v): Fetch) -> Self { - WithParam::BookGenres(v) - } - } - pub fn fetch(params: Vec) -> Fetch { - Fetch(book_genre::ManyArgs::new(params)) - } - pub struct Connect(pub Vec); - impl From for SetParam { - fn from(Connect(v): Connect) -> Self { - Self::ConnectBookGenres(v) - } - } - pub fn connect>(params: Vec) -> T { - Connect(params).into() - } - pub fn disconnect(params: Vec) -> SetParam { - SetParam::DisconnectBookGenres(params) - } - pub fn set(params: Vec) -> SetParam { - SetParam::SetBookGenres(params) - } - pub fn some(value: Vec) -> WhereParam { - WhereParam::BookGenresSome(value) - } - pub fn every(value: Vec) -> WhereParam { - WhereParam::BookGenresEvery(value) - } - pub fn none(value: Vec) -> WhereParam { - WhereParam::BookGenresNone(value) - } - pub enum Include { - Select(book_genre::ManyArgs, Vec), - Include(book_genre::ManyArgs, Vec), - Fetch(book_genre::ManyArgs), - } - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::BookGenres(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let (args, selections) = match self { - Self::Select(args, selections) => ( - args.to_graphql().0, - selections.into_iter().map(|s| s.to_selection()).collect(), - ), - Self::Include(args, selections) => (args.to_graphql().0, { - let mut nested_selections = < book_genre :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; - nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); - nested_selections - }), - Self::Fetch(args) => ( - args.to_graphql().0, - ::scalar_selections( - ), - ), - }; - ::prisma_client_rust::Selection::new(NAME, None, args, selections) - } - pub fn select( - args: book_genre::ManyArgs, - nested_selections: Vec, - ) -> Self { - Self::Select(args, nested_selections) - } - pub fn include( - args: book_genre::ManyArgs, - nested_selections: Vec, - ) -> Self { - Self::Include(args, nested_selections) - } - } - pub enum Select { - Select(book_genre::ManyArgs, Vec), - Include(book_genre::ManyArgs, Vec), - Fetch(book_genre::ManyArgs), - } - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::BookGenres(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let (args, selections) = match self { - Self::Select(args, selections) => ( - args.to_graphql().0, - selections.into_iter().map(|s| s.to_selection()).collect(), - ), - Self::Include(args, selections) => (args.to_graphql().0, { - let mut nested_selections = vec![]; - nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); - nested_selections - }), - Self::Fetch(args) => ( - args.to_graphql().0, - ::scalar_selections( - ), - ), - }; - ::prisma_client_rust::Selection::new(NAME, None, args, selections) - } - pub fn select( - args: book_genre::ManyArgs, - nested_selections: Vec, - ) -> Self { - Self::Select(args, nested_selections) - } - pub fn include( - args: book_genre::ManyArgs, - nested_selections: Vec, - ) -> Self { - Self::Include(args, nested_selections) - } - } - } - pub mod book_sequences { - use super::super::*; - - use super::{SetParam, WhereParam, WithParam}; - pub const NAME: &str = "book_sequences"; - pub struct Fetch(pub book_sequence::ManyArgs); - impl Fetch { - pub fn with(mut self, params: impl Into) -> Self { - self.0 = self.0.with(params.into()); - self - } - pub fn order_by(mut self, param: book_sequence::OrderByParam) -> Self { - self.0 = self.0.order_by(param); - self - } - pub fn skip(mut self, value: i64) -> Self { - self.0 = self.0.skip(value); - self - } - pub fn take(mut self, value: i64) -> Self { - self.0 = self.0.take(value); - self - } - pub fn cursor(mut self, value: book_sequence::UniqueWhereParam) -> Self { - self.0 = self.0.cursor(value.into()); - self - } - } - impl From for WithParam { - fn from(Fetch(v): Fetch) -> Self { - WithParam::BookSequences(v) - } - } - pub fn fetch(params: Vec) -> Fetch { - Fetch(book_sequence::ManyArgs::new(params)) - } - pub struct Connect(pub Vec); - impl From for SetParam { - fn from(Connect(v): Connect) -> Self { - Self::ConnectBookSequences(v) - } - } - pub fn connect>(params: Vec) -> T { - Connect(params).into() - } - pub fn disconnect(params: Vec) -> SetParam { - SetParam::DisconnectBookSequences(params) - } - pub fn set(params: Vec) -> SetParam { - SetParam::SetBookSequences(params) - } - pub fn some(value: Vec) -> WhereParam { - WhereParam::BookSequencesSome(value) - } - pub fn every(value: Vec) -> WhereParam { - WhereParam::BookSequencesEvery(value) - } - pub fn none(value: Vec) -> WhereParam { - WhereParam::BookSequencesNone(value) - } - pub enum Include { - Select(book_sequence::ManyArgs, Vec), - Include(book_sequence::ManyArgs, Vec), - Fetch(book_sequence::ManyArgs), - } - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::BookSequences(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let (args , selections) = match self { Self :: Select (args , selections) => (args . to_graphql () . 0 , selections . into_iter () . map (| s | s . to_selection ()) . collect ()) , Self :: Include (args , selections) => (args . to_graphql () . 0 , { let mut nested_selections = < book_sequence :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections }) , Self :: Fetch (args) => (args . to_graphql () . 0 , < book_sequence :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) } ; - ::prisma_client_rust::Selection::new(NAME, None, args, selections) - } - pub fn select( - args: book_sequence::ManyArgs, - nested_selections: Vec, - ) -> Self { - Self::Select(args, nested_selections) - } - pub fn include( - args: book_sequence::ManyArgs, - nested_selections: Vec, - ) -> Self { - Self::Include(args, nested_selections) - } - } - pub enum Select { - Select(book_sequence::ManyArgs, Vec), - Include(book_sequence::ManyArgs, Vec), - Fetch(book_sequence::ManyArgs), - } - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::BookSequences(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let (args , selections) = match self { Self :: Select (args , selections) => (args . to_graphql () . 0 , selections . into_iter () . map (| s | s . to_selection ()) . collect ()) , Self :: Include (args , selections) => (args . to_graphql () . 0 , { let mut nested_selections = vec ! [] ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections }) , Self :: Fetch (args) => (args . to_graphql () . 0 , < book_sequence :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) } ; - ::prisma_client_rust::Selection::new(NAME, None, args, selections) - } - pub fn select( - args: book_sequence::ManyArgs, - nested_selections: Vec, - ) -> Self { - Self::Select(args, nested_selections) - } - pub fn include( - args: book_sequence::ManyArgs, - nested_selections: Vec, - ) -> Self { - Self::Include(args, nested_selections) - } - } - } - pub mod translations { - use super::super::*; - - use super::{SetParam, WhereParam, WithParam}; - pub const NAME: &str = "translations"; - pub struct Fetch(pub translator::ManyArgs); - impl Fetch { - pub fn with(mut self, params: impl Into) -> Self { - self.0 = self.0.with(params.into()); - self - } - pub fn order_by(mut self, param: translator::OrderByParam) -> Self { - self.0 = self.0.order_by(param); - self - } - pub fn skip(mut self, value: i64) -> Self { - self.0 = self.0.skip(value); - self - } - pub fn take(mut self, value: i64) -> Self { - self.0 = self.0.take(value); - self - } - pub fn cursor(mut self, value: translator::UniqueWhereParam) -> Self { - self.0 = self.0.cursor(value.into()); - self - } - } - impl From for WithParam { - fn from(Fetch(v): Fetch) -> Self { - WithParam::Translations(v) - } - } - pub fn fetch(params: Vec) -> Fetch { - Fetch(translator::ManyArgs::new(params)) - } - pub struct Connect(pub Vec); - impl From for SetParam { - fn from(Connect(v): Connect) -> Self { - Self::ConnectTranslations(v) - } - } - pub fn connect>(params: Vec) -> T { - Connect(params).into() - } - pub fn disconnect(params: Vec) -> SetParam { - SetParam::DisconnectTranslations(params) - } - pub fn set(params: Vec) -> SetParam { - SetParam::SetTranslations(params) - } - pub fn some(value: Vec) -> WhereParam { - WhereParam::TranslationsSome(value) - } - pub fn every(value: Vec) -> WhereParam { - WhereParam::TranslationsEvery(value) - } - pub fn none(value: Vec) -> WhereParam { - WhereParam::TranslationsNone(value) - } - pub enum Include { - Select(translator::ManyArgs, Vec), - Include(translator::ManyArgs, Vec), - Fetch(translator::ManyArgs), - } - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::Translations(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let (args, selections) = match self { - Self::Select(args, selections) => ( - args.to_graphql().0, - selections.into_iter().map(|s| s.to_selection()).collect(), - ), - Self::Include(args, selections) => (args.to_graphql().0, { - let mut nested_selections = < translator :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; - nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); - nested_selections - }), - Self::Fetch(args) => ( - args.to_graphql().0, - ::scalar_selections( - ), - ), - }; - ::prisma_client_rust::Selection::new(NAME, None, args, selections) - } - pub fn select( - args: translator::ManyArgs, - nested_selections: Vec, - ) -> Self { - Self::Select(args, nested_selections) - } - pub fn include( - args: translator::ManyArgs, - nested_selections: Vec, - ) -> Self { - Self::Include(args, nested_selections) - } - } - pub enum Select { - Select(translator::ManyArgs, Vec), - Include(translator::ManyArgs, Vec), - Fetch(translator::ManyArgs), - } - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::Translations(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let (args, selections) = match self { - Self::Select(args, selections) => ( - args.to_graphql().0, - selections.into_iter().map(|s| s.to_selection()).collect(), - ), - Self::Include(args, selections) => (args.to_graphql().0, { - let mut nested_selections = vec![]; - nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); - nested_selections - }), - Self::Fetch(args) => ( - args.to_graphql().0, - ::scalar_selections( - ), - ), - }; - ::prisma_client_rust::Selection::new(NAME, None, args, selections) - } - pub fn select( - args: translator::ManyArgs, - nested_selections: Vec, - ) -> Self { - Self::Select(args, nested_selections) - } - pub fn include( - args: translator::ManyArgs, - nested_selections: Vec, - ) -> Self { - Self::Include(args, nested_selections) - } - } - } - pub fn source_id_remote_id>(source_id: i32, remote_id: i32) -> T { - UniqueWhereParam::SourceIdRemoteIdEquals(source_id, remote_id).into() - } - pub fn create( - remote_id: i32, - title: String, - lang: String, - file_type: String, - uploaded: ::prisma_client_rust::chrono::DateTime<::prisma_client_rust::chrono::FixedOffset>, - source: super::source::UniqueWhereParam, - _params: Vec, - ) -> ( - i32, - String, - String, - String, - ::prisma_client_rust::chrono::DateTime<::prisma_client_rust::chrono::FixedOffset>, - super::source::UniqueWhereParam, - Vec, - ) { - (remote_id, title, lang, file_type, uploaded, source, _params) - } - pub fn create_unchecked( - source_id: i32, - remote_id: i32, - title: String, - lang: String, - file_type: String, - uploaded: ::prisma_client_rust::chrono::DateTime<::prisma_client_rust::chrono::FixedOffset>, - _params: Vec, - ) -> ( - i32, - i32, - String, - String, - String, - ::prisma_client_rust::chrono::DateTime<::prisma_client_rust::chrono::FixedOffset>, - Vec, - ) { - ( - source_id, remote_id, title, lang, file_type, uploaded, _params, - ) - } - #[macro_export] - macro_rules ! _select_book { ($ (($ ($ func_arg : ident : $ func_arg_ty : ty) , +) =>) ? $ module_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { # [allow (warnings)] pub mod $ module_name { crate :: prisma :: book :: select ! (@ definitions ; $ module_name ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; use super :: * ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: SelectType for Selection { type Data = Data ; type ModelData = crate :: prisma :: book :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn select ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: book :: select ! (@ selections_to_params ; : select { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () ,] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } } ; ({ $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { { crate :: prisma :: book :: select ! (@ definitions ; ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: SelectType for Selection { type Data = Data ; type ModelData = crate :: prisma :: book :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: book :: select ! (@ selections_to_params ; : select { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () ,] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } ; (@ definitions ; $ ($ module_name : ident) ? ; $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) +) => { # [allow (warnings)] enum Fields { id , source_id , remote_id , title , lang , file_type , uploaded , is_deleted , pages , year , source , book_annotation , book_authors , book_genres , book_sequences , translations } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] pub struct Data { $ (pub $ field : crate :: prisma :: book :: select ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } impl :: serde :: Serialize for Data { fn serialize < S > (& self , serializer : S) -> Result < S :: Ok , S :: Error > where S : :: serde :: Serializer , { use :: serde :: ser :: SerializeStruct ; let mut state = serializer . serialize_struct ("Data" , [$ (stringify ! ($ field) ,) +] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: book :: $ field :: NAME , & self . $ field) ? ;) * state . end () } } impl < 'de > :: serde :: Deserialize < 'de > for Data { fn deserialize < D > (deserializer : D) -> Result < Self , D :: Error > where D : :: serde :: Deserializer < 'de > , { # [allow (warnings)] enum Field { $ ($ field) , + , } impl < 'de > :: serde :: Deserialize < 'de > for Field { fn deserialize < D > (deserializer : D) -> Result < Field , D :: Error > where D : :: serde :: Deserializer < 'de > , { struct FieldVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for FieldVisitor { type Value = Field ; fn expecting (& self , formatter : & mut :: std :: fmt :: Formatter) -> :: std :: fmt :: Result { formatter . write_str (& [$ (crate :: prisma :: book :: $ field :: NAME) , + ,] . into_iter () . collect :: < Vec < _ >> () . join (", ")) } fn visit_str < E > (self , value : & str) -> Result < Field , E > where E : :: serde :: de :: Error , { match value { $ (crate :: prisma :: book :: $ field :: NAME => Ok (Field :: $ field)) , * , _ => Err (:: serde :: de :: Error :: unknown_field (value , FIELDS)) , } } } deserializer . deserialize_identifier (FieldVisitor) } } struct DataVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for DataVisitor { type Value = Data ; fn expecting (& self , formatter : & mut std :: fmt :: Formatter) -> std :: fmt :: Result { formatter . write_str ("struct Data") } fn visit_map < V > (self , mut map : V) -> Result < Data , V :: Error > where V : :: serde :: de :: MapAccess < 'de > , { $ (let mut $ field = None ;) * while let Some (key) = map . next_key () ? { match key { $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: book :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: book :: $ field :: NAME)) ? ;) * Ok (Data { $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "source_id" , "remote_id" , "title" , "lang" , "file_type" , "uploaded" , "is_deleted" , "pages" , "year" , "source" , "book_annotation" , "book_authors" , "book_genres" , "book_sequences" , "translations"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: book :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; id) => { i32 } ; (@ field_type ; source_id) => { i32 } ; (@ field_type ; remote_id) => { i32 } ; (@ field_type ; title) => { String } ; (@ field_type ; lang) => { String } ; (@ field_type ; file_type) => { String } ; (@ field_type ; uploaded) => { :: prisma_client_rust :: chrono :: DateTime < :: prisma_client_rust :: chrono :: FixedOffset , > } ; (@ field_type ; is_deleted) => { bool } ; (@ field_type ; pages) => { Option < i32 > } ; (@ field_type ; year) => { i32 } ; (@ field_type ; source : $ selection_mode : ident { $ ($ selections : tt) + }) => { source :: Data } ; (@ field_type ; source) => { crate :: prisma :: source :: Data } ; (@ field_type ; book_annotation : $ selection_mode : ident { $ ($ selections : tt) + }) => { Option < book_annotation :: Data > } ; (@ field_type ; book_annotation) => { Option < crate :: prisma :: book_annotation :: Data > } ; (@ field_type ; book_authors : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < book_authors :: Data > } ; (@ field_type ; book_authors) => { Vec < crate :: prisma :: book_author :: Data > } ; (@ field_type ; book_genres : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < book_genres :: Data > } ; (@ field_type ; book_genres) => { Vec < crate :: prisma :: book_genre :: Data > } ; (@ field_type ; book_sequences : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < book_sequences :: Data > } ; (@ field_type ; book_sequences) => { Vec < crate :: prisma :: book_sequence :: Data > } ; (@ field_type ; translations : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < translations :: Data > } ; (@ field_type ; translations) => { Vec < crate :: prisma :: translator :: Data > } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "Book" , available relations are "id, source_id, remote_id, title, lang, file_type, uploaded, is_deleted, pages, year, source, book_annotation, book_authors, book_genres, book_sequences, translations")) } ; (@ field_module ; source : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: source :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; book_annotation : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: book_annotation :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; book_authors : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: book_author :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; book_genres : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: book_genre :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; book_sequences : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: book_sequence :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; translations : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: translator :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; id) => { Into :: < crate :: prisma :: book :: SelectParam > :: into (crate :: prisma :: book :: id :: Select) } ; (@ selection_field_to_selection_param ; source_id) => { Into :: < crate :: prisma :: book :: SelectParam > :: into (crate :: prisma :: book :: source_id :: Select) } ; (@ selection_field_to_selection_param ; remote_id) => { Into :: < crate :: prisma :: book :: SelectParam > :: into (crate :: prisma :: book :: remote_id :: Select) } ; (@ selection_field_to_selection_param ; title) => { Into :: < crate :: prisma :: book :: SelectParam > :: into (crate :: prisma :: book :: title :: Select) } ; (@ selection_field_to_selection_param ; lang) => { Into :: < crate :: prisma :: book :: SelectParam > :: into (crate :: prisma :: book :: lang :: Select) } ; (@ selection_field_to_selection_param ; file_type) => { Into :: < crate :: prisma :: book :: SelectParam > :: into (crate :: prisma :: book :: file_type :: Select) } ; (@ selection_field_to_selection_param ; uploaded) => { Into :: < crate :: prisma :: book :: SelectParam > :: into (crate :: prisma :: book :: uploaded :: Select) } ; (@ selection_field_to_selection_param ; is_deleted) => { Into :: < crate :: prisma :: book :: SelectParam > :: into (crate :: prisma :: book :: is_deleted :: Select) } ; (@ selection_field_to_selection_param ; pages) => { Into :: < crate :: prisma :: book :: SelectParam > :: into (crate :: prisma :: book :: pages :: Select) } ; (@ selection_field_to_selection_param ; year) => { Into :: < crate :: prisma :: book :: SelectParam > :: into (crate :: prisma :: book :: year :: Select) } ; (@ selection_field_to_selection_param ; source $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: book :: SelectParam > :: into (crate :: prisma :: book :: source :: Select :: $ selection_mode (crate :: prisma :: source :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; source $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: book :: SelectParam > :: into (crate :: prisma :: book :: source :: Select :: Fetch) } } ; (@ selection_field_to_selection_param ; book_annotation $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: book :: SelectParam > :: into (crate :: prisma :: book :: book_annotation :: Select :: $ selection_mode (crate :: prisma :: book_annotation :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; book_annotation $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: book :: SelectParam > :: into (crate :: prisma :: book :: book_annotation :: Select :: Fetch) } } ; (@ selection_field_to_selection_param ; book_authors $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: book :: SelectParam > :: into (crate :: prisma :: book :: book_authors :: Select :: $ selection_mode (crate :: prisma :: book_author :: ManyArgs :: new (crate :: prisma :: book_author :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: book_author :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; book_authors $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: book :: SelectParam > :: into (crate :: prisma :: book :: book_authors :: Select :: Fetch (crate :: prisma :: book_author :: ManyArgs :: new (crate :: prisma :: book_author :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; book_genres $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: book :: SelectParam > :: into (crate :: prisma :: book :: book_genres :: Select :: $ selection_mode (crate :: prisma :: book_genre :: ManyArgs :: new (crate :: prisma :: book_genre :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: book_genre :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; book_genres $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: book :: SelectParam > :: into (crate :: prisma :: book :: book_genres :: Select :: Fetch (crate :: prisma :: book_genre :: ManyArgs :: new (crate :: prisma :: book_genre :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; book_sequences $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: book :: SelectParam > :: into (crate :: prisma :: book :: book_sequences :: Select :: $ selection_mode (crate :: prisma :: book_sequence :: ManyArgs :: new (crate :: prisma :: book_sequence :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: book_sequence :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; book_sequences $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: book :: SelectParam > :: into (crate :: prisma :: book :: book_sequences :: Select :: Fetch (crate :: prisma :: book_sequence :: ManyArgs :: new (crate :: prisma :: book_sequence :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; translations $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: book :: SelectParam > :: into (crate :: prisma :: book :: translations :: Select :: $ selection_mode (crate :: prisma :: translator :: ManyArgs :: new (crate :: prisma :: translator :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: translator :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; translations $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: book :: SelectParam > :: into (crate :: prisma :: book :: translations :: Select :: Fetch (crate :: prisma :: translator :: ManyArgs :: new (crate :: prisma :: translator :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; $ ($ tokens : tt) *) => { compile_error ! (stringify ! ($ ($ tokens) *)) } ; (@ selections_to_params ; : $ macro_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { [$ (crate :: prisma :: book :: $ macro_name ! (@ selection_field_to_selection_param ; $ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) ,) +] } ; (@ filters_to_args ;) => { vec ! [] } ; (@ filters_to_args ; $ ($ t : tt) *) => { $ ($ t) * } ; (@ field_serde_name ; id) => { "id" } ; (@ field_serde_name ; source_id) => { "source_id" } ; (@ field_serde_name ; remote_id) => { "remote_id" } ; (@ field_serde_name ; title) => { "title" } ; (@ field_serde_name ; lang) => { "lang" } ; (@ field_serde_name ; file_type) => { "file_type" } ; (@ field_serde_name ; uploaded) => { "uploaded" } ; (@ field_serde_name ; is_deleted) => { "is_deleted" } ; (@ field_serde_name ; pages) => { "pages" } ; (@ field_serde_name ; year) => { "year" } ; (@ field_serde_name ; source) => { "source" } ; (@ field_serde_name ; book_annotation) => { "book_annotation" } ; (@ field_serde_name ; book_authors) => { "book_authors" } ; (@ field_serde_name ; book_genres) => { "book_genres" } ; (@ field_serde_name ; book_sequences) => { "book_sequences" } ; (@ field_serde_name ; translations) => { "translations" } ; } - pub use _select_book as select; - pub enum SelectParam { - Id(id::Select), - SourceId(source_id::Select), - RemoteId(remote_id::Select), - Title(title::Select), - Lang(lang::Select), - FileType(file_type::Select), - Uploaded(uploaded::Select), - IsDeleted(is_deleted::Select), - Pages(pages::Select), - Year(year::Select), - Source(source::Select), - BookAnnotation(book_annotation::Select), - BookAuthors(book_authors::Select), - BookGenres(book_genres::Select), - BookSequences(book_sequences::Select), - Translations(translations::Select), - } - impl SelectParam { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - match self { - Self::Id(data) => data.to_selection(), - Self::SourceId(data) => data.to_selection(), - Self::RemoteId(data) => data.to_selection(), - Self::Title(data) => data.to_selection(), - Self::Lang(data) => data.to_selection(), - Self::FileType(data) => data.to_selection(), - Self::Uploaded(data) => data.to_selection(), - Self::IsDeleted(data) => data.to_selection(), - Self::Pages(data) => data.to_selection(), - Self::Year(data) => data.to_selection(), - Self::Source(data) => data.to_selection(), - Self::BookAnnotation(data) => data.to_selection(), - Self::BookAuthors(data) => data.to_selection(), - Self::BookGenres(data) => data.to_selection(), - Self::BookSequences(data) => data.to_selection(), - Self::Translations(data) => data.to_selection(), - } - } - } - #[macro_export] - macro_rules ! _include_book { ($ (($ ($ func_arg : ident : $ func_arg_ty : ty) , +) =>) ? $ module_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { # [allow (warnings)] pub mod $ module_name { crate :: prisma :: book :: include ! (@ definitions ; $ module_name ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; use super :: * ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: IncludeType for Selection { type Data = Data ; type ModelData = crate :: prisma :: book :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn include ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: book :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: book :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } } ; ({ $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { { crate :: prisma :: book :: include ! (@ definitions ; ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: IncludeType for Selection { type Data = Data ; type ModelData = crate :: prisma :: book :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: book :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: book :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } ; (@ definitions ; $ ($ module_name : ident) ? ; $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) +) => { # [allow (warnings)] enum Fields { source , book_annotation , book_authors , book_genres , book_sequences , translations } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] pub struct Data { pub id : i32 , pub source_id : i32 , pub remote_id : i32 , pub title : String , pub lang : String , pub file_type : String , pub uploaded : :: prisma_client_rust :: chrono :: DateTime < :: prisma_client_rust :: chrono :: FixedOffset , > , pub is_deleted : bool , pub pages : Option < i32 > , pub year : i32 , $ (pub $ field : crate :: prisma :: book :: include ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } impl :: serde :: Serialize for Data { fn serialize < S > (& self , serializer : S) -> Result < S :: Ok , S :: Error > where S : :: serde :: Serializer , { use :: serde :: ser :: SerializeStruct ; let mut state = serializer . serialize_struct ("Data" , [$ (stringify ! ($ field) ,) + stringify ! (id) , stringify ! (source_id) , stringify ! (remote_id) , stringify ! (title) , stringify ! (lang) , stringify ! (file_type) , stringify ! (uploaded) , stringify ! (is_deleted) , stringify ! (pages) , stringify ! (year)] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: book :: $ field :: NAME , & self . $ field) ? ;) * state . serialize_field (crate :: prisma :: book :: id :: NAME , & self . id) ? ; state . serialize_field (crate :: prisma :: book :: source_id :: NAME , & self . source_id) ? ; state . serialize_field (crate :: prisma :: book :: remote_id :: NAME , & self . remote_id) ? ; state . serialize_field (crate :: prisma :: book :: title :: NAME , & self . title) ? ; state . serialize_field (crate :: prisma :: book :: lang :: NAME , & self . lang) ? ; state . serialize_field (crate :: prisma :: book :: file_type :: NAME , & self . file_type) ? ; state . serialize_field (crate :: prisma :: book :: uploaded :: NAME , & self . uploaded) ? ; state . serialize_field (crate :: prisma :: book :: is_deleted :: NAME , & self . is_deleted) ? ; state . serialize_field (crate :: prisma :: book :: pages :: NAME , & self . pages) ? ; state . serialize_field (crate :: prisma :: book :: year :: NAME , & self . year) ? ; state . end () } } impl < 'de > :: serde :: Deserialize < 'de > for Data { fn deserialize < D > (deserializer : D) -> Result < Self , D :: Error > where D : :: serde :: Deserializer < 'de > , { # [allow (warnings)] enum Field { $ ($ field) , + , id , source_id , remote_id , title , lang , file_type , uploaded , is_deleted , pages , year } impl < 'de > :: serde :: Deserialize < 'de > for Field { fn deserialize < D > (deserializer : D) -> Result < Field , D :: Error > where D : :: serde :: Deserializer < 'de > , { struct FieldVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for FieldVisitor { type Value = Field ; fn expecting (& self , formatter : & mut :: std :: fmt :: Formatter) -> :: std :: fmt :: Result { formatter . write_str (& [$ (crate :: prisma :: book :: $ field :: NAME) , + , crate :: prisma :: book :: id :: NAME , crate :: prisma :: book :: source_id :: NAME , crate :: prisma :: book :: remote_id :: NAME , crate :: prisma :: book :: title :: NAME , crate :: prisma :: book :: lang :: NAME , crate :: prisma :: book :: file_type :: NAME , crate :: prisma :: book :: uploaded :: NAME , crate :: prisma :: book :: is_deleted :: NAME , crate :: prisma :: book :: pages :: NAME , crate :: prisma :: book :: year :: NAME] . into_iter () . collect :: < Vec < _ >> () . join (", ")) } fn visit_str < E > (self , value : & str) -> Result < Field , E > where E : :: serde :: de :: Error , { match value { $ (crate :: prisma :: book :: $ field :: NAME => Ok (Field :: $ field)) , * , crate :: prisma :: book :: id :: NAME => Ok (Field :: id) , crate :: prisma :: book :: source_id :: NAME => Ok (Field :: source_id) , crate :: prisma :: book :: remote_id :: NAME => Ok (Field :: remote_id) , crate :: prisma :: book :: title :: NAME => Ok (Field :: title) , crate :: prisma :: book :: lang :: NAME => Ok (Field :: lang) , crate :: prisma :: book :: file_type :: NAME => Ok (Field :: file_type) , crate :: prisma :: book :: uploaded :: NAME => Ok (Field :: uploaded) , crate :: prisma :: book :: is_deleted :: NAME => Ok (Field :: is_deleted) , crate :: prisma :: book :: pages :: NAME => Ok (Field :: pages) , crate :: prisma :: book :: year :: NAME => Ok (Field :: year) , _ => Err (:: serde :: de :: Error :: unknown_field (value , FIELDS)) , } } } deserializer . deserialize_identifier (FieldVisitor) } } struct DataVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for DataVisitor { type Value = Data ; fn expecting (& self , formatter : & mut std :: fmt :: Formatter) -> std :: fmt :: Result { formatter . write_str ("struct Data") } fn visit_map < V > (self , mut map : V) -> Result < Data , V :: Error > where V : :: serde :: de :: MapAccess < 'de > , { $ (let mut $ field = None ;) * let mut id = None ; let mut source_id = None ; let mut remote_id = None ; let mut title = None ; let mut lang = None ; let mut file_type = None ; let mut uploaded = None ; let mut is_deleted = None ; let mut pages = None ; let mut year = None ; while let Some (key) = map . next_key () ? { match key { Field :: id => { if id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: book :: id :: NAME)) ; } id = Some (map . next_value () ?) ; } Field :: source_id => { if source_id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: book :: source_id :: NAME)) ; } source_id = Some (map . next_value () ?) ; } Field :: remote_id => { if remote_id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: book :: remote_id :: NAME)) ; } remote_id = Some (map . next_value () ?) ; } Field :: title => { if title . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: book :: title :: NAME)) ; } title = Some (map . next_value () ?) ; } Field :: lang => { if lang . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: book :: lang :: NAME)) ; } lang = Some (map . next_value () ?) ; } Field :: file_type => { if file_type . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: book :: file_type :: NAME)) ; } file_type = Some (map . next_value () ?) ; } Field :: uploaded => { if uploaded . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: book :: uploaded :: NAME)) ; } uploaded = Some (map . next_value () ?) ; } Field :: is_deleted => { if is_deleted . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: book :: is_deleted :: NAME)) ; } is_deleted = Some (map . next_value () ?) ; } Field :: pages => { if pages . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: book :: pages :: NAME)) ; } pages = Some (map . next_value () ?) ; } Field :: year => { if year . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: book :: year :: NAME)) ; } year = Some (map . next_value () ?) ; } $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: book :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: book :: $ field :: NAME)) ? ;) * let id = id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: book :: id :: NAME)) ? ; let source_id = source_id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: book :: source_id :: NAME)) ? ; let remote_id = remote_id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: book :: remote_id :: NAME)) ? ; let title = title . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: book :: title :: NAME)) ? ; let lang = lang . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: book :: lang :: NAME)) ? ; let file_type = file_type . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: book :: file_type :: NAME)) ? ; let uploaded = uploaded . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: book :: uploaded :: NAME)) ? ; let is_deleted = is_deleted . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: book :: is_deleted :: NAME)) ? ; let pages = pages . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: book :: pages :: NAME)) ? ; let year = year . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: book :: year :: NAME)) ? ; Ok (Data { id , source_id , remote_id , title , lang , file_type , uploaded , is_deleted , pages , year , $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "source_id" , "remote_id" , "title" , "lang" , "file_type" , "uploaded" , "is_deleted" , "pages" , "year" , "source" , "book_annotation" , "book_authors" , "book_genres" , "book_sequences" , "translations"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: book :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; source : $ selection_mode : ident { $ ($ selections : tt) + }) => { source :: Data } ; (@ field_type ; source) => { crate :: prisma :: source :: Data } ; (@ field_type ; book_annotation : $ selection_mode : ident { $ ($ selections : tt) + }) => { Option < book_annotation :: Data > } ; (@ field_type ; book_annotation) => { Option < crate :: prisma :: book_annotation :: Data > } ; (@ field_type ; book_authors : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < book_authors :: Data > } ; (@ field_type ; book_authors) => { Vec < crate :: prisma :: book_author :: Data > } ; (@ field_type ; book_genres : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < book_genres :: Data > } ; (@ field_type ; book_genres) => { Vec < crate :: prisma :: book_genre :: Data > } ; (@ field_type ; book_sequences : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < book_sequences :: Data > } ; (@ field_type ; book_sequences) => { Vec < crate :: prisma :: book_sequence :: Data > } ; (@ field_type ; translations : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < translations :: Data > } ; (@ field_type ; translations) => { Vec < crate :: prisma :: translator :: Data > } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "Book" , available relations are "source, book_annotation, book_authors, book_genres, book_sequences, translations")) } ; (@ field_module ; source : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: source :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; book_annotation : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: book_annotation :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; book_authors : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: book_author :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; book_genres : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: book_genre :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; book_sequences : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: book_sequence :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; translations : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: translator :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; source $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: book :: IncludeParam > :: into (crate :: prisma :: book :: source :: Include :: $ selection_mode (crate :: prisma :: source :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; source $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: book :: IncludeParam > :: into (crate :: prisma :: book :: source :: Include :: Fetch) } } ; (@ selection_field_to_selection_param ; book_annotation $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: book :: IncludeParam > :: into (crate :: prisma :: book :: book_annotation :: Include :: $ selection_mode (crate :: prisma :: book_annotation :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; book_annotation $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: book :: IncludeParam > :: into (crate :: prisma :: book :: book_annotation :: Include :: Fetch) } } ; (@ selection_field_to_selection_param ; book_authors $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: book :: IncludeParam > :: into (crate :: prisma :: book :: book_authors :: Include :: $ selection_mode (crate :: prisma :: book_author :: ManyArgs :: new (crate :: prisma :: book_author :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: book_author :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; book_authors $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: book :: IncludeParam > :: into (crate :: prisma :: book :: book_authors :: Include :: Fetch (crate :: prisma :: book_author :: ManyArgs :: new (crate :: prisma :: book_author :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; book_genres $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: book :: IncludeParam > :: into (crate :: prisma :: book :: book_genres :: Include :: $ selection_mode (crate :: prisma :: book_genre :: ManyArgs :: new (crate :: prisma :: book_genre :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: book_genre :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; book_genres $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: book :: IncludeParam > :: into (crate :: prisma :: book :: book_genres :: Include :: Fetch (crate :: prisma :: book_genre :: ManyArgs :: new (crate :: prisma :: book_genre :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; book_sequences $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: book :: IncludeParam > :: into (crate :: prisma :: book :: book_sequences :: Include :: $ selection_mode (crate :: prisma :: book_sequence :: ManyArgs :: new (crate :: prisma :: book_sequence :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: book_sequence :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; book_sequences $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: book :: IncludeParam > :: into (crate :: prisma :: book :: book_sequences :: Include :: Fetch (crate :: prisma :: book_sequence :: ManyArgs :: new (crate :: prisma :: book_sequence :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; translations $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: book :: IncludeParam > :: into (crate :: prisma :: book :: translations :: Include :: $ selection_mode (crate :: prisma :: translator :: ManyArgs :: new (crate :: prisma :: translator :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: translator :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; translations $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: book :: IncludeParam > :: into (crate :: prisma :: book :: translations :: Include :: Fetch (crate :: prisma :: translator :: ManyArgs :: new (crate :: prisma :: translator :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; $ ($ tokens : tt) *) => { compile_error ! (stringify ! ($ ($ tokens) *)) } ; (@ selections_to_params ; : $ macro_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { [$ (crate :: prisma :: book :: $ macro_name ! (@ selection_field_to_selection_param ; $ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) ,) +] } ; (@ filters_to_args ;) => { vec ! [] } ; (@ filters_to_args ; $ ($ t : tt) *) => { $ ($ t) * } ; (@ field_serde_name ; id) => { "id" } ; (@ field_serde_name ; source_id) => { "source_id" } ; (@ field_serde_name ; remote_id) => { "remote_id" } ; (@ field_serde_name ; title) => { "title" } ; (@ field_serde_name ; lang) => { "lang" } ; (@ field_serde_name ; file_type) => { "file_type" } ; (@ field_serde_name ; uploaded) => { "uploaded" } ; (@ field_serde_name ; is_deleted) => { "is_deleted" } ; (@ field_serde_name ; pages) => { "pages" } ; (@ field_serde_name ; year) => { "year" } ; (@ field_serde_name ; source) => { "source" } ; (@ field_serde_name ; book_annotation) => { "book_annotation" } ; (@ field_serde_name ; book_authors) => { "book_authors" } ; (@ field_serde_name ; book_genres) => { "book_genres" } ; (@ field_serde_name ; book_sequences) => { "book_sequences" } ; (@ field_serde_name ; translations) => { "translations" } ; } - pub use _include_book as include; - pub enum IncludeParam { - Id(id::Include), - SourceId(source_id::Include), - RemoteId(remote_id::Include), - Title(title::Include), - Lang(lang::Include), - FileType(file_type::Include), - Uploaded(uploaded::Include), - IsDeleted(is_deleted::Include), - Pages(pages::Include), - Year(year::Include), - Source(source::Include), - BookAnnotation(book_annotation::Include), - BookAuthors(book_authors::Include), - BookGenres(book_genres::Include), - BookSequences(book_sequences::Include), - Translations(translations::Include), - } - impl IncludeParam { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - match self { - Self::Id(data) => data.to_selection(), - Self::SourceId(data) => data.to_selection(), - Self::RemoteId(data) => data.to_selection(), - Self::Title(data) => data.to_selection(), - Self::Lang(data) => data.to_selection(), - Self::FileType(data) => data.to_selection(), - Self::Uploaded(data) => data.to_selection(), - Self::IsDeleted(data) => data.to_selection(), - Self::Pages(data) => data.to_selection(), - Self::Year(data) => data.to_selection(), - Self::Source(data) => data.to_selection(), - Self::BookAnnotation(data) => data.to_selection(), - Self::BookAuthors(data) => data.to_selection(), - Self::BookGenres(data) => data.to_selection(), - Self::BookSequences(data) => data.to_selection(), - Self::Translations(data) => data.to_selection(), - } - } - } - #[macro_export] - macro_rules ! _partial_unchecked_book { ($ struct_name : ident { $ ($ scalar_field : ident) + }) => { :: prisma_client_rust :: macros :: partial_unchecked ! { crate :: prisma :: book struct $ struct_name { # [serde (rename = "id")] pub id : i32 , # [serde (rename = "source_id")] pub source_id : i32 , # [serde (rename = "remote_id")] pub remote_id : i32 , # [serde (rename = "title")] pub title : String , # [serde (rename = "lang")] pub lang : String , # [serde (rename = "file_type")] pub file_type : String , # [serde (rename = "uploaded")] pub uploaded : :: prisma_client_rust :: chrono :: DateTime < :: prisma_client_rust :: chrono :: FixedOffset , > , # [serde (rename = "is_deleted")] pub is_deleted : bool , # [serde (rename = "pages")] # [serde (default , with = "::prisma_client_rust::serde::double_option")] pub pages : Option < i32 > , # [serde (rename = "year")] pub year : i32 } [$ ($ scalar_field) , +] } } ; } - pub use _partial_unchecked_book as partial_unchecked; - #[derive(Debug, Clone, :: serde :: Serialize, :: serde :: Deserialize)] - pub struct Data { - #[serde(rename = "id")] - pub id: i32, - #[serde(rename = "source_id")] - pub source_id: i32, - #[serde(rename = "remote_id")] - pub remote_id: i32, - #[serde(rename = "title")] - pub title: String, - #[serde(rename = "lang")] - pub lang: String, - #[serde(rename = "file_type")] - pub file_type: String, - #[serde(rename = "uploaded")] - pub uploaded: - ::prisma_client_rust::chrono::DateTime<::prisma_client_rust::chrono::FixedOffset>, - #[serde(rename = "is_deleted")] - pub is_deleted: bool, - #[serde(rename = "pages")] - pub pages: Option, - #[serde(rename = "year")] - pub year: i32, - #[serde(rename = "source")] - pub source: Option>, - #[serde( - rename = "book_annotation", - default, - skip_serializing_if = "Option::is_none", - with = "prisma_client_rust::serde::double_option" - )] - pub book_annotation: Option>>, - #[serde(rename = "book_authors")] - pub book_authors: Option>, - #[serde(rename = "book_genres")] - pub book_genres: Option>, - #[serde(rename = "book_sequences")] - pub book_sequences: Option>, - #[serde(rename = "translations")] - pub translations: Option>, - } - impl Data { - pub fn source( - &self, - ) -> Result<&super::source::Data, ::prisma_client_rust::RelationNotFetchedError> { - self.source - .as_ref() - .ok_or(::prisma_client_rust::RelationNotFetchedError::new( - stringify!(source), - )) - .map(|v| v.as_ref()) - } - pub fn book_annotation( - &self, - ) -> Result< - Option<&super::book_annotation::Data>, - ::prisma_client_rust::RelationNotFetchedError, - > { - self.book_annotation - .as_ref() - .ok_or(::prisma_client_rust::RelationNotFetchedError::new( - stringify!(book_annotation), - )) - .map(|v| v.as_ref().map(|v| v.as_ref())) - } - pub fn book_authors( - &self, - ) -> Result<&Vec, ::prisma_client_rust::RelationNotFetchedError> - { - self.book_authors - .as_ref() - .ok_or(::prisma_client_rust::RelationNotFetchedError::new( - stringify!(book_authors), - )) - } - pub fn book_genres( - &self, - ) -> Result<&Vec, ::prisma_client_rust::RelationNotFetchedError> - { - self.book_genres - .as_ref() - .ok_or(::prisma_client_rust::RelationNotFetchedError::new( - stringify!(book_genres), - )) - } - pub fn book_sequences( - &self, - ) -> Result<&Vec, ::prisma_client_rust::RelationNotFetchedError> - { - self.book_sequences - .as_ref() - .ok_or(::prisma_client_rust::RelationNotFetchedError::new( - stringify!(book_sequences), - )) - } - pub fn translations( - &self, - ) -> Result<&Vec, ::prisma_client_rust::RelationNotFetchedError> - { - self.translations - .as_ref() - .ok_or(::prisma_client_rust::RelationNotFetchedError::new( - stringify!(translations), - )) - } - } - #[derive(Clone)] - pub enum WithParam { - Source(super::source::UniqueArgs), - BookAnnotation(super::book_annotation::UniqueArgs), - BookAuthors(super::book_author::ManyArgs), - BookGenres(super::book_genre::ManyArgs), - BookSequences(super::book_sequence::ManyArgs), - Translations(super::translator::ManyArgs), - } - impl Into<::prisma_client_rust::Selection> for WithParam { - fn into(self) -> ::prisma_client_rust::Selection { - match self { - Self::Source(args) => { - let mut selections = < super :: source :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; - selections.extend( - args.with_params - .into_iter() - .map(Into::<::prisma_client_rust::Selection>::into), - ); - ::prisma_client_rust::Selection::new(source::NAME, None, [], selections) - } - Self::BookAnnotation(args) => { - let mut selections = < super :: book_annotation :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; - selections.extend( - args.with_params - .into_iter() - .map(Into::<::prisma_client_rust::Selection>::into), - ); - ::prisma_client_rust::Selection::new( - book_annotation::NAME, - None, - [], - selections, - ) - } - Self::BookAuthors(args) => { - let (arguments, mut nested_selections) = args.to_graphql(); - nested_selections . extend (< super :: book_author :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) ; - ::prisma_client_rust::Selection::new( - book_authors::NAME, - None, - arguments, - nested_selections, - ) - } - Self::BookGenres(args) => { - let (arguments, mut nested_selections) = args.to_graphql(); - nested_selections . extend (< super :: book_genre :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) ; - ::prisma_client_rust::Selection::new( - book_genres::NAME, - None, - arguments, - nested_selections, - ) - } - Self::BookSequences(args) => { - let (arguments, mut nested_selections) = args.to_graphql(); - nested_selections . extend (< super :: book_sequence :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) ; - ::prisma_client_rust::Selection::new( - book_sequences::NAME, - None, - arguments, - nested_selections, - ) - } - Self::Translations(args) => { - let (arguments, mut nested_selections) = args.to_graphql(); - nested_selections . extend (< super :: translator :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) ; - ::prisma_client_rust::Selection::new( - translations::NAME, - None, - arguments, - nested_selections, - ) - } - } - } - } - #[derive(Clone)] - pub enum SetParam { - SetId(i32), - IncrementId(i32), - DecrementId(i32), - MultiplyId(i32), - DivideId(i32), - SetSourceId(i32), - IncrementSourceId(i32), - DecrementSourceId(i32), - MultiplySourceId(i32), - DivideSourceId(i32), - SetRemoteId(i32), - IncrementRemoteId(i32), - DecrementRemoteId(i32), - MultiplyRemoteId(i32), - DivideRemoteId(i32), - SetTitle(String), - SetLang(String), - SetFileType(String), - SetUploaded( - ::prisma_client_rust::chrono::DateTime<::prisma_client_rust::chrono::FixedOffset>, - ), - SetIsDeleted(bool), - SetPages(Option), - IncrementPages(i32), - DecrementPages(i32), - MultiplyPages(i32), - DividePages(i32), - SetYear(i32), - IncrementYear(i32), - DecrementYear(i32), - MultiplyYear(i32), - DivideYear(i32), - ConnectSource(super::source::UniqueWhereParam), - ConnectBookAnnotation(super::book_annotation::UniqueWhereParam), - DisconnectBookAnnotation, - ConnectBookAuthors(Vec), - DisconnectBookAuthors(Vec), - SetBookAuthors(Vec), - ConnectBookGenres(Vec), - DisconnectBookGenres(Vec), - SetBookGenres(Vec), - ConnectBookSequences(Vec), - DisconnectBookSequences(Vec), - SetBookSequences(Vec), - ConnectTranslations(Vec), - DisconnectTranslations(Vec), - SetTranslations(Vec), - } - impl From for (String, ::prisma_client_rust::PrismaValue) { - fn from(param: SetParam) -> Self { - match param { - SetParam::SetId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - ), - SetParam::IncrementId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "increment".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DecrementId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "decrement".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::MultiplyId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "multiply".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DivideId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "divide".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::SetSourceId(value) => ( - source_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - ), - SetParam::IncrementSourceId(value) => ( - source_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "increment".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DecrementSourceId(value) => ( - source_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "decrement".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::MultiplySourceId(value) => ( - source_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "multiply".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DivideSourceId(value) => ( - source_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "divide".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::SetRemoteId(value) => ( - remote_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - ), - SetParam::IncrementRemoteId(value) => ( - remote_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "increment".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DecrementRemoteId(value) => ( - remote_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "decrement".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::MultiplyRemoteId(value) => ( - remote_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "multiply".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DivideRemoteId(value) => ( - remote_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "divide".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::SetTitle(value) => ( - title::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(value), - ), - SetParam::SetLang(value) => ( - lang::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(value), - ), - SetParam::SetFileType(value) => ( - file_type::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(value), - ), - SetParam::SetUploaded(value) => ( - uploaded::NAME.to_string(), - ::prisma_client_rust::PrismaValue::DateTime(value), - ), - SetParam::SetIsDeleted(value) => ( - is_deleted::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Boolean(value), - ), - SetParam::SetPages(value) => ( - pages::NAME.to_string(), - value - .map(|value| ::prisma_client_rust::PrismaValue::Int(value as i64)) - .unwrap_or_else(|| ::prisma_client_rust::PrismaValue::Null), - ), - SetParam::IncrementPages(value) => ( - pages::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "increment".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DecrementPages(value) => ( - pages::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "decrement".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::MultiplyPages(value) => ( - pages::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "multiply".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DividePages(value) => ( - pages::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "divide".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::SetYear(value) => ( - year::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - ), - SetParam::IncrementYear(value) => ( - year::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "increment".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DecrementYear(value) => ( - year::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "decrement".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::MultiplyYear(value) => ( - year::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "multiply".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DivideYear(value) => ( - year::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "divide".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::ConnectSource(where_param) => ( - source::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "connect".to_string(), - ::prisma_client_rust::PrismaValue::Object( - [where_param] - .into_iter() - .map(Into::::into) - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - SetParam::ConnectBookAnnotation(where_param) => ( - book_annotation::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "connect".to_string(), - ::prisma_client_rust::PrismaValue::Object( - [where_param] - .into_iter() - .map(Into::::into) - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - SetParam::DisconnectBookAnnotation => ( - book_annotation::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "disconnect".to_string(), - ::prisma_client_rust::PrismaValue::Boolean(true), - )]), - ), - SetParam::ConnectBookAuthors(where_params) => ( - book_authors::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "connect".to_string(), - ::prisma_client_rust::PrismaValue::List( - where_params - .into_iter() - .map(Into::::into) - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) - .collect(), - ), - )]), - ), - SetParam::DisconnectBookAuthors(where_params) => ( - book_authors::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "disconnect".to_string(), - ::prisma_client_rust::PrismaValue::List( - where_params - .into_iter() - .map(Into::::into) - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) - .collect(), - ), - )]), - ), - SetParam::SetBookAuthors(where_params) => ( - book_authors::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "set".to_string(), - ::prisma_client_rust::PrismaValue::List( - where_params - .into_iter() - .map(Into::::into) - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) - .collect(), - ), - )]), - ), - SetParam::ConnectBookGenres(where_params) => ( - book_genres::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "connect".to_string(), - ::prisma_client_rust::PrismaValue::List( - where_params - .into_iter() - .map(Into::::into) - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) - .collect(), - ), - )]), - ), - SetParam::DisconnectBookGenres(where_params) => ( - book_genres::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "disconnect".to_string(), - ::prisma_client_rust::PrismaValue::List( - where_params - .into_iter() - .map(Into::::into) - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) - .collect(), - ), - )]), - ), - SetParam::SetBookGenres(where_params) => ( - book_genres::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "set".to_string(), - ::prisma_client_rust::PrismaValue::List( - where_params - .into_iter() - .map(Into::::into) - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) - .collect(), - ), - )]), - ), - SetParam::ConnectBookSequences(where_params) => ( - book_sequences::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "connect".to_string(), - ::prisma_client_rust::PrismaValue::List( - where_params - .into_iter() - .map(Into::::into) - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) - .collect(), - ), - )]), - ), - SetParam::DisconnectBookSequences(where_params) => ( - book_sequences::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "disconnect".to_string(), - ::prisma_client_rust::PrismaValue::List( - where_params - .into_iter() - .map(Into::::into) - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) - .collect(), - ), - )]), - ), - SetParam::SetBookSequences(where_params) => ( - book_sequences::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "set".to_string(), - ::prisma_client_rust::PrismaValue::List( - where_params - .into_iter() - .map(Into::::into) - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) - .collect(), - ), - )]), - ), - SetParam::ConnectTranslations(where_params) => ( - translations::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "connect".to_string(), - ::prisma_client_rust::PrismaValue::List( - where_params - .into_iter() - .map(Into::::into) - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) - .collect(), - ), - )]), - ), - SetParam::DisconnectTranslations(where_params) => ( - translations::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "disconnect".to_string(), - ::prisma_client_rust::PrismaValue::List( - where_params - .into_iter() - .map(Into::::into) - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) - .collect(), - ), - )]), - ), - SetParam::SetTranslations(where_params) => ( - translations::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "set".to_string(), - ::prisma_client_rust::PrismaValue::List( - where_params - .into_iter() - .map(Into::::into) - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) - .collect(), - ), - )]), - ), - } - } - } - #[derive(Clone)] - pub enum UncheckedSetParam { - Id(i32), - SourceId(i32), - RemoteId(i32), - Title(String), - Lang(String), - FileType(String), - Uploaded(::prisma_client_rust::chrono::DateTime<::prisma_client_rust::chrono::FixedOffset>), - IsDeleted(bool), - Pages(Option), - Year(i32), - } - impl From for SetParam { - fn from(param: UncheckedSetParam) -> Self { - match param { - UncheckedSetParam::Id(value) => Self::SetId(value), - UncheckedSetParam::SourceId(value) => Self::SetSourceId(value), - UncheckedSetParam::RemoteId(value) => Self::SetRemoteId(value), - UncheckedSetParam::Title(value) => Self::SetTitle(value), - UncheckedSetParam::Lang(value) => Self::SetLang(value), - UncheckedSetParam::FileType(value) => Self::SetFileType(value), - UncheckedSetParam::Uploaded(value) => Self::SetUploaded(value), - UncheckedSetParam::IsDeleted(value) => Self::SetIsDeleted(value), - UncheckedSetParam::Pages(value) => Self::SetPages(value), - UncheckedSetParam::Year(value) => Self::SetYear(value), - } - } - } - #[derive(Clone)] - pub enum OrderByParam { - Id(::prisma_client_rust::Direction), - SourceId(::prisma_client_rust::Direction), - RemoteId(::prisma_client_rust::Direction), - Title(::prisma_client_rust::Direction), - Lang(::prisma_client_rust::Direction), - FileType(::prisma_client_rust::Direction), - Uploaded(::prisma_client_rust::Direction), - IsDeleted(::prisma_client_rust::Direction), - Pages(::prisma_client_rust::Direction), - Year(::prisma_client_rust::Direction), - } - impl Into<(String, ::prisma_client_rust::PrismaValue)> for OrderByParam { - fn into(self) -> (String, ::prisma_client_rust::PrismaValue) { - match self { - Self::Id(direction) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(direction.to_string()), - ), - Self::SourceId(direction) => ( - source_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(direction.to_string()), - ), - Self::RemoteId(direction) => ( - remote_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(direction.to_string()), - ), - Self::Title(direction) => ( - title::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(direction.to_string()), - ), - Self::Lang(direction) => ( - lang::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(direction.to_string()), - ), - Self::FileType(direction) => ( - file_type::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(direction.to_string()), - ), - Self::Uploaded(direction) => ( - uploaded::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(direction.to_string()), - ), - Self::IsDeleted(direction) => ( - is_deleted::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(direction.to_string()), - ), - Self::Pages(direction) => ( - pages::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(direction.to_string()), - ), - Self::Year(direction) => ( - year::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(direction.to_string()), - ), - } - } - } - #[derive(Clone)] - pub enum WhereParam { - Not(Vec), - Or(Vec), - And(Vec), - SourceIdRemoteIdEquals(i32, i32), - Id(_prisma::read_filters::IntFilter), - SourceId(_prisma::read_filters::IntFilter), - RemoteId(_prisma::read_filters::IntFilter), - Title(_prisma::read_filters::StringFilter), - Lang(_prisma::read_filters::StringFilter), - FileType(_prisma::read_filters::StringFilter), - Uploaded(_prisma::read_filters::DateTimeFilter), - IsDeleted(_prisma::read_filters::BoolFilter), - Pages(_prisma::read_filters::IntNullableFilter), - Year(_prisma::read_filters::IntFilter), - SourceIs(Vec), - SourceIsNot(Vec), - BookAnnotationIsNull, - BookAnnotationIs(Vec), - BookAnnotationIsNot(Vec), - BookAuthorsSome(Vec), - BookAuthorsEvery(Vec), - BookAuthorsNone(Vec), - BookGenresSome(Vec), - BookGenresEvery(Vec), - BookGenresNone(Vec), - BookSequencesSome(Vec), - BookSequencesEvery(Vec), - BookSequencesNone(Vec), - TranslationsSome(Vec), - TranslationsEvery(Vec), - TranslationsNone(Vec), - } - impl ::prisma_client_rust::WhereInput for WhereParam { - fn serialize(self) -> ::prisma_client_rust::SerializedWhereInput { - let (name, value) = match self { - Self::Not(value) => ( - "NOT", - ::prisma_client_rust::SerializedWhereValue::Object( - ::prisma_client_rust::merge_fields( - value - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(Into::into) - .collect(), - ), - ), - ), - Self::Or(value) => ( - "OR", - ::prisma_client_rust::SerializedWhereValue::List( - value - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(Into::into) - .map(|v| vec![v]) - .map(::prisma_client_rust::PrismaValue::Object) - .collect(), - ), - ), - Self::And(value) => ( - "AND", - ::prisma_client_rust::SerializedWhereValue::Object( - ::prisma_client_rust::merge_fields( - value - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(Into::into) - .collect(), - ), - ), - ), - Self::SourceIdRemoteIdEquals(source_id, remote_id) => ( - "source_id_remote_id", - ::prisma_client_rust::SerializedWhereValue::Object(vec![ - ( - source_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Int(source_id as i64), - ), - ( - remote_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Int(remote_id as i64), - ), - ]), - ), - Self::Id(value) => (id::NAME, value.into()), - Self::SourceId(value) => (source_id::NAME, value.into()), - Self::RemoteId(value) => (remote_id::NAME, value.into()), - Self::Title(value) => (title::NAME, value.into()), - Self::Lang(value) => (lang::NAME, value.into()), - Self::FileType(value) => (file_type::NAME, value.into()), - Self::Uploaded(value) => (uploaded::NAME, value.into()), - Self::IsDeleted(value) => (is_deleted::NAME, value.into()), - Self::Pages(value) => (pages::NAME, value.into()), - Self::Year(value) => (year::NAME, value.into()), - Self::SourceIs(where_params) => ( - source::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "is".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::SourceIsNot(where_params) => ( - source::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "isNot".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::BookAnnotationIsNull => ( - book_annotation::NAME, - ::prisma_client_rust::SerializedWhereValue::Value( - ::prisma_client_rust::PrismaValue::Null, - ), - ), - Self::BookAnnotationIs(where_params) => ( - book_annotation::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "is".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::BookAnnotationIsNot(where_params) => ( - book_annotation::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "isNot".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::BookAuthorsSome(where_params) => ( - book_authors::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "some".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::BookAuthorsEvery(where_params) => ( - book_authors::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "every".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::BookAuthorsNone(where_params) => ( - book_authors::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "none".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::BookGenresSome(where_params) => ( - book_genres::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "some".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::BookGenresEvery(where_params) => ( - book_genres::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "every".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::BookGenresNone(where_params) => ( - book_genres::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "none".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::BookSequencesSome(where_params) => ( - book_sequences::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "some".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::BookSequencesEvery(where_params) => ( - book_sequences::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "every".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::BookSequencesNone(where_params) => ( - book_sequences::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "none".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::TranslationsSome(where_params) => ( - translations::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "some".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::TranslationsEvery(where_params) => ( - translations::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "every".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::TranslationsNone(where_params) => ( - translations::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "none".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - }; - ::prisma_client_rust::SerializedWhereInput::new(name, value.into()) - } - } - #[derive(Clone)] - pub enum UniqueWhereParam { - SourceIdRemoteIdEquals(i32, i32), - IdEquals(i32), - } - impl From for WhereParam { - fn from(value: UniqueWhereParam) -> Self { - match value { - UniqueWhereParam::SourceIdRemoteIdEquals(source_id, remote_id) => { - Self::SourceIdRemoteIdEquals(source_id, remote_id) - } - UniqueWhereParam::IdEquals(value) => { - Self::Id(_prisma::read_filters::IntFilter::Equals(value)) - } - } - } - } - impl From<::prisma_client_rust::Operator> for WhereParam { - fn from(op: ::prisma_client_rust::Operator) -> Self { - match op { - ::prisma_client_rust::Operator::Not(value) => Self::Not(value), - ::prisma_client_rust::Operator::And(value) => Self::And(value), - ::prisma_client_rust::Operator::Or(value) => Self::Or(value), - } - } - } - #[derive(Clone)] - pub struct Types; - impl ::prisma_client_rust::ModelTypes for Types { - type Data = Data; - type Where = WhereParam; - type UncheckedSet = UncheckedSetParam; - type Set = SetParam; - type With = WithParam; - type OrderBy = OrderByParam; - type Cursor = UniqueWhereParam; - const MODEL: &'static str = NAME; - fn scalar_selections() -> Vec<::prisma_client_rust::Selection> { - vec![ - ::prisma_client_rust::sel(id::NAME), - ::prisma_client_rust::sel(source_id::NAME), - ::prisma_client_rust::sel(remote_id::NAME), - ::prisma_client_rust::sel(title::NAME), - ::prisma_client_rust::sel(lang::NAME), - ::prisma_client_rust::sel(file_type::NAME), - ::prisma_client_rust::sel(uploaded::NAME), - ::prisma_client_rust::sel(is_deleted::NAME), - ::prisma_client_rust::sel(pages::NAME), - ::prisma_client_rust::sel(year::NAME), - ] - } - } - pub type UniqueArgs = ::prisma_client_rust::UniqueArgs; - pub type ManyArgs = ::prisma_client_rust::ManyArgs; - pub type Count<'a> = ::prisma_client_rust::Count<'a, Types>; - pub type Create<'a> = ::prisma_client_rust::Create<'a, Types>; - pub type CreateMany<'a> = ::prisma_client_rust::CreateMany<'a, Types>; - pub type FindUnique<'a> = ::prisma_client_rust::FindUnique<'a, Types>; - pub type FindMany<'a> = ::prisma_client_rust::FindMany<'a, Types>; - pub type FindFirst<'a> = ::prisma_client_rust::FindFirst<'a, Types>; - pub type Update<'a> = ::prisma_client_rust::Update<'a, Types>; - pub type UpdateMany<'a> = ::prisma_client_rust::UpdateMany<'a, Types>; - pub type Upsert<'a> = ::prisma_client_rust::Upsert<'a, Types>; - pub type Delete<'a> = ::prisma_client_rust::Delete<'a, Types>; - pub type DeleteMany<'a> = ::prisma_client_rust::DeleteMany<'a, Types>; - #[derive(Clone)] - pub struct Actions<'a> { - pub client: &'a ::prisma_client_rust::PrismaClientInternals, - } - impl<'a> Actions<'a> { - pub fn find_unique(self, _where: UniqueWhereParam) -> FindUnique<'a> { - FindUnique::new(self.client, _where.into()) - } - pub fn find_first(self, _where: Vec) -> FindFirst<'a> { - FindFirst::new(self.client, _where) - } - pub fn find_many(self, _where: Vec) -> FindMany<'a> { - FindMany::new(self.client, _where) - } - pub fn create( - self, - remote_id: i32, - title: String, - lang: String, - file_type: String, - uploaded: ::prisma_client_rust::chrono::DateTime< - ::prisma_client_rust::chrono::FixedOffset, - >, - source: super::source::UniqueWhereParam, - mut _params: Vec, - ) -> Create<'a> { - _params.extend([ - remote_id::set(remote_id), - title::set(title), - lang::set(lang), - file_type::set(file_type), - uploaded::set(uploaded), - source::connect(source), - ]); - Create::new(self.client, _params) - } - pub fn create_unchecked( - self, - source_id: i32, - remote_id: i32, - title: String, - lang: String, - file_type: String, - uploaded: ::prisma_client_rust::chrono::DateTime< - ::prisma_client_rust::chrono::FixedOffset, - >, - mut _params: Vec, - ) -> Create<'a> { - _params.extend([ - source_id::set(source_id), - remote_id::set(remote_id), - title::set(title), - lang::set(lang), - file_type::set(file_type), - uploaded::set(uploaded), - ]); - Create::new(self.client, _params.into_iter().map(Into::into).collect()) - } - pub fn create_many( - self, - data: Vec<( - i32, - i32, - String, - String, - String, - ::prisma_client_rust::chrono::DateTime<::prisma_client_rust::chrono::FixedOffset>, - Vec, - )>, - ) -> CreateMany<'a> { - let data = data - .into_iter() - .map( - |(source_id, remote_id, title, lang, file_type, uploaded, mut _params)| { - _params.extend([ - source_id::set(source_id), - remote_id::set(remote_id), - title::set(title), - lang::set(lang), - file_type::set(file_type), - uploaded::set(uploaded), - ]); - _params - }, - ) - .collect(); - CreateMany::new(self.client, data) - } - pub fn update(self, _where: UniqueWhereParam, _params: Vec) -> Update<'a> { - Update::new(self.client, _where.into(), _params, vec![]) - } - pub fn update_unchecked( - self, - _where: UniqueWhereParam, - _params: Vec, - ) -> Update<'a> { - Update::new( - self.client, - _where.into(), - _params.into_iter().map(Into::into).collect(), - vec![], - ) - } - pub fn update_many( - self, - _where: Vec, - _params: Vec, - ) -> UpdateMany<'a> { - UpdateMany::new(self.client, _where, _params) - } - pub fn upsert( - self, - _where: UniqueWhereParam, - (remote_id, title, lang, file_type, uploaded, source, mut _params): ( - i32, - String, - String, - String, - ::prisma_client_rust::chrono::DateTime<::prisma_client_rust::chrono::FixedOffset>, - super::source::UniqueWhereParam, - Vec, - ), - _update: Vec, - ) -> Upsert<'a> { - _params.extend([ - remote_id::set(remote_id), - title::set(title), - lang::set(lang), - file_type::set(file_type), - uploaded::set(uploaded), - source::connect(source), - ]); - Upsert::new(self.client, _where.into(), _params, _update) - } - pub fn delete(self, _where: UniqueWhereParam) -> Delete<'a> { - Delete::new(self.client, _where.into(), vec![]) - } - pub fn delete_many(self, _where: Vec) -> DeleteMany<'a> { - DeleteMany::new(self.client, _where) - } - pub fn count(self, _where: Vec) -> Count<'a> { - Count::new(self.client, _where) - } - } -} -pub mod genre { - - use super::*; - pub const NAME: &str = "Genre"; - pub mod id { - use super::super::*; - - use super::{OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam}; - pub const NAME: &str = "id"; - pub struct Set(pub i32); - impl From for SetParam { - fn from(Set(v): Set) -> Self { - Self::SetId(v) - } - } - impl From for UncheckedSetParam { - fn from(Set(v): Set) -> Self { - Self::Id(v) - } - } - pub fn set>(value: i32) -> T { - Set(value).into() - } - pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { - OrderByParam::Id(direction) - } - pub fn equals>(value: i32) -> T { - UniqueWhereParam::IdEquals(value).into() - } - ::prisma_client_rust::scalar_where_param_fns!(_prisma::read_filters::IntFilter, Id, { - fn in_vec(_: Vec) -> InVec; - fn not_in_vec(_: Vec) -> NotInVec; - fn lt(_: i32) -> Lt; - fn lte(_: i32) -> Lte; - fn gt(_: i32) -> Gt; - fn gte(_: i32) -> Gte; - fn not(_: i32) -> Not; - }); - pub fn increment(value: i32) -> SetParam { - SetParam::IncrementId(value) - } - pub fn decrement(value: i32) -> SetParam { - SetParam::DecrementId(value) - } - pub fn multiply(value: i32) -> SetParam { - SetParam::MultiplyId(value) - } - pub fn divide(value: i32) -> SetParam { - SetParam::DivideId(value) - } - pub struct Include; - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::Id(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - pub struct Select; - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::Id(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - } - pub mod source_id { - use super::super::*; - - use super::{OrderByParam, SetParam, UncheckedSetParam, WhereParam}; - pub const NAME: &str = "source_id"; - pub struct Set(pub i32); - impl From for SetParam { - fn from(Set(v): Set) -> Self { - Self::SetSourceId(v) - } - } - impl From for UncheckedSetParam { - fn from(Set(v): Set) -> Self { - Self::SourceId(v) - } - } - pub fn set>(value: i32) -> T { - Set(value).into() - } - pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { - OrderByParam::SourceId(direction) - } - pub fn equals(value: i32) -> WhereParam { - WhereParam::SourceId(_prisma::read_filters::IntFilter::Equals(value)) - } - ::prisma_client_rust::scalar_where_param_fns!( - _prisma::read_filters::IntFilter, - SourceId, - { - fn in_vec(_: Vec) -> InVec; - fn not_in_vec(_: Vec) -> NotInVec; - fn lt(_: i32) -> Lt; - fn lte(_: i32) -> Lte; - fn gt(_: i32) -> Gt; - fn gte(_: i32) -> Gte; - fn not(_: i32) -> Not; - } - ); - pub fn increment(value: i32) -> SetParam { - SetParam::IncrementSourceId(value) - } - pub fn decrement(value: i32) -> SetParam { - SetParam::DecrementSourceId(value) - } - pub fn multiply(value: i32) -> SetParam { - SetParam::MultiplySourceId(value) - } - pub fn divide(value: i32) -> SetParam { - SetParam::DivideSourceId(value) - } - pub struct Include; - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::SourceId(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - pub struct Select; - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::SourceId(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - } - pub mod remote_id { - use super::super::*; - - use super::{OrderByParam, SetParam, UncheckedSetParam, WhereParam}; - pub const NAME: &str = "remote_id"; - pub struct Set(pub i32); - impl From for SetParam { - fn from(Set(v): Set) -> Self { - Self::SetRemoteId(v) - } - } - impl From for UncheckedSetParam { - fn from(Set(v): Set) -> Self { - Self::RemoteId(v) - } - } - pub fn set>(value: i32) -> T { - Set(value).into() - } - pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { - OrderByParam::RemoteId(direction) - } - pub fn equals(value: i32) -> WhereParam { - WhereParam::RemoteId(_prisma::read_filters::IntFilter::Equals(value)) - } - ::prisma_client_rust::scalar_where_param_fns!( - _prisma::read_filters::IntFilter, - RemoteId, - { - fn in_vec(_: Vec) -> InVec; - fn not_in_vec(_: Vec) -> NotInVec; - fn lt(_: i32) -> Lt; - fn lte(_: i32) -> Lte; - fn gt(_: i32) -> Gt; - fn gte(_: i32) -> Gte; - fn not(_: i32) -> Not; - } - ); - pub fn increment(value: i32) -> SetParam { - SetParam::IncrementRemoteId(value) - } - pub fn decrement(value: i32) -> SetParam { - SetParam::DecrementRemoteId(value) - } - pub fn multiply(value: i32) -> SetParam { - SetParam::MultiplyRemoteId(value) - } - pub fn divide(value: i32) -> SetParam { - SetParam::DivideRemoteId(value) - } - pub struct Include; - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::RemoteId(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - pub struct Select; - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::RemoteId(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - } - pub mod code { - use super::super::*; - - use super::{OrderByParam, SetParam, UncheckedSetParam, WhereParam}; - pub const NAME: &str = "code"; - pub struct Set(pub String); - impl From for SetParam { - fn from(Set(v): Set) -> Self { - Self::SetCode(v) - } - } - impl From for UncheckedSetParam { - fn from(Set(v): Set) -> Self { - Self::Code(v) - } - } - pub fn set>(value: String) -> T { - Set(value).into() - } - pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { - OrderByParam::Code(direction) - } - pub fn equals(value: String) -> WhereParam { - WhereParam::Code(_prisma::read_filters::StringFilter::Equals(value)) - } - ::prisma_client_rust::scalar_where_param_fns!(_prisma::read_filters::StringFilter, Code, { - fn in_vec(_: Vec) -> InVec; - fn not_in_vec(_: Vec) -> NotInVec; - fn lt(_: String) -> Lt; - fn lte(_: String) -> Lte; - fn gt(_: String) -> Gt; - fn gte(_: String) -> Gte; - fn contains(_: String) -> Contains; - fn starts_with(_: String) -> StartsWith; - fn ends_with(_: String) -> EndsWith; - fn mode(_: super::super::QueryMode) -> Mode; - fn not(_: String) -> Not; - }); - pub struct Include; - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::Code(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - pub struct Select; - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::Code(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - } - pub mod description { - use super::super::*; - - use super::{OrderByParam, SetParam, UncheckedSetParam, WhereParam}; - pub const NAME: &str = "description"; - pub struct Set(pub String); - impl From for SetParam { - fn from(Set(v): Set) -> Self { - Self::SetDescription(v) - } - } - impl From for UncheckedSetParam { - fn from(Set(v): Set) -> Self { - Self::Description(v) - } - } - pub fn set>(value: String) -> T { - Set(value).into() - } - pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { - OrderByParam::Description(direction) - } - pub fn equals(value: String) -> WhereParam { - WhereParam::Description(_prisma::read_filters::StringFilter::Equals(value)) - } - ::prisma_client_rust::scalar_where_param_fns!( - _prisma::read_filters::StringFilter, - Description, - { - fn in_vec(_: Vec) -> InVec; - fn not_in_vec(_: Vec) -> NotInVec; - fn lt(_: String) -> Lt; - fn lte(_: String) -> Lte; - fn gt(_: String) -> Gt; - fn gte(_: String) -> Gte; - fn contains(_: String) -> Contains; - fn starts_with(_: String) -> StartsWith; - fn ends_with(_: String) -> EndsWith; - fn mode(_: super::super::QueryMode) -> Mode; - fn not(_: String) -> Not; - } - ); - pub struct Include; - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::Description(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - pub struct Select; - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::Description(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - } - pub mod meta { - use super::super::*; - - use super::{OrderByParam, SetParam, UncheckedSetParam, WhereParam}; - pub const NAME: &str = "meta"; - pub struct Set(pub String); - impl From for SetParam { - fn from(Set(v): Set) -> Self { - Self::SetMeta(v) - } - } - impl From for UncheckedSetParam { - fn from(Set(v): Set) -> Self { - Self::Meta(v) - } - } - pub fn set>(value: String) -> T { - Set(value).into() - } - pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { - OrderByParam::Meta(direction) - } - pub fn equals(value: String) -> WhereParam { - WhereParam::Meta(_prisma::read_filters::StringFilter::Equals(value)) - } - ::prisma_client_rust::scalar_where_param_fns!(_prisma::read_filters::StringFilter, Meta, { - fn in_vec(_: Vec) -> InVec; - fn not_in_vec(_: Vec) -> NotInVec; - fn lt(_: String) -> Lt; - fn lte(_: String) -> Lte; - fn gt(_: String) -> Gt; - fn gte(_: String) -> Gte; - fn contains(_: String) -> Contains; - fn starts_with(_: String) -> StartsWith; - fn ends_with(_: String) -> EndsWith; - fn mode(_: super::super::QueryMode) -> Mode; - fn not(_: String) -> Not; - }); - pub struct Include; - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::Meta(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - pub struct Select; - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::Meta(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - } - pub mod source { - use super::super::*; - - use super::{SetParam, WhereParam, WithParam}; - pub const NAME: &str = "source"; - pub struct Fetch(pub source::UniqueArgs); - impl Fetch { - pub fn with(mut self, params: impl Into) -> Self { - self.0 = self.0.with(params.into()); - self - } - } - impl From for WithParam { - fn from(Fetch(v): Fetch) -> Self { - WithParam::Source(v) - } - } - pub fn fetch() -> Fetch { - Fetch(source::UniqueArgs::new()) - } - pub struct Connect(source::UniqueWhereParam); - impl From for SetParam { - fn from(Connect(v): Connect) -> Self { - Self::ConnectSource(v) - } - } - pub fn connect>(value: source::UniqueWhereParam) -> T { - Connect(value).into() - } - pub fn is(value: Vec) -> WhereParam { - WhereParam::SourceIs(value) - } - pub fn is_not(value: Vec) -> WhereParam { - WhereParam::SourceIsNot(value) - } - pub enum Include { - Select(Vec), - Include(Vec), - Fetch, - } - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::Source(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let selections = match self { - Self::Select(selections) => { - selections.into_iter().map(|s| s.to_selection()).collect() - } - Self::Include(selections) => { - let mut nested_selections = - ::scalar_selections( - ); - nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); - nested_selections - } - Self::Fetch => { - ::scalar_selections() - } - }; - ::prisma_client_rust::Selection::new("source", None, [], selections) - } - pub fn select(nested_selections: Vec) -> Self { - Self::Select(nested_selections) - } - pub fn include(nested_selections: Vec) -> Self { - Self::Include(nested_selections) - } - } - pub enum Select { - Select(Vec), - Include(Vec), - Fetch, - } - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::Source(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let selections = match self { - Self::Select(selections) => { - selections.into_iter().map(|s| s.to_selection()).collect() - } - Self::Include(selections) => { - let mut nested_selections = vec![]; - nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); - nested_selections - } - Self::Fetch => { - ::scalar_selections() - } - }; - ::prisma_client_rust::Selection::new("source", None, [], selections) - } - pub fn select(nested_selections: Vec) -> Self { - Self::Select(nested_selections) - } - pub fn include(nested_selections: Vec) -> Self { - Self::Include(nested_selections) - } - } - } - pub mod book_genres { - use super::super::*; - - use super::{SetParam, WhereParam, WithParam}; - pub const NAME: &str = "book_genres"; - pub struct Fetch(pub book_genre::ManyArgs); - impl Fetch { - pub fn with(mut self, params: impl Into) -> Self { - self.0 = self.0.with(params.into()); - self - } - pub fn order_by(mut self, param: book_genre::OrderByParam) -> Self { - self.0 = self.0.order_by(param); - self - } - pub fn skip(mut self, value: i64) -> Self { - self.0 = self.0.skip(value); - self - } - pub fn take(mut self, value: i64) -> Self { - self.0 = self.0.take(value); - self - } - pub fn cursor(mut self, value: book_genre::UniqueWhereParam) -> Self { - self.0 = self.0.cursor(value.into()); - self - } - } - impl From for WithParam { - fn from(Fetch(v): Fetch) -> Self { - WithParam::BookGenres(v) - } - } - pub fn fetch(params: Vec) -> Fetch { - Fetch(book_genre::ManyArgs::new(params)) - } - pub struct Connect(pub Vec); - impl From for SetParam { - fn from(Connect(v): Connect) -> Self { - Self::ConnectBookGenres(v) - } - } - pub fn connect>(params: Vec) -> T { - Connect(params).into() - } - pub fn disconnect(params: Vec) -> SetParam { - SetParam::DisconnectBookGenres(params) - } - pub fn set(params: Vec) -> SetParam { - SetParam::SetBookGenres(params) - } - pub fn some(value: Vec) -> WhereParam { - WhereParam::BookGenresSome(value) - } - pub fn every(value: Vec) -> WhereParam { - WhereParam::BookGenresEvery(value) - } - pub fn none(value: Vec) -> WhereParam { - WhereParam::BookGenresNone(value) - } - pub enum Include { - Select(book_genre::ManyArgs, Vec), - Include(book_genre::ManyArgs, Vec), - Fetch(book_genre::ManyArgs), - } - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::BookGenres(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let (args, selections) = match self { - Self::Select(args, selections) => ( - args.to_graphql().0, - selections.into_iter().map(|s| s.to_selection()).collect(), - ), - Self::Include(args, selections) => (args.to_graphql().0, { - let mut nested_selections = < book_genre :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; - nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); - nested_selections - }), - Self::Fetch(args) => ( - args.to_graphql().0, - ::scalar_selections( - ), - ), - }; - ::prisma_client_rust::Selection::new(NAME, None, args, selections) - } - pub fn select( - args: book_genre::ManyArgs, - nested_selections: Vec, - ) -> Self { - Self::Select(args, nested_selections) - } - pub fn include( - args: book_genre::ManyArgs, - nested_selections: Vec, - ) -> Self { - Self::Include(args, nested_selections) - } - } - pub enum Select { - Select(book_genre::ManyArgs, Vec), - Include(book_genre::ManyArgs, Vec), - Fetch(book_genre::ManyArgs), - } - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::BookGenres(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let (args, selections) = match self { - Self::Select(args, selections) => ( - args.to_graphql().0, - selections.into_iter().map(|s| s.to_selection()).collect(), - ), - Self::Include(args, selections) => (args.to_graphql().0, { - let mut nested_selections = vec![]; - nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); - nested_selections - }), - Self::Fetch(args) => ( - args.to_graphql().0, - ::scalar_selections( - ), - ), - }; - ::prisma_client_rust::Selection::new(NAME, None, args, selections) - } - pub fn select( - args: book_genre::ManyArgs, - nested_selections: Vec, - ) -> Self { - Self::Select(args, nested_selections) - } - pub fn include( - args: book_genre::ManyArgs, - nested_selections: Vec, - ) -> Self { - Self::Include(args, nested_selections) - } - } - } - pub fn source_id_remote_id>(source_id: i32, remote_id: i32) -> T { - UniqueWhereParam::SourceIdRemoteIdEquals(source_id, remote_id).into() - } - pub fn create( - remote_id: i32, - code: String, - description: String, - meta: String, - source: super::source::UniqueWhereParam, - _params: Vec, - ) -> ( - i32, - String, - String, - String, - super::source::UniqueWhereParam, - Vec, - ) { - (remote_id, code, description, meta, source, _params) - } - pub fn create_unchecked( - source_id: i32, - remote_id: i32, - code: String, - description: String, - meta: String, - _params: Vec, - ) -> (i32, i32, String, String, String, Vec) { - (source_id, remote_id, code, description, meta, _params) - } - #[macro_export] - macro_rules ! _select_genre { ($ (($ ($ func_arg : ident : $ func_arg_ty : ty) , +) =>) ? $ module_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { # [allow (warnings)] pub mod $ module_name { crate :: prisma :: genre :: select ! (@ definitions ; $ module_name ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; use super :: * ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: SelectType for Selection { type Data = Data ; type ModelData = crate :: prisma :: genre :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn select ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: genre :: select ! (@ selections_to_params ; : select { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () ,] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } } ; ({ $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { { crate :: prisma :: genre :: select ! (@ definitions ; ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: SelectType for Selection { type Data = Data ; type ModelData = crate :: prisma :: genre :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: genre :: select ! (@ selections_to_params ; : select { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () ,] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } ; (@ definitions ; $ ($ module_name : ident) ? ; $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) +) => { # [allow (warnings)] enum Fields { id , source_id , remote_id , code , description , meta , source , book_genres } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] pub struct Data { $ (pub $ field : crate :: prisma :: genre :: select ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } impl :: serde :: Serialize for Data { fn serialize < S > (& self , serializer : S) -> Result < S :: Ok , S :: Error > where S : :: serde :: Serializer , { use :: serde :: ser :: SerializeStruct ; let mut state = serializer . serialize_struct ("Data" , [$ (stringify ! ($ field) ,) +] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: genre :: $ field :: NAME , & self . $ field) ? ;) * state . end () } } impl < 'de > :: serde :: Deserialize < 'de > for Data { fn deserialize < D > (deserializer : D) -> Result < Self , D :: Error > where D : :: serde :: Deserializer < 'de > , { # [allow (warnings)] enum Field { $ ($ field) , + , } impl < 'de > :: serde :: Deserialize < 'de > for Field { fn deserialize < D > (deserializer : D) -> Result < Field , D :: Error > where D : :: serde :: Deserializer < 'de > , { struct FieldVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for FieldVisitor { type Value = Field ; fn expecting (& self , formatter : & mut :: std :: fmt :: Formatter) -> :: std :: fmt :: Result { formatter . write_str (& [$ (crate :: prisma :: genre :: $ field :: NAME) , + ,] . into_iter () . collect :: < Vec < _ >> () . join (", ")) } fn visit_str < E > (self , value : & str) -> Result < Field , E > where E : :: serde :: de :: Error , { match value { $ (crate :: prisma :: genre :: $ field :: NAME => Ok (Field :: $ field)) , * , _ => Err (:: serde :: de :: Error :: unknown_field (value , FIELDS)) , } } } deserializer . deserialize_identifier (FieldVisitor) } } struct DataVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for DataVisitor { type Value = Data ; fn expecting (& self , formatter : & mut std :: fmt :: Formatter) -> std :: fmt :: Result { formatter . write_str ("struct Data") } fn visit_map < V > (self , mut map : V) -> Result < Data , V :: Error > where V : :: serde :: de :: MapAccess < 'de > , { $ (let mut $ field = None ;) * while let Some (key) = map . next_key () ? { match key { $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: genre :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: genre :: $ field :: NAME)) ? ;) * Ok (Data { $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "source_id" , "remote_id" , "code" , "description" , "meta" , "source" , "book_genres"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: genre :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; id) => { i32 } ; (@ field_type ; source_id) => { i32 } ; (@ field_type ; remote_id) => { i32 } ; (@ field_type ; code) => { String } ; (@ field_type ; description) => { String } ; (@ field_type ; meta) => { String } ; (@ field_type ; source : $ selection_mode : ident { $ ($ selections : tt) + }) => { source :: Data } ; (@ field_type ; source) => { crate :: prisma :: source :: Data } ; (@ field_type ; book_genres : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < book_genres :: Data > } ; (@ field_type ; book_genres) => { Vec < crate :: prisma :: book_genre :: Data > } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "Genre" , available relations are "id, source_id, remote_id, code, description, meta, source, book_genres")) } ; (@ field_module ; source : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: source :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; book_genres : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: book_genre :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; id) => { Into :: < crate :: prisma :: genre :: SelectParam > :: into (crate :: prisma :: genre :: id :: Select) } ; (@ selection_field_to_selection_param ; source_id) => { Into :: < crate :: prisma :: genre :: SelectParam > :: into (crate :: prisma :: genre :: source_id :: Select) } ; (@ selection_field_to_selection_param ; remote_id) => { Into :: < crate :: prisma :: genre :: SelectParam > :: into (crate :: prisma :: genre :: remote_id :: Select) } ; (@ selection_field_to_selection_param ; code) => { Into :: < crate :: prisma :: genre :: SelectParam > :: into (crate :: prisma :: genre :: code :: Select) } ; (@ selection_field_to_selection_param ; description) => { Into :: < crate :: prisma :: genre :: SelectParam > :: into (crate :: prisma :: genre :: description :: Select) } ; (@ selection_field_to_selection_param ; meta) => { Into :: < crate :: prisma :: genre :: SelectParam > :: into (crate :: prisma :: genre :: meta :: Select) } ; (@ selection_field_to_selection_param ; source $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: genre :: SelectParam > :: into (crate :: prisma :: genre :: source :: Select :: $ selection_mode (crate :: prisma :: source :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; source $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: genre :: SelectParam > :: into (crate :: prisma :: genre :: source :: Select :: Fetch) } } ; (@ selection_field_to_selection_param ; book_genres $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: genre :: SelectParam > :: into (crate :: prisma :: genre :: book_genres :: Select :: $ selection_mode (crate :: prisma :: book_genre :: ManyArgs :: new (crate :: prisma :: book_genre :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: book_genre :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; book_genres $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: genre :: SelectParam > :: into (crate :: prisma :: genre :: book_genres :: Select :: Fetch (crate :: prisma :: book_genre :: ManyArgs :: new (crate :: prisma :: book_genre :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; $ ($ tokens : tt) *) => { compile_error ! (stringify ! ($ ($ tokens) *)) } ; (@ selections_to_params ; : $ macro_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { [$ (crate :: prisma :: genre :: $ macro_name ! (@ selection_field_to_selection_param ; $ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) ,) +] } ; (@ filters_to_args ;) => { vec ! [] } ; (@ filters_to_args ; $ ($ t : tt) *) => { $ ($ t) * } ; (@ field_serde_name ; id) => { "id" } ; (@ field_serde_name ; source_id) => { "source_id" } ; (@ field_serde_name ; remote_id) => { "remote_id" } ; (@ field_serde_name ; code) => { "code" } ; (@ field_serde_name ; description) => { "description" } ; (@ field_serde_name ; meta) => { "meta" } ; (@ field_serde_name ; source) => { "source" } ; (@ field_serde_name ; book_genres) => { "book_genres" } ; } - pub use _select_genre as select; - pub enum SelectParam { - Id(id::Select), - SourceId(source_id::Select), - RemoteId(remote_id::Select), - Code(code::Select), - Description(description::Select), - Meta(meta::Select), - Source(source::Select), - BookGenres(book_genres::Select), - } - impl SelectParam { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - match self { - Self::Id(data) => data.to_selection(), - Self::SourceId(data) => data.to_selection(), - Self::RemoteId(data) => data.to_selection(), - Self::Code(data) => data.to_selection(), - Self::Description(data) => data.to_selection(), - Self::Meta(data) => data.to_selection(), - Self::Source(data) => data.to_selection(), - Self::BookGenres(data) => data.to_selection(), - } - } - } - #[macro_export] - macro_rules ! _include_genre { ($ (($ ($ func_arg : ident : $ func_arg_ty : ty) , +) =>) ? $ module_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { # [allow (warnings)] pub mod $ module_name { crate :: prisma :: genre :: include ! (@ definitions ; $ module_name ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; use super :: * ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: IncludeType for Selection { type Data = Data ; type ModelData = crate :: prisma :: genre :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn include ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: genre :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: genre :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } } ; ({ $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { { crate :: prisma :: genre :: include ! (@ definitions ; ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: IncludeType for Selection { type Data = Data ; type ModelData = crate :: prisma :: genre :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: genre :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: genre :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } ; (@ definitions ; $ ($ module_name : ident) ? ; $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) +) => { # [allow (warnings)] enum Fields { source , book_genres } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] pub struct Data { pub id : i32 , pub source_id : i32 , pub remote_id : i32 , pub code : String , pub description : String , pub meta : String , $ (pub $ field : crate :: prisma :: genre :: include ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } impl :: serde :: Serialize for Data { fn serialize < S > (& self , serializer : S) -> Result < S :: Ok , S :: Error > where S : :: serde :: Serializer , { use :: serde :: ser :: SerializeStruct ; let mut state = serializer . serialize_struct ("Data" , [$ (stringify ! ($ field) ,) + stringify ! (id) , stringify ! (source_id) , stringify ! (remote_id) , stringify ! (code) , stringify ! (description) , stringify ! (meta)] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: genre :: $ field :: NAME , & self . $ field) ? ;) * state . serialize_field (crate :: prisma :: genre :: id :: NAME , & self . id) ? ; state . serialize_field (crate :: prisma :: genre :: source_id :: NAME , & self . source_id) ? ; state . serialize_field (crate :: prisma :: genre :: remote_id :: NAME , & self . remote_id) ? ; state . serialize_field (crate :: prisma :: genre :: code :: NAME , & self . code) ? ; state . serialize_field (crate :: prisma :: genre :: description :: NAME , & self . description) ? ; state . serialize_field (crate :: prisma :: genre :: meta :: NAME , & self . meta) ? ; state . end () } } impl < 'de > :: serde :: Deserialize < 'de > for Data { fn deserialize < D > (deserializer : D) -> Result < Self , D :: Error > where D : :: serde :: Deserializer < 'de > , { # [allow (warnings)] enum Field { $ ($ field) , + , id , source_id , remote_id , code , description , meta } impl < 'de > :: serde :: Deserialize < 'de > for Field { fn deserialize < D > (deserializer : D) -> Result < Field , D :: Error > where D : :: serde :: Deserializer < 'de > , { struct FieldVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for FieldVisitor { type Value = Field ; fn expecting (& self , formatter : & mut :: std :: fmt :: Formatter) -> :: std :: fmt :: Result { formatter . write_str (& [$ (crate :: prisma :: genre :: $ field :: NAME) , + , crate :: prisma :: genre :: id :: NAME , crate :: prisma :: genre :: source_id :: NAME , crate :: prisma :: genre :: remote_id :: NAME , crate :: prisma :: genre :: code :: NAME , crate :: prisma :: genre :: description :: NAME , crate :: prisma :: genre :: meta :: NAME] . into_iter () . collect :: < Vec < _ >> () . join (", ")) } fn visit_str < E > (self , value : & str) -> Result < Field , E > where E : :: serde :: de :: Error , { match value { $ (crate :: prisma :: genre :: $ field :: NAME => Ok (Field :: $ field)) , * , crate :: prisma :: genre :: id :: NAME => Ok (Field :: id) , crate :: prisma :: genre :: source_id :: NAME => Ok (Field :: source_id) , crate :: prisma :: genre :: remote_id :: NAME => Ok (Field :: remote_id) , crate :: prisma :: genre :: code :: NAME => Ok (Field :: code) , crate :: prisma :: genre :: description :: NAME => Ok (Field :: description) , crate :: prisma :: genre :: meta :: NAME => Ok (Field :: meta) , _ => Err (:: serde :: de :: Error :: unknown_field (value , FIELDS)) , } } } deserializer . deserialize_identifier (FieldVisitor) } } struct DataVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for DataVisitor { type Value = Data ; fn expecting (& self , formatter : & mut std :: fmt :: Formatter) -> std :: fmt :: Result { formatter . write_str ("struct Data") } fn visit_map < V > (self , mut map : V) -> Result < Data , V :: Error > where V : :: serde :: de :: MapAccess < 'de > , { $ (let mut $ field = None ;) * let mut id = None ; let mut source_id = None ; let mut remote_id = None ; let mut code = None ; let mut description = None ; let mut meta = None ; while let Some (key) = map . next_key () ? { match key { Field :: id => { if id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: genre :: id :: NAME)) ; } id = Some (map . next_value () ?) ; } Field :: source_id => { if source_id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: genre :: source_id :: NAME)) ; } source_id = Some (map . next_value () ?) ; } Field :: remote_id => { if remote_id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: genre :: remote_id :: NAME)) ; } remote_id = Some (map . next_value () ?) ; } Field :: code => { if code . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: genre :: code :: NAME)) ; } code = Some (map . next_value () ?) ; } Field :: description => { if description . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: genre :: description :: NAME)) ; } description = Some (map . next_value () ?) ; } Field :: meta => { if meta . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: genre :: meta :: NAME)) ; } meta = Some (map . next_value () ?) ; } $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: genre :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: genre :: $ field :: NAME)) ? ;) * let id = id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: genre :: id :: NAME)) ? ; let source_id = source_id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: genre :: source_id :: NAME)) ? ; let remote_id = remote_id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: genre :: remote_id :: NAME)) ? ; let code = code . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: genre :: code :: NAME)) ? ; let description = description . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: genre :: description :: NAME)) ? ; let meta = meta . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: genre :: meta :: NAME)) ? ; Ok (Data { id , source_id , remote_id , code , description , meta , $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "source_id" , "remote_id" , "code" , "description" , "meta" , "source" , "book_genres"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: genre :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; source : $ selection_mode : ident { $ ($ selections : tt) + }) => { source :: Data } ; (@ field_type ; source) => { crate :: prisma :: source :: Data } ; (@ field_type ; book_genres : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < book_genres :: Data > } ; (@ field_type ; book_genres) => { Vec < crate :: prisma :: book_genre :: Data > } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "Genre" , available relations are "source, book_genres")) } ; (@ field_module ; source : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: source :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; book_genres : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: book_genre :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; source $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: genre :: IncludeParam > :: into (crate :: prisma :: genre :: source :: Include :: $ selection_mode (crate :: prisma :: source :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; source $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: genre :: IncludeParam > :: into (crate :: prisma :: genre :: source :: Include :: Fetch) } } ; (@ selection_field_to_selection_param ; book_genres $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: genre :: IncludeParam > :: into (crate :: prisma :: genre :: book_genres :: Include :: $ selection_mode (crate :: prisma :: book_genre :: ManyArgs :: new (crate :: prisma :: book_genre :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: book_genre :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; book_genres $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: genre :: IncludeParam > :: into (crate :: prisma :: genre :: book_genres :: Include :: Fetch (crate :: prisma :: book_genre :: ManyArgs :: new (crate :: prisma :: book_genre :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; $ ($ tokens : tt) *) => { compile_error ! (stringify ! ($ ($ tokens) *)) } ; (@ selections_to_params ; : $ macro_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { [$ (crate :: prisma :: genre :: $ macro_name ! (@ selection_field_to_selection_param ; $ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) ,) +] } ; (@ filters_to_args ;) => { vec ! [] } ; (@ filters_to_args ; $ ($ t : tt) *) => { $ ($ t) * } ; (@ field_serde_name ; id) => { "id" } ; (@ field_serde_name ; source_id) => { "source_id" } ; (@ field_serde_name ; remote_id) => { "remote_id" } ; (@ field_serde_name ; code) => { "code" } ; (@ field_serde_name ; description) => { "description" } ; (@ field_serde_name ; meta) => { "meta" } ; (@ field_serde_name ; source) => { "source" } ; (@ field_serde_name ; book_genres) => { "book_genres" } ; } - pub use _include_genre as include; - pub enum IncludeParam { - Id(id::Include), - SourceId(source_id::Include), - RemoteId(remote_id::Include), - Code(code::Include), - Description(description::Include), - Meta(meta::Include), - Source(source::Include), - BookGenres(book_genres::Include), - } - impl IncludeParam { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - match self { - Self::Id(data) => data.to_selection(), - Self::SourceId(data) => data.to_selection(), - Self::RemoteId(data) => data.to_selection(), - Self::Code(data) => data.to_selection(), - Self::Description(data) => data.to_selection(), - Self::Meta(data) => data.to_selection(), - Self::Source(data) => data.to_selection(), - Self::BookGenres(data) => data.to_selection(), - } - } - } - #[macro_export] - macro_rules ! _partial_unchecked_genre { ($ struct_name : ident { $ ($ scalar_field : ident) + }) => { :: prisma_client_rust :: macros :: partial_unchecked ! { crate :: prisma :: genre struct $ struct_name { # [serde (rename = "id")] pub id : i32 , # [serde (rename = "source_id")] pub source_id : i32 , # [serde (rename = "remote_id")] pub remote_id : i32 , # [serde (rename = "code")] pub code : String , # [serde (rename = "description")] pub description : String , # [serde (rename = "meta")] pub meta : String } [$ ($ scalar_field) , +] } } ; } - pub use _partial_unchecked_genre as partial_unchecked; - #[derive(Debug, Clone, :: serde :: Serialize, :: serde :: Deserialize)] - pub struct Data { - #[serde(rename = "id")] - pub id: i32, - #[serde(rename = "source_id")] - pub source_id: i32, - #[serde(rename = "remote_id")] - pub remote_id: i32, - #[serde(rename = "code")] - pub code: String, - #[serde(rename = "description")] - pub description: String, - #[serde(rename = "meta")] - pub meta: String, - #[serde(rename = "source")] - pub source: Option>, - #[serde(rename = "book_genres")] - pub book_genres: Option>, - } - impl Data { - pub fn source( - &self, - ) -> Result<&super::source::Data, ::prisma_client_rust::RelationNotFetchedError> { - self.source - .as_ref() - .ok_or(::prisma_client_rust::RelationNotFetchedError::new( - stringify!(source), - )) - .map(|v| v.as_ref()) - } - pub fn book_genres( - &self, - ) -> Result<&Vec, ::prisma_client_rust::RelationNotFetchedError> - { - self.book_genres - .as_ref() - .ok_or(::prisma_client_rust::RelationNotFetchedError::new( - stringify!(book_genres), - )) - } - } - #[derive(Clone)] - pub enum WithParam { - Source(super::source::UniqueArgs), - BookGenres(super::book_genre::ManyArgs), - } - impl Into<::prisma_client_rust::Selection> for WithParam { - fn into(self) -> ::prisma_client_rust::Selection { - match self { - Self::Source(args) => { - let mut selections = < super :: source :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; - selections.extend( - args.with_params - .into_iter() - .map(Into::<::prisma_client_rust::Selection>::into), - ); - ::prisma_client_rust::Selection::new(source::NAME, None, [], selections) - } - Self::BookGenres(args) => { - let (arguments, mut nested_selections) = args.to_graphql(); - nested_selections . extend (< super :: book_genre :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) ; - ::prisma_client_rust::Selection::new( - book_genres::NAME, - None, - arguments, - nested_selections, - ) - } - } - } - } - #[derive(Clone)] - pub enum SetParam { - SetId(i32), - IncrementId(i32), - DecrementId(i32), - MultiplyId(i32), - DivideId(i32), - SetSourceId(i32), - IncrementSourceId(i32), - DecrementSourceId(i32), - MultiplySourceId(i32), - DivideSourceId(i32), - SetRemoteId(i32), - IncrementRemoteId(i32), - DecrementRemoteId(i32), - MultiplyRemoteId(i32), - DivideRemoteId(i32), - SetCode(String), - SetDescription(String), - SetMeta(String), - ConnectSource(super::source::UniqueWhereParam), - ConnectBookGenres(Vec), - DisconnectBookGenres(Vec), - SetBookGenres(Vec), - } - impl From for (String, ::prisma_client_rust::PrismaValue) { - fn from(param: SetParam) -> Self { - match param { - SetParam::SetId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - ), - SetParam::IncrementId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "increment".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DecrementId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "decrement".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::MultiplyId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "multiply".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DivideId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "divide".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::SetSourceId(value) => ( - source_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - ), - SetParam::IncrementSourceId(value) => ( - source_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "increment".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DecrementSourceId(value) => ( - source_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "decrement".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::MultiplySourceId(value) => ( - source_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "multiply".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DivideSourceId(value) => ( - source_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "divide".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::SetRemoteId(value) => ( - remote_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - ), - SetParam::IncrementRemoteId(value) => ( - remote_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "increment".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DecrementRemoteId(value) => ( - remote_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "decrement".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::MultiplyRemoteId(value) => ( - remote_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "multiply".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DivideRemoteId(value) => ( - remote_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "divide".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::SetCode(value) => ( - code::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(value), - ), - SetParam::SetDescription(value) => ( - description::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(value), - ), - SetParam::SetMeta(value) => ( - meta::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(value), - ), - SetParam::ConnectSource(where_param) => ( - source::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "connect".to_string(), - ::prisma_client_rust::PrismaValue::Object( - [where_param] - .into_iter() - .map(Into::::into) - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - SetParam::ConnectBookGenres(where_params) => ( - book_genres::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "connect".to_string(), - ::prisma_client_rust::PrismaValue::List( - where_params - .into_iter() - .map(Into::::into) - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) - .collect(), - ), - )]), - ), - SetParam::DisconnectBookGenres(where_params) => ( - book_genres::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "disconnect".to_string(), - ::prisma_client_rust::PrismaValue::List( - where_params - .into_iter() - .map(Into::::into) - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) - .collect(), - ), - )]), - ), - SetParam::SetBookGenres(where_params) => ( - book_genres::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "set".to_string(), - ::prisma_client_rust::PrismaValue::List( - where_params - .into_iter() - .map(Into::::into) - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) - .collect(), - ), - )]), - ), - } - } - } - #[derive(Clone)] - pub enum UncheckedSetParam { - Id(i32), - SourceId(i32), - RemoteId(i32), - Code(String), - Description(String), - Meta(String), - } - impl From for SetParam { - fn from(param: UncheckedSetParam) -> Self { - match param { - UncheckedSetParam::Id(value) => Self::SetId(value), - UncheckedSetParam::SourceId(value) => Self::SetSourceId(value), - UncheckedSetParam::RemoteId(value) => Self::SetRemoteId(value), - UncheckedSetParam::Code(value) => Self::SetCode(value), - UncheckedSetParam::Description(value) => Self::SetDescription(value), - UncheckedSetParam::Meta(value) => Self::SetMeta(value), - } - } - } - #[derive(Clone)] - pub enum OrderByParam { - Id(::prisma_client_rust::Direction), - SourceId(::prisma_client_rust::Direction), - RemoteId(::prisma_client_rust::Direction), - Code(::prisma_client_rust::Direction), - Description(::prisma_client_rust::Direction), - Meta(::prisma_client_rust::Direction), - } - impl Into<(String, ::prisma_client_rust::PrismaValue)> for OrderByParam { - fn into(self) -> (String, ::prisma_client_rust::PrismaValue) { - match self { - Self::Id(direction) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(direction.to_string()), - ), - Self::SourceId(direction) => ( - source_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(direction.to_string()), - ), - Self::RemoteId(direction) => ( - remote_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(direction.to_string()), - ), - Self::Code(direction) => ( - code::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(direction.to_string()), - ), - Self::Description(direction) => ( - description::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(direction.to_string()), - ), - Self::Meta(direction) => ( - meta::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(direction.to_string()), - ), - } - } - } - #[derive(Clone)] - pub enum WhereParam { - Not(Vec), - Or(Vec), - And(Vec), - SourceIdRemoteIdEquals(i32, i32), - Id(_prisma::read_filters::IntFilter), - SourceId(_prisma::read_filters::IntFilter), - RemoteId(_prisma::read_filters::IntFilter), - Code(_prisma::read_filters::StringFilter), - Description(_prisma::read_filters::StringFilter), - Meta(_prisma::read_filters::StringFilter), - SourceIs(Vec), - SourceIsNot(Vec), - BookGenresSome(Vec), - BookGenresEvery(Vec), - BookGenresNone(Vec), - } - impl ::prisma_client_rust::WhereInput for WhereParam { - fn serialize(self) -> ::prisma_client_rust::SerializedWhereInput { - let (name, value) = match self { - Self::Not(value) => ( - "NOT", - ::prisma_client_rust::SerializedWhereValue::Object( - ::prisma_client_rust::merge_fields( - value - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(Into::into) - .collect(), - ), - ), - ), - Self::Or(value) => ( - "OR", - ::prisma_client_rust::SerializedWhereValue::List( - value - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(Into::into) - .map(|v| vec![v]) - .map(::prisma_client_rust::PrismaValue::Object) - .collect(), - ), - ), - Self::And(value) => ( - "AND", - ::prisma_client_rust::SerializedWhereValue::Object( - ::prisma_client_rust::merge_fields( - value - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(Into::into) - .collect(), - ), - ), - ), - Self::SourceIdRemoteIdEquals(source_id, remote_id) => ( - "source_id_remote_id", - ::prisma_client_rust::SerializedWhereValue::Object(vec![ - ( - source_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Int(source_id as i64), - ), - ( - remote_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Int(remote_id as i64), - ), - ]), - ), - Self::Id(value) => (id::NAME, value.into()), - Self::SourceId(value) => (source_id::NAME, value.into()), - Self::RemoteId(value) => (remote_id::NAME, value.into()), - Self::Code(value) => (code::NAME, value.into()), - Self::Description(value) => (description::NAME, value.into()), - Self::Meta(value) => (meta::NAME, value.into()), - Self::SourceIs(where_params) => ( - source::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "is".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::SourceIsNot(where_params) => ( - source::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "isNot".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::BookGenresSome(where_params) => ( - book_genres::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "some".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::BookGenresEvery(where_params) => ( - book_genres::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "every".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::BookGenresNone(where_params) => ( - book_genres::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "none".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - }; - ::prisma_client_rust::SerializedWhereInput::new(name, value.into()) - } - } - #[derive(Clone)] - pub enum UniqueWhereParam { - SourceIdRemoteIdEquals(i32, i32), - IdEquals(i32), - } - impl From for WhereParam { - fn from(value: UniqueWhereParam) -> Self { - match value { - UniqueWhereParam::SourceIdRemoteIdEquals(source_id, remote_id) => { - Self::SourceIdRemoteIdEquals(source_id, remote_id) - } - UniqueWhereParam::IdEquals(value) => { - Self::Id(_prisma::read_filters::IntFilter::Equals(value)) - } - } - } - } - impl From<::prisma_client_rust::Operator> for WhereParam { - fn from(op: ::prisma_client_rust::Operator) -> Self { - match op { - ::prisma_client_rust::Operator::Not(value) => Self::Not(value), - ::prisma_client_rust::Operator::And(value) => Self::And(value), - ::prisma_client_rust::Operator::Or(value) => Self::Or(value), - } - } - } - #[derive(Clone)] - pub struct Types; - impl ::prisma_client_rust::ModelTypes for Types { - type Data = Data; - type Where = WhereParam; - type UncheckedSet = UncheckedSetParam; - type Set = SetParam; - type With = WithParam; - type OrderBy = OrderByParam; - type Cursor = UniqueWhereParam; - const MODEL: &'static str = NAME; - fn scalar_selections() -> Vec<::prisma_client_rust::Selection> { - vec![ - ::prisma_client_rust::sel(id::NAME), - ::prisma_client_rust::sel(source_id::NAME), - ::prisma_client_rust::sel(remote_id::NAME), - ::prisma_client_rust::sel(code::NAME), - ::prisma_client_rust::sel(description::NAME), - ::prisma_client_rust::sel(meta::NAME), - ] - } - } - pub type UniqueArgs = ::prisma_client_rust::UniqueArgs; - pub type ManyArgs = ::prisma_client_rust::ManyArgs; - pub type Count<'a> = ::prisma_client_rust::Count<'a, Types>; - pub type Create<'a> = ::prisma_client_rust::Create<'a, Types>; - pub type CreateMany<'a> = ::prisma_client_rust::CreateMany<'a, Types>; - pub type FindUnique<'a> = ::prisma_client_rust::FindUnique<'a, Types>; - pub type FindMany<'a> = ::prisma_client_rust::FindMany<'a, Types>; - pub type FindFirst<'a> = ::prisma_client_rust::FindFirst<'a, Types>; - pub type Update<'a> = ::prisma_client_rust::Update<'a, Types>; - pub type UpdateMany<'a> = ::prisma_client_rust::UpdateMany<'a, Types>; - pub type Upsert<'a> = ::prisma_client_rust::Upsert<'a, Types>; - pub type Delete<'a> = ::prisma_client_rust::Delete<'a, Types>; - pub type DeleteMany<'a> = ::prisma_client_rust::DeleteMany<'a, Types>; - #[derive(Clone)] - pub struct Actions<'a> { - pub client: &'a ::prisma_client_rust::PrismaClientInternals, - } - impl<'a> Actions<'a> { - pub fn find_unique(self, _where: UniqueWhereParam) -> FindUnique<'a> { - FindUnique::new(self.client, _where.into()) - } - pub fn find_first(self, _where: Vec) -> FindFirst<'a> { - FindFirst::new(self.client, _where) - } - pub fn find_many(self, _where: Vec) -> FindMany<'a> { - FindMany::new(self.client, _where) - } - pub fn create( - self, - remote_id: i32, - code: String, - description: String, - meta: String, - source: super::source::UniqueWhereParam, - mut _params: Vec, - ) -> Create<'a> { - _params.extend([ - remote_id::set(remote_id), - code::set(code), - description::set(description), - meta::set(meta), - source::connect(source), - ]); - Create::new(self.client, _params) - } - pub fn create_unchecked( - self, - source_id: i32, - remote_id: i32, - code: String, - description: String, - meta: String, - mut _params: Vec, - ) -> Create<'a> { - _params.extend([ - source_id::set(source_id), - remote_id::set(remote_id), - code::set(code), - description::set(description), - meta::set(meta), - ]); - Create::new(self.client, _params.into_iter().map(Into::into).collect()) - } - pub fn create_many( - self, - data: Vec<(i32, i32, String, String, String, Vec)>, - ) -> CreateMany<'a> { - let data = data - .into_iter() - .map( - |(source_id, remote_id, code, description, meta, mut _params)| { - _params.extend([ - source_id::set(source_id), - remote_id::set(remote_id), - code::set(code), - description::set(description), - meta::set(meta), - ]); - _params - }, - ) - .collect(); - CreateMany::new(self.client, data) - } - pub fn update(self, _where: UniqueWhereParam, _params: Vec) -> Update<'a> { - Update::new(self.client, _where.into(), _params, vec![]) - } - pub fn update_unchecked( - self, - _where: UniqueWhereParam, - _params: Vec, - ) -> Update<'a> { - Update::new( - self.client, - _where.into(), - _params.into_iter().map(Into::into).collect(), - vec![], - ) - } - pub fn update_many( - self, - _where: Vec, - _params: Vec, - ) -> UpdateMany<'a> { - UpdateMany::new(self.client, _where, _params) - } - pub fn upsert( - self, - _where: UniqueWhereParam, - (remote_id, code, description, meta, source, mut _params): ( - i32, - String, - String, - String, - super::source::UniqueWhereParam, - Vec, - ), - _update: Vec, - ) -> Upsert<'a> { - _params.extend([ - remote_id::set(remote_id), - code::set(code), - description::set(description), - meta::set(meta), - source::connect(source), - ]); - Upsert::new(self.client, _where.into(), _params, _update) - } - pub fn delete(self, _where: UniqueWhereParam) -> Delete<'a> { - Delete::new(self.client, _where.into(), vec![]) - } - pub fn delete_many(self, _where: Vec) -> DeleteMany<'a> { - DeleteMany::new(self.client, _where) - } - pub fn count(self, _where: Vec) -> Count<'a> { - Count::new(self.client, _where) - } - } -} -pub mod sequence { - - use super::*; - pub const NAME: &str = "Sequence"; - pub mod id { - use super::super::*; - - use super::{OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam}; - pub const NAME: &str = "id"; - pub struct Set(pub i32); - impl From for SetParam { - fn from(Set(v): Set) -> Self { - Self::SetId(v) - } - } - impl From for UncheckedSetParam { - fn from(Set(v): Set) -> Self { - Self::Id(v) - } - } - pub fn set>(value: i32) -> T { - Set(value).into() - } - pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { - OrderByParam::Id(direction) - } - pub fn equals>(value: i32) -> T { - UniqueWhereParam::IdEquals(value).into() - } - ::prisma_client_rust::scalar_where_param_fns!(_prisma::read_filters::IntFilter, Id, { - fn in_vec(_: Vec) -> InVec; - fn not_in_vec(_: Vec) -> NotInVec; - fn lt(_: i32) -> Lt; - fn lte(_: i32) -> Lte; - fn gt(_: i32) -> Gt; - fn gte(_: i32) -> Gte; - fn not(_: i32) -> Not; - }); - pub fn increment(value: i32) -> SetParam { - SetParam::IncrementId(value) - } - pub fn decrement(value: i32) -> SetParam { - SetParam::DecrementId(value) - } - pub fn multiply(value: i32) -> SetParam { - SetParam::MultiplyId(value) - } - pub fn divide(value: i32) -> SetParam { - SetParam::DivideId(value) - } - pub struct Include; - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::Id(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - pub struct Select; - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::Id(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - } - pub mod source_id { - use super::super::*; - - use super::{OrderByParam, SetParam, UncheckedSetParam, WhereParam}; - pub const NAME: &str = "source_id"; - pub struct Set(pub i32); - impl From for SetParam { - fn from(Set(v): Set) -> Self { - Self::SetSourceId(v) - } - } - impl From for UncheckedSetParam { - fn from(Set(v): Set) -> Self { - Self::SourceId(v) - } - } - pub fn set>(value: i32) -> T { - Set(value).into() - } - pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { - OrderByParam::SourceId(direction) - } - pub fn equals(value: i32) -> WhereParam { - WhereParam::SourceId(_prisma::read_filters::IntFilter::Equals(value)) - } - ::prisma_client_rust::scalar_where_param_fns!( - _prisma::read_filters::IntFilter, - SourceId, - { - fn in_vec(_: Vec) -> InVec; - fn not_in_vec(_: Vec) -> NotInVec; - fn lt(_: i32) -> Lt; - fn lte(_: i32) -> Lte; - fn gt(_: i32) -> Gt; - fn gte(_: i32) -> Gte; - fn not(_: i32) -> Not; - } - ); - pub fn increment(value: i32) -> SetParam { - SetParam::IncrementSourceId(value) - } - pub fn decrement(value: i32) -> SetParam { - SetParam::DecrementSourceId(value) - } - pub fn multiply(value: i32) -> SetParam { - SetParam::MultiplySourceId(value) - } - pub fn divide(value: i32) -> SetParam { - SetParam::DivideSourceId(value) - } - pub struct Include; - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::SourceId(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - pub struct Select; - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::SourceId(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - } - pub mod remote_id { - use super::super::*; - - use super::{OrderByParam, SetParam, UncheckedSetParam, WhereParam}; - pub const NAME: &str = "remote_id"; - pub struct Set(pub i32); - impl From for SetParam { - fn from(Set(v): Set) -> Self { - Self::SetRemoteId(v) - } - } - impl From for UncheckedSetParam { - fn from(Set(v): Set) -> Self { - Self::RemoteId(v) - } - } - pub fn set>(value: i32) -> T { - Set(value).into() - } - pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { - OrderByParam::RemoteId(direction) - } - pub fn equals(value: i32) -> WhereParam { - WhereParam::RemoteId(_prisma::read_filters::IntFilter::Equals(value)) - } - ::prisma_client_rust::scalar_where_param_fns!( - _prisma::read_filters::IntFilter, - RemoteId, - { - fn in_vec(_: Vec) -> InVec; - fn not_in_vec(_: Vec) -> NotInVec; - fn lt(_: i32) -> Lt; - fn lte(_: i32) -> Lte; - fn gt(_: i32) -> Gt; - fn gte(_: i32) -> Gte; - fn not(_: i32) -> Not; - } - ); - pub fn increment(value: i32) -> SetParam { - SetParam::IncrementRemoteId(value) - } - pub fn decrement(value: i32) -> SetParam { - SetParam::DecrementRemoteId(value) - } - pub fn multiply(value: i32) -> SetParam { - SetParam::MultiplyRemoteId(value) - } - pub fn divide(value: i32) -> SetParam { - SetParam::DivideRemoteId(value) - } - pub struct Include; - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::RemoteId(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - pub struct Select; - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::RemoteId(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - } - pub mod name { - use super::super::*; - - use super::{OrderByParam, SetParam, UncheckedSetParam, WhereParam}; - pub const NAME: &str = "name"; - pub struct Set(pub String); - impl From for SetParam { - fn from(Set(v): Set) -> Self { - Self::SetName(v) - } - } - impl From for UncheckedSetParam { - fn from(Set(v): Set) -> Self { - Self::Name(v) - } - } - pub fn set>(value: String) -> T { - Set(value).into() - } - pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { - OrderByParam::Name(direction) - } - pub fn equals(value: String) -> WhereParam { - WhereParam::Name(_prisma::read_filters::StringFilter::Equals(value)) - } - ::prisma_client_rust::scalar_where_param_fns!(_prisma::read_filters::StringFilter, Name, { - fn in_vec(_: Vec) -> InVec; - fn not_in_vec(_: Vec) -> NotInVec; - fn lt(_: String) -> Lt; - fn lte(_: String) -> Lte; - fn gt(_: String) -> Gt; - fn gte(_: String) -> Gte; - fn contains(_: String) -> Contains; - fn starts_with(_: String) -> StartsWith; - fn ends_with(_: String) -> EndsWith; - fn mode(_: super::super::QueryMode) -> Mode; - fn not(_: String) -> Not; - }); - pub struct Include; - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::Name(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - pub struct Select; - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::Name(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - } - pub mod source { - use super::super::*; - - use super::{SetParam, WhereParam, WithParam}; - pub const NAME: &str = "source"; - pub struct Fetch(pub source::UniqueArgs); - impl Fetch { - pub fn with(mut self, params: impl Into) -> Self { - self.0 = self.0.with(params.into()); - self - } - } - impl From for WithParam { - fn from(Fetch(v): Fetch) -> Self { - WithParam::Source(v) - } - } - pub fn fetch() -> Fetch { - Fetch(source::UniqueArgs::new()) - } - pub struct Connect(source::UniqueWhereParam); - impl From for SetParam { - fn from(Connect(v): Connect) -> Self { - Self::ConnectSource(v) - } - } - pub fn connect>(value: source::UniqueWhereParam) -> T { - Connect(value).into() - } - pub fn is(value: Vec) -> WhereParam { - WhereParam::SourceIs(value) - } - pub fn is_not(value: Vec) -> WhereParam { - WhereParam::SourceIsNot(value) - } - pub enum Include { - Select(Vec), - Include(Vec), - Fetch, - } - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::Source(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let selections = match self { - Self::Select(selections) => { - selections.into_iter().map(|s| s.to_selection()).collect() - } - Self::Include(selections) => { - let mut nested_selections = - ::scalar_selections( - ); - nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); - nested_selections - } - Self::Fetch => { - ::scalar_selections() - } - }; - ::prisma_client_rust::Selection::new("source", None, [], selections) - } - pub fn select(nested_selections: Vec) -> Self { - Self::Select(nested_selections) - } - pub fn include(nested_selections: Vec) -> Self { - Self::Include(nested_selections) - } - } - pub enum Select { - Select(Vec), - Include(Vec), - Fetch, - } - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::Source(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let selections = match self { - Self::Select(selections) => { - selections.into_iter().map(|s| s.to_selection()).collect() - } - Self::Include(selections) => { - let mut nested_selections = vec![]; - nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); - nested_selections - } - Self::Fetch => { - ::scalar_selections() - } - }; - ::prisma_client_rust::Selection::new("source", None, [], selections) - } - pub fn select(nested_selections: Vec) -> Self { - Self::Select(nested_selections) - } - pub fn include(nested_selections: Vec) -> Self { - Self::Include(nested_selections) - } - } - } - pub mod book_sequences { - use super::super::*; - - use super::{SetParam, WhereParam, WithParam}; - pub const NAME: &str = "book_sequences"; - pub struct Fetch(pub book_sequence::ManyArgs); - impl Fetch { - pub fn with(mut self, params: impl Into) -> Self { - self.0 = self.0.with(params.into()); - self - } - pub fn order_by(mut self, param: book_sequence::OrderByParam) -> Self { - self.0 = self.0.order_by(param); - self - } - pub fn skip(mut self, value: i64) -> Self { - self.0 = self.0.skip(value); - self - } - pub fn take(mut self, value: i64) -> Self { - self.0 = self.0.take(value); - self - } - pub fn cursor(mut self, value: book_sequence::UniqueWhereParam) -> Self { - self.0 = self.0.cursor(value.into()); - self - } - } - impl From for WithParam { - fn from(Fetch(v): Fetch) -> Self { - WithParam::BookSequences(v) - } - } - pub fn fetch(params: Vec) -> Fetch { - Fetch(book_sequence::ManyArgs::new(params)) - } - pub struct Connect(pub Vec); - impl From for SetParam { - fn from(Connect(v): Connect) -> Self { - Self::ConnectBookSequences(v) - } - } - pub fn connect>(params: Vec) -> T { - Connect(params).into() - } - pub fn disconnect(params: Vec) -> SetParam { - SetParam::DisconnectBookSequences(params) - } - pub fn set(params: Vec) -> SetParam { - SetParam::SetBookSequences(params) - } - pub fn some(value: Vec) -> WhereParam { - WhereParam::BookSequencesSome(value) - } - pub fn every(value: Vec) -> WhereParam { - WhereParam::BookSequencesEvery(value) - } - pub fn none(value: Vec) -> WhereParam { - WhereParam::BookSequencesNone(value) - } - pub enum Include { - Select(book_sequence::ManyArgs, Vec), - Include(book_sequence::ManyArgs, Vec), - Fetch(book_sequence::ManyArgs), - } - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::BookSequences(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let (args , selections) = match self { Self :: Select (args , selections) => (args . to_graphql () . 0 , selections . into_iter () . map (| s | s . to_selection ()) . collect ()) , Self :: Include (args , selections) => (args . to_graphql () . 0 , { let mut nested_selections = < book_sequence :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections }) , Self :: Fetch (args) => (args . to_graphql () . 0 , < book_sequence :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) } ; - ::prisma_client_rust::Selection::new(NAME, None, args, selections) - } - pub fn select( - args: book_sequence::ManyArgs, - nested_selections: Vec, - ) -> Self { - Self::Select(args, nested_selections) - } - pub fn include( - args: book_sequence::ManyArgs, - nested_selections: Vec, - ) -> Self { - Self::Include(args, nested_selections) - } - } - pub enum Select { - Select(book_sequence::ManyArgs, Vec), - Include(book_sequence::ManyArgs, Vec), - Fetch(book_sequence::ManyArgs), - } - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::BookSequences(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let (args , selections) = match self { Self :: Select (args , selections) => (args . to_graphql () . 0 , selections . into_iter () . map (| s | s . to_selection ()) . collect ()) , Self :: Include (args , selections) => (args . to_graphql () . 0 , { let mut nested_selections = vec ! [] ; nested_selections . extend (selections . into_iter () . map (| s | s . to_selection ())) ; nested_selections }) , Self :: Fetch (args) => (args . to_graphql () . 0 , < book_sequence :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) } ; - ::prisma_client_rust::Selection::new(NAME, None, args, selections) - } - pub fn select( - args: book_sequence::ManyArgs, - nested_selections: Vec, - ) -> Self { - Self::Select(args, nested_selections) - } - pub fn include( - args: book_sequence::ManyArgs, - nested_selections: Vec, - ) -> Self { - Self::Include(args, nested_selections) - } - } - } - pub fn source_id_remote_id>(source_id: i32, remote_id: i32) -> T { - UniqueWhereParam::SourceIdRemoteIdEquals(source_id, remote_id).into() - } - pub fn create( - remote_id: i32, - name: String, - source: super::source::UniqueWhereParam, - _params: Vec, - ) -> (i32, String, super::source::UniqueWhereParam, Vec) { - (remote_id, name, source, _params) - } - pub fn create_unchecked( - source_id: i32, - remote_id: i32, - name: String, - _params: Vec, - ) -> (i32, i32, String, Vec) { - (source_id, remote_id, name, _params) - } - #[macro_export] - macro_rules ! _select_sequence { ($ (($ ($ func_arg : ident : $ func_arg_ty : ty) , +) =>) ? $ module_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { # [allow (warnings)] pub mod $ module_name { crate :: prisma :: sequence :: select ! (@ definitions ; $ module_name ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; use super :: * ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: SelectType for Selection { type Data = Data ; type ModelData = crate :: prisma :: sequence :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn select ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: sequence :: select ! (@ selections_to_params ; : select { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () ,] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } } ; ({ $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { { crate :: prisma :: sequence :: select ! (@ definitions ; ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: SelectType for Selection { type Data = Data ; type ModelData = crate :: prisma :: sequence :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: sequence :: select ! (@ selections_to_params ; : select { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () ,] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } ; (@ definitions ; $ ($ module_name : ident) ? ; $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) +) => { # [allow (warnings)] enum Fields { id , source_id , remote_id , name , source , book_sequences } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] pub struct Data { $ (pub $ field : crate :: prisma :: sequence :: select ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } impl :: serde :: Serialize for Data { fn serialize < S > (& self , serializer : S) -> Result < S :: Ok , S :: Error > where S : :: serde :: Serializer , { use :: serde :: ser :: SerializeStruct ; let mut state = serializer . serialize_struct ("Data" , [$ (stringify ! ($ field) ,) +] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: sequence :: $ field :: NAME , & self . $ field) ? ;) * state . end () } } impl < 'de > :: serde :: Deserialize < 'de > for Data { fn deserialize < D > (deserializer : D) -> Result < Self , D :: Error > where D : :: serde :: Deserializer < 'de > , { # [allow (warnings)] enum Field { $ ($ field) , + , } impl < 'de > :: serde :: Deserialize < 'de > for Field { fn deserialize < D > (deserializer : D) -> Result < Field , D :: Error > where D : :: serde :: Deserializer < 'de > , { struct FieldVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for FieldVisitor { type Value = Field ; fn expecting (& self , formatter : & mut :: std :: fmt :: Formatter) -> :: std :: fmt :: Result { formatter . write_str (& [$ (crate :: prisma :: sequence :: $ field :: NAME) , + ,] . into_iter () . collect :: < Vec < _ >> () . join (", ")) } fn visit_str < E > (self , value : & str) -> Result < Field , E > where E : :: serde :: de :: Error , { match value { $ (crate :: prisma :: sequence :: $ field :: NAME => Ok (Field :: $ field)) , * , _ => Err (:: serde :: de :: Error :: unknown_field (value , FIELDS)) , } } } deserializer . deserialize_identifier (FieldVisitor) } } struct DataVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for DataVisitor { type Value = Data ; fn expecting (& self , formatter : & mut std :: fmt :: Formatter) -> std :: fmt :: Result { formatter . write_str ("struct Data") } fn visit_map < V > (self , mut map : V) -> Result < Data , V :: Error > where V : :: serde :: de :: MapAccess < 'de > , { $ (let mut $ field = None ;) * while let Some (key) = map . next_key () ? { match key { $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: sequence :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: sequence :: $ field :: NAME)) ? ;) * Ok (Data { $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "source_id" , "remote_id" , "name" , "source" , "book_sequences"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: sequence :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; id) => { i32 } ; (@ field_type ; source_id) => { i32 } ; (@ field_type ; remote_id) => { i32 } ; (@ field_type ; name) => { String } ; (@ field_type ; source : $ selection_mode : ident { $ ($ selections : tt) + }) => { source :: Data } ; (@ field_type ; source) => { crate :: prisma :: source :: Data } ; (@ field_type ; book_sequences : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < book_sequences :: Data > } ; (@ field_type ; book_sequences) => { Vec < crate :: prisma :: book_sequence :: Data > } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "Sequence" , available relations are "id, source_id, remote_id, name, source, book_sequences")) } ; (@ field_module ; source : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: source :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; book_sequences : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: book_sequence :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; id) => { Into :: < crate :: prisma :: sequence :: SelectParam > :: into (crate :: prisma :: sequence :: id :: Select) } ; (@ selection_field_to_selection_param ; source_id) => { Into :: < crate :: prisma :: sequence :: SelectParam > :: into (crate :: prisma :: sequence :: source_id :: Select) } ; (@ selection_field_to_selection_param ; remote_id) => { Into :: < crate :: prisma :: sequence :: SelectParam > :: into (crate :: prisma :: sequence :: remote_id :: Select) } ; (@ selection_field_to_selection_param ; name) => { Into :: < crate :: prisma :: sequence :: SelectParam > :: into (crate :: prisma :: sequence :: name :: Select) } ; (@ selection_field_to_selection_param ; source $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: sequence :: SelectParam > :: into (crate :: prisma :: sequence :: source :: Select :: $ selection_mode (crate :: prisma :: source :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; source $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: sequence :: SelectParam > :: into (crate :: prisma :: sequence :: source :: Select :: Fetch) } } ; (@ selection_field_to_selection_param ; book_sequences $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: sequence :: SelectParam > :: into (crate :: prisma :: sequence :: book_sequences :: Select :: $ selection_mode (crate :: prisma :: book_sequence :: ManyArgs :: new (crate :: prisma :: book_sequence :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: book_sequence :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; book_sequences $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: sequence :: SelectParam > :: into (crate :: prisma :: sequence :: book_sequences :: Select :: Fetch (crate :: prisma :: book_sequence :: ManyArgs :: new (crate :: prisma :: book_sequence :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; $ ($ tokens : tt) *) => { compile_error ! (stringify ! ($ ($ tokens) *)) } ; (@ selections_to_params ; : $ macro_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { [$ (crate :: prisma :: sequence :: $ macro_name ! (@ selection_field_to_selection_param ; $ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) ,) +] } ; (@ filters_to_args ;) => { vec ! [] } ; (@ filters_to_args ; $ ($ t : tt) *) => { $ ($ t) * } ; (@ field_serde_name ; id) => { "id" } ; (@ field_serde_name ; source_id) => { "source_id" } ; (@ field_serde_name ; remote_id) => { "remote_id" } ; (@ field_serde_name ; name) => { "name" } ; (@ field_serde_name ; source) => { "source" } ; (@ field_serde_name ; book_sequences) => { "book_sequences" } ; } - pub use _select_sequence as select; - pub enum SelectParam { - Id(id::Select), - SourceId(source_id::Select), - RemoteId(remote_id::Select), - Name(name::Select), - Source(source::Select), - BookSequences(book_sequences::Select), - } - impl SelectParam { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - match self { - Self::Id(data) => data.to_selection(), - Self::SourceId(data) => data.to_selection(), - Self::RemoteId(data) => data.to_selection(), - Self::Name(data) => data.to_selection(), - Self::Source(data) => data.to_selection(), - Self::BookSequences(data) => data.to_selection(), - } - } - } - #[macro_export] - macro_rules ! _include_sequence { ($ (($ ($ func_arg : ident : $ func_arg_ty : ty) , +) =>) ? $ module_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { # [allow (warnings)] pub mod $ module_name { crate :: prisma :: sequence :: include ! (@ definitions ; $ module_name ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; use super :: * ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: IncludeType for Selection { type Data = Data ; type ModelData = crate :: prisma :: sequence :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn include ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: sequence :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: sequence :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } } ; ({ $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { { crate :: prisma :: sequence :: include ! (@ definitions ; ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: IncludeType for Selection { type Data = Data ; type ModelData = crate :: prisma :: sequence :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: sequence :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: sequence :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } ; (@ definitions ; $ ($ module_name : ident) ? ; $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) +) => { # [allow (warnings)] enum Fields { source , book_sequences } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] pub struct Data { pub id : i32 , pub source_id : i32 , pub remote_id : i32 , pub name : String , $ (pub $ field : crate :: prisma :: sequence :: include ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } impl :: serde :: Serialize for Data { fn serialize < S > (& self , serializer : S) -> Result < S :: Ok , S :: Error > where S : :: serde :: Serializer , { use :: serde :: ser :: SerializeStruct ; let mut state = serializer . serialize_struct ("Data" , [$ (stringify ! ($ field) ,) + stringify ! (id) , stringify ! (source_id) , stringify ! (remote_id) , stringify ! (name)] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: sequence :: $ field :: NAME , & self . $ field) ? ;) * state . serialize_field (crate :: prisma :: sequence :: id :: NAME , & self . id) ? ; state . serialize_field (crate :: prisma :: sequence :: source_id :: NAME , & self . source_id) ? ; state . serialize_field (crate :: prisma :: sequence :: remote_id :: NAME , & self . remote_id) ? ; state . serialize_field (crate :: prisma :: sequence :: name :: NAME , & self . name) ? ; state . end () } } impl < 'de > :: serde :: Deserialize < 'de > for Data { fn deserialize < D > (deserializer : D) -> Result < Self , D :: Error > where D : :: serde :: Deserializer < 'de > , { # [allow (warnings)] enum Field { $ ($ field) , + , id , source_id , remote_id , name } impl < 'de > :: serde :: Deserialize < 'de > for Field { fn deserialize < D > (deserializer : D) -> Result < Field , D :: Error > where D : :: serde :: Deserializer < 'de > , { struct FieldVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for FieldVisitor { type Value = Field ; fn expecting (& self , formatter : & mut :: std :: fmt :: Formatter) -> :: std :: fmt :: Result { formatter . write_str (& [$ (crate :: prisma :: sequence :: $ field :: NAME) , + , crate :: prisma :: sequence :: id :: NAME , crate :: prisma :: sequence :: source_id :: NAME , crate :: prisma :: sequence :: remote_id :: NAME , crate :: prisma :: sequence :: name :: NAME] . into_iter () . collect :: < Vec < _ >> () . join (", ")) } fn visit_str < E > (self , value : & str) -> Result < Field , E > where E : :: serde :: de :: Error , { match value { $ (crate :: prisma :: sequence :: $ field :: NAME => Ok (Field :: $ field)) , * , crate :: prisma :: sequence :: id :: NAME => Ok (Field :: id) , crate :: prisma :: sequence :: source_id :: NAME => Ok (Field :: source_id) , crate :: prisma :: sequence :: remote_id :: NAME => Ok (Field :: remote_id) , crate :: prisma :: sequence :: name :: NAME => Ok (Field :: name) , _ => Err (:: serde :: de :: Error :: unknown_field (value , FIELDS)) , } } } deserializer . deserialize_identifier (FieldVisitor) } } struct DataVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for DataVisitor { type Value = Data ; fn expecting (& self , formatter : & mut std :: fmt :: Formatter) -> std :: fmt :: Result { formatter . write_str ("struct Data") } fn visit_map < V > (self , mut map : V) -> Result < Data , V :: Error > where V : :: serde :: de :: MapAccess < 'de > , { $ (let mut $ field = None ;) * let mut id = None ; let mut source_id = None ; let mut remote_id = None ; let mut name = None ; while let Some (key) = map . next_key () ? { match key { Field :: id => { if id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: sequence :: id :: NAME)) ; } id = Some (map . next_value () ?) ; } Field :: source_id => { if source_id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: sequence :: source_id :: NAME)) ; } source_id = Some (map . next_value () ?) ; } Field :: remote_id => { if remote_id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: sequence :: remote_id :: NAME)) ; } remote_id = Some (map . next_value () ?) ; } Field :: name => { if name . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: sequence :: name :: NAME)) ; } name = Some (map . next_value () ?) ; } $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: sequence :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: sequence :: $ field :: NAME)) ? ;) * let id = id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: sequence :: id :: NAME)) ? ; let source_id = source_id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: sequence :: source_id :: NAME)) ? ; let remote_id = remote_id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: sequence :: remote_id :: NAME)) ? ; let name = name . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: sequence :: name :: NAME)) ? ; Ok (Data { id , source_id , remote_id , name , $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "source_id" , "remote_id" , "name" , "source" , "book_sequences"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: sequence :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; source : $ selection_mode : ident { $ ($ selections : tt) + }) => { source :: Data } ; (@ field_type ; source) => { crate :: prisma :: source :: Data } ; (@ field_type ; book_sequences : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < book_sequences :: Data > } ; (@ field_type ; book_sequences) => { Vec < crate :: prisma :: book_sequence :: Data > } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "Sequence" , available relations are "source, book_sequences")) } ; (@ field_module ; source : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: source :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; book_sequences : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: book_sequence :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; source $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: sequence :: IncludeParam > :: into (crate :: prisma :: sequence :: source :: Include :: $ selection_mode (crate :: prisma :: source :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; source $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: sequence :: IncludeParam > :: into (crate :: prisma :: sequence :: source :: Include :: Fetch) } } ; (@ selection_field_to_selection_param ; book_sequences $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: sequence :: IncludeParam > :: into (crate :: prisma :: sequence :: book_sequences :: Include :: $ selection_mode (crate :: prisma :: book_sequence :: ManyArgs :: new (crate :: prisma :: book_sequence :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: book_sequence :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; book_sequences $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: sequence :: IncludeParam > :: into (crate :: prisma :: sequence :: book_sequences :: Include :: Fetch (crate :: prisma :: book_sequence :: ManyArgs :: new (crate :: prisma :: book_sequence :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; $ ($ tokens : tt) *) => { compile_error ! (stringify ! ($ ($ tokens) *)) } ; (@ selections_to_params ; : $ macro_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { [$ (crate :: prisma :: sequence :: $ macro_name ! (@ selection_field_to_selection_param ; $ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) ,) +] } ; (@ filters_to_args ;) => { vec ! [] } ; (@ filters_to_args ; $ ($ t : tt) *) => { $ ($ t) * } ; (@ field_serde_name ; id) => { "id" } ; (@ field_serde_name ; source_id) => { "source_id" } ; (@ field_serde_name ; remote_id) => { "remote_id" } ; (@ field_serde_name ; name) => { "name" } ; (@ field_serde_name ; source) => { "source" } ; (@ field_serde_name ; book_sequences) => { "book_sequences" } ; } - pub use _include_sequence as include; - pub enum IncludeParam { - Id(id::Include), - SourceId(source_id::Include), - RemoteId(remote_id::Include), - Name(name::Include), - Source(source::Include), - BookSequences(book_sequences::Include), - } - impl IncludeParam { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - match self { - Self::Id(data) => data.to_selection(), - Self::SourceId(data) => data.to_selection(), - Self::RemoteId(data) => data.to_selection(), - Self::Name(data) => data.to_selection(), - Self::Source(data) => data.to_selection(), - Self::BookSequences(data) => data.to_selection(), - } - } - } - #[macro_export] - macro_rules ! _partial_unchecked_sequence { ($ struct_name : ident { $ ($ scalar_field : ident) + }) => { :: prisma_client_rust :: macros :: partial_unchecked ! { crate :: prisma :: sequence struct $ struct_name { # [serde (rename = "id")] pub id : i32 , # [serde (rename = "source_id")] pub source_id : i32 , # [serde (rename = "remote_id")] pub remote_id : i32 , # [serde (rename = "name")] pub name : String } [$ ($ scalar_field) , +] } } ; } - pub use _partial_unchecked_sequence as partial_unchecked; - #[derive(Debug, Clone, :: serde :: Serialize, :: serde :: Deserialize)] - pub struct Data { - #[serde(rename = "id")] - pub id: i32, - #[serde(rename = "source_id")] - pub source_id: i32, - #[serde(rename = "remote_id")] - pub remote_id: i32, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "source")] - pub source: Option>, - #[serde(rename = "book_sequences")] - pub book_sequences: Option>, - } - impl Data { - pub fn source( - &self, - ) -> Result<&super::source::Data, ::prisma_client_rust::RelationNotFetchedError> { - self.source - .as_ref() - .ok_or(::prisma_client_rust::RelationNotFetchedError::new( - stringify!(source), - )) - .map(|v| v.as_ref()) - } - pub fn book_sequences( - &self, - ) -> Result<&Vec, ::prisma_client_rust::RelationNotFetchedError> - { - self.book_sequences - .as_ref() - .ok_or(::prisma_client_rust::RelationNotFetchedError::new( - stringify!(book_sequences), - )) - } - } - #[derive(Clone)] - pub enum WithParam { - Source(super::source::UniqueArgs), - BookSequences(super::book_sequence::ManyArgs), - } - impl Into<::prisma_client_rust::Selection> for WithParam { - fn into(self) -> ::prisma_client_rust::Selection { - match self { - Self::Source(args) => { - let mut selections = < super :: source :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; - selections.extend( - args.with_params - .into_iter() - .map(Into::<::prisma_client_rust::Selection>::into), - ); - ::prisma_client_rust::Selection::new(source::NAME, None, [], selections) - } - Self::BookSequences(args) => { - let (arguments, mut nested_selections) = args.to_graphql(); - nested_selections . extend (< super :: book_sequence :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) ; - ::prisma_client_rust::Selection::new( - book_sequences::NAME, - None, - arguments, - nested_selections, - ) - } - } - } - } - #[derive(Clone)] - pub enum SetParam { - SetId(i32), - IncrementId(i32), - DecrementId(i32), - MultiplyId(i32), - DivideId(i32), - SetSourceId(i32), - IncrementSourceId(i32), - DecrementSourceId(i32), - MultiplySourceId(i32), - DivideSourceId(i32), - SetRemoteId(i32), - IncrementRemoteId(i32), - DecrementRemoteId(i32), - MultiplyRemoteId(i32), - DivideRemoteId(i32), - SetName(String), - ConnectSource(super::source::UniqueWhereParam), - ConnectBookSequences(Vec), - DisconnectBookSequences(Vec), - SetBookSequences(Vec), - } - impl From for (String, ::prisma_client_rust::PrismaValue) { - fn from(param: SetParam) -> Self { - match param { - SetParam::SetId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - ), - SetParam::IncrementId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "increment".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DecrementId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "decrement".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::MultiplyId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "multiply".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DivideId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "divide".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::SetSourceId(value) => ( - source_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - ), - SetParam::IncrementSourceId(value) => ( - source_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "increment".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DecrementSourceId(value) => ( - source_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "decrement".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::MultiplySourceId(value) => ( - source_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "multiply".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DivideSourceId(value) => ( - source_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "divide".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::SetRemoteId(value) => ( - remote_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - ), - SetParam::IncrementRemoteId(value) => ( - remote_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "increment".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DecrementRemoteId(value) => ( - remote_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "decrement".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::MultiplyRemoteId(value) => ( - remote_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "multiply".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DivideRemoteId(value) => ( - remote_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "divide".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::SetName(value) => ( - name::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(value), - ), - SetParam::ConnectSource(where_param) => ( - source::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "connect".to_string(), - ::prisma_client_rust::PrismaValue::Object( - [where_param] - .into_iter() - .map(Into::::into) - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - SetParam::ConnectBookSequences(where_params) => ( - book_sequences::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "connect".to_string(), - ::prisma_client_rust::PrismaValue::List( - where_params - .into_iter() - .map(Into::::into) - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) - .collect(), - ), - )]), - ), - SetParam::DisconnectBookSequences(where_params) => ( - book_sequences::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "disconnect".to_string(), - ::prisma_client_rust::PrismaValue::List( - where_params - .into_iter() - .map(Into::::into) - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) - .collect(), - ), - )]), - ), - SetParam::SetBookSequences(where_params) => ( - book_sequences::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "set".to_string(), - ::prisma_client_rust::PrismaValue::List( - where_params - .into_iter() - .map(Into::::into) - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) - .collect(), - ), - )]), - ), - } - } - } - #[derive(Clone)] - pub enum UncheckedSetParam { - Id(i32), - SourceId(i32), - RemoteId(i32), - Name(String), - } - impl From for SetParam { - fn from(param: UncheckedSetParam) -> Self { - match param { - UncheckedSetParam::Id(value) => Self::SetId(value), - UncheckedSetParam::SourceId(value) => Self::SetSourceId(value), - UncheckedSetParam::RemoteId(value) => Self::SetRemoteId(value), - UncheckedSetParam::Name(value) => Self::SetName(value), - } - } - } - #[derive(Clone)] - pub enum OrderByParam { - Id(::prisma_client_rust::Direction), - SourceId(::prisma_client_rust::Direction), - RemoteId(::prisma_client_rust::Direction), - Name(::prisma_client_rust::Direction), - } - impl Into<(String, ::prisma_client_rust::PrismaValue)> for OrderByParam { - fn into(self) -> (String, ::prisma_client_rust::PrismaValue) { - match self { - Self::Id(direction) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(direction.to_string()), - ), - Self::SourceId(direction) => ( - source_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(direction.to_string()), - ), - Self::RemoteId(direction) => ( - remote_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(direction.to_string()), - ), - Self::Name(direction) => ( - name::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(direction.to_string()), - ), - } - } - } - #[derive(Clone)] - pub enum WhereParam { - Not(Vec), - Or(Vec), - And(Vec), - SourceIdRemoteIdEquals(i32, i32), - Id(_prisma::read_filters::IntFilter), - SourceId(_prisma::read_filters::IntFilter), - RemoteId(_prisma::read_filters::IntFilter), - Name(_prisma::read_filters::StringFilter), - SourceIs(Vec), - SourceIsNot(Vec), - BookSequencesSome(Vec), - BookSequencesEvery(Vec), - BookSequencesNone(Vec), - } - impl ::prisma_client_rust::WhereInput for WhereParam { - fn serialize(self) -> ::prisma_client_rust::SerializedWhereInput { - let (name, value) = match self { - Self::Not(value) => ( - "NOT", - ::prisma_client_rust::SerializedWhereValue::Object( - ::prisma_client_rust::merge_fields( - value - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(Into::into) - .collect(), - ), - ), - ), - Self::Or(value) => ( - "OR", - ::prisma_client_rust::SerializedWhereValue::List( - value - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(Into::into) - .map(|v| vec![v]) - .map(::prisma_client_rust::PrismaValue::Object) - .collect(), - ), - ), - Self::And(value) => ( - "AND", - ::prisma_client_rust::SerializedWhereValue::Object( - ::prisma_client_rust::merge_fields( - value - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(Into::into) - .collect(), - ), - ), - ), - Self::SourceIdRemoteIdEquals(source_id, remote_id) => ( - "source_id_remote_id", - ::prisma_client_rust::SerializedWhereValue::Object(vec![ - ( - source_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Int(source_id as i64), - ), - ( - remote_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Int(remote_id as i64), - ), - ]), - ), - Self::Id(value) => (id::NAME, value.into()), - Self::SourceId(value) => (source_id::NAME, value.into()), - Self::RemoteId(value) => (remote_id::NAME, value.into()), - Self::Name(value) => (name::NAME, value.into()), - Self::SourceIs(where_params) => ( - source::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "is".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::SourceIsNot(where_params) => ( - source::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "isNot".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::BookSequencesSome(where_params) => ( - book_sequences::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "some".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::BookSequencesEvery(where_params) => ( - book_sequences::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "every".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::BookSequencesNone(where_params) => ( - book_sequences::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "none".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - }; - ::prisma_client_rust::SerializedWhereInput::new(name, value.into()) - } - } - #[derive(Clone)] - pub enum UniqueWhereParam { - SourceIdRemoteIdEquals(i32, i32), - IdEquals(i32), - } - impl From for WhereParam { - fn from(value: UniqueWhereParam) -> Self { - match value { - UniqueWhereParam::SourceIdRemoteIdEquals(source_id, remote_id) => { - Self::SourceIdRemoteIdEquals(source_id, remote_id) - } - UniqueWhereParam::IdEquals(value) => { - Self::Id(_prisma::read_filters::IntFilter::Equals(value)) - } - } - } - } - impl From<::prisma_client_rust::Operator> for WhereParam { - fn from(op: ::prisma_client_rust::Operator) -> Self { - match op { - ::prisma_client_rust::Operator::Not(value) => Self::Not(value), - ::prisma_client_rust::Operator::And(value) => Self::And(value), - ::prisma_client_rust::Operator::Or(value) => Self::Or(value), - } - } - } - #[derive(Clone)] - pub struct Types; - impl ::prisma_client_rust::ModelTypes for Types { - type Data = Data; - type Where = WhereParam; - type UncheckedSet = UncheckedSetParam; - type Set = SetParam; - type With = WithParam; - type OrderBy = OrderByParam; - type Cursor = UniqueWhereParam; - const MODEL: &'static str = NAME; - fn scalar_selections() -> Vec<::prisma_client_rust::Selection> { - vec![ - ::prisma_client_rust::sel(id::NAME), - ::prisma_client_rust::sel(source_id::NAME), - ::prisma_client_rust::sel(remote_id::NAME), - ::prisma_client_rust::sel(name::NAME), - ] - } - } - pub type UniqueArgs = ::prisma_client_rust::UniqueArgs; - pub type ManyArgs = ::prisma_client_rust::ManyArgs; - pub type Count<'a> = ::prisma_client_rust::Count<'a, Types>; - pub type Create<'a> = ::prisma_client_rust::Create<'a, Types>; - pub type CreateMany<'a> = ::prisma_client_rust::CreateMany<'a, Types>; - pub type FindUnique<'a> = ::prisma_client_rust::FindUnique<'a, Types>; - pub type FindMany<'a> = ::prisma_client_rust::FindMany<'a, Types>; - pub type FindFirst<'a> = ::prisma_client_rust::FindFirst<'a, Types>; - pub type Update<'a> = ::prisma_client_rust::Update<'a, Types>; - pub type UpdateMany<'a> = ::prisma_client_rust::UpdateMany<'a, Types>; - pub type Upsert<'a> = ::prisma_client_rust::Upsert<'a, Types>; - pub type Delete<'a> = ::prisma_client_rust::Delete<'a, Types>; - pub type DeleteMany<'a> = ::prisma_client_rust::DeleteMany<'a, Types>; - #[derive(Clone)] - pub struct Actions<'a> { - pub client: &'a ::prisma_client_rust::PrismaClientInternals, - } - impl<'a> Actions<'a> { - pub fn find_unique(self, _where: UniqueWhereParam) -> FindUnique<'a> { - FindUnique::new(self.client, _where.into()) - } - pub fn find_first(self, _where: Vec) -> FindFirst<'a> { - FindFirst::new(self.client, _where) - } - pub fn find_many(self, _where: Vec) -> FindMany<'a> { - FindMany::new(self.client, _where) - } - pub fn create( - self, - remote_id: i32, - name: String, - source: super::source::UniqueWhereParam, - mut _params: Vec, - ) -> Create<'a> { - _params.extend([ - remote_id::set(remote_id), - name::set(name), - source::connect(source), - ]); - Create::new(self.client, _params) - } - pub fn create_unchecked( - self, - source_id: i32, - remote_id: i32, - name: String, - mut _params: Vec, - ) -> Create<'a> { - _params.extend([ - source_id::set(source_id), - remote_id::set(remote_id), - name::set(name), - ]); - Create::new(self.client, _params.into_iter().map(Into::into).collect()) - } - pub fn create_many(self, data: Vec<(i32, i32, String, Vec)>) -> CreateMany<'a> { - let data = data - .into_iter() - .map(|(source_id, remote_id, name, mut _params)| { - _params.extend([ - source_id::set(source_id), - remote_id::set(remote_id), - name::set(name), - ]); - _params - }) - .collect(); - CreateMany::new(self.client, data) - } - pub fn update(self, _where: UniqueWhereParam, _params: Vec) -> Update<'a> { - Update::new(self.client, _where.into(), _params, vec![]) - } - pub fn update_unchecked( - self, - _where: UniqueWhereParam, - _params: Vec, - ) -> Update<'a> { - Update::new( - self.client, - _where.into(), - _params.into_iter().map(Into::into).collect(), - vec![], - ) - } - pub fn update_many( - self, - _where: Vec, - _params: Vec, - ) -> UpdateMany<'a> { - UpdateMany::new(self.client, _where, _params) - } - pub fn upsert( - self, - _where: UniqueWhereParam, - (remote_id, name, source, mut _params): ( - i32, - String, - super::source::UniqueWhereParam, - Vec, - ), - _update: Vec, - ) -> Upsert<'a> { - _params.extend([ - remote_id::set(remote_id), - name::set(name), - source::connect(source), - ]); - Upsert::new(self.client, _where.into(), _params, _update) - } - pub fn delete(self, _where: UniqueWhereParam) -> Delete<'a> { - Delete::new(self.client, _where.into(), vec![]) - } - pub fn delete_many(self, _where: Vec) -> DeleteMany<'a> { - DeleteMany::new(self.client, _where) - } - pub fn count(self, _where: Vec) -> Count<'a> { - Count::new(self.client, _where) - } - } -} -pub mod source { - - use super::*; - pub const NAME: &str = "Source"; - pub mod id { - use super::super::*; - - use super::{OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam}; - pub const NAME: &str = "id"; - pub struct Set(pub i32); - impl From for SetParam { - fn from(Set(v): Set) -> Self { - Self::SetId(v) - } - } - impl From for UncheckedSetParam { - fn from(Set(v): Set) -> Self { - Self::Id(v) - } - } - pub fn set>(value: i32) -> T { - Set(value).into() - } - pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { - OrderByParam::Id(direction) - } - pub fn equals>(value: i32) -> T { - UniqueWhereParam::IdEquals(value).into() - } - ::prisma_client_rust::scalar_where_param_fns!(_prisma::read_filters::IntFilter, Id, { - fn in_vec(_: Vec) -> InVec; - fn not_in_vec(_: Vec) -> NotInVec; - fn lt(_: i32) -> Lt; - fn lte(_: i32) -> Lte; - fn gt(_: i32) -> Gt; - fn gte(_: i32) -> Gte; - fn not(_: i32) -> Not; - }); - pub fn increment(value: i32) -> SetParam { - SetParam::IncrementId(value) - } - pub fn decrement(value: i32) -> SetParam { - SetParam::DecrementId(value) - } - pub fn multiply(value: i32) -> SetParam { - SetParam::MultiplyId(value) - } - pub fn divide(value: i32) -> SetParam { - SetParam::DivideId(value) - } - pub struct Include; - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::Id(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - pub struct Select; - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::Id(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - } - pub mod name { - use super::super::*; - - use super::{OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam}; - pub const NAME: &str = "name"; - pub struct Set(pub String); - impl From for SetParam { - fn from(Set(v): Set) -> Self { - Self::SetName(v) - } - } - impl From for UncheckedSetParam { - fn from(Set(v): Set) -> Self { - Self::Name(v) - } - } - pub fn set>(value: String) -> T { - Set(value).into() - } - pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { - OrderByParam::Name(direction) - } - pub fn equals>(value: String) -> T { - UniqueWhereParam::NameEquals(value).into() - } - ::prisma_client_rust::scalar_where_param_fns!(_prisma::read_filters::StringFilter, Name, { - fn in_vec(_: Vec) -> InVec; - fn not_in_vec(_: Vec) -> NotInVec; - fn lt(_: String) -> Lt; - fn lte(_: String) -> Lte; - fn gt(_: String) -> Gt; - fn gte(_: String) -> Gte; - fn contains(_: String) -> Contains; - fn starts_with(_: String) -> StartsWith; - fn ends_with(_: String) -> EndsWith; - fn mode(_: super::super::QueryMode) -> Mode; - fn not(_: String) -> Not; - }); - pub struct Include; - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::Name(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - pub struct Select; - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::Name(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - } - pub mod authors { - use super::super::*; - - use super::{SetParam, WhereParam, WithParam}; - pub const NAME: &str = "authors"; - pub struct Fetch(pub author::ManyArgs); - impl Fetch { - pub fn with(mut self, params: impl Into) -> Self { - self.0 = self.0.with(params.into()); - self - } - pub fn order_by(mut self, param: author::OrderByParam) -> Self { - self.0 = self.0.order_by(param); - self - } - pub fn skip(mut self, value: i64) -> Self { - self.0 = self.0.skip(value); - self - } - pub fn take(mut self, value: i64) -> Self { - self.0 = self.0.take(value); - self - } - pub fn cursor(mut self, value: author::UniqueWhereParam) -> Self { - self.0 = self.0.cursor(value.into()); - self - } - } - impl From for WithParam { - fn from(Fetch(v): Fetch) -> Self { - WithParam::Authors(v) - } - } - pub fn fetch(params: Vec) -> Fetch { - Fetch(author::ManyArgs::new(params)) - } - pub struct Connect(pub Vec); - impl From for SetParam { - fn from(Connect(v): Connect) -> Self { - Self::ConnectAuthors(v) - } - } - pub fn connect>(params: Vec) -> T { - Connect(params).into() - } - pub fn disconnect(params: Vec) -> SetParam { - SetParam::DisconnectAuthors(params) - } - pub fn set(params: Vec) -> SetParam { - SetParam::SetAuthors(params) - } - pub fn some(value: Vec) -> WhereParam { - WhereParam::AuthorsSome(value) - } - pub fn every(value: Vec) -> WhereParam { - WhereParam::AuthorsEvery(value) - } - pub fn none(value: Vec) -> WhereParam { - WhereParam::AuthorsNone(value) - } - pub enum Include { - Select(author::ManyArgs, Vec), - Include(author::ManyArgs, Vec), - Fetch(author::ManyArgs), - } - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::Authors(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let (args, selections) = match self { - Self::Select(args, selections) => ( - args.to_graphql().0, - selections.into_iter().map(|s| s.to_selection()).collect(), - ), - Self::Include(args, selections) => (args.to_graphql().0, { - let mut nested_selections = - ::scalar_selections( - ); - nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); - nested_selections - }), - Self::Fetch(args) => ( - args.to_graphql().0, - ::scalar_selections(), - ), - }; - ::prisma_client_rust::Selection::new(NAME, None, args, selections) - } - pub fn select( - args: author::ManyArgs, - nested_selections: Vec, - ) -> Self { - Self::Select(args, nested_selections) - } - pub fn include( - args: author::ManyArgs, - nested_selections: Vec, - ) -> Self { - Self::Include(args, nested_selections) - } - } - pub enum Select { - Select(author::ManyArgs, Vec), - Include(author::ManyArgs, Vec), - Fetch(author::ManyArgs), - } - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::Authors(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let (args, selections) = match self { - Self::Select(args, selections) => ( - args.to_graphql().0, - selections.into_iter().map(|s| s.to_selection()).collect(), - ), - Self::Include(args, selections) => (args.to_graphql().0, { - let mut nested_selections = vec![]; - nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); - nested_selections - }), - Self::Fetch(args) => ( - args.to_graphql().0, - ::scalar_selections(), - ), - }; - ::prisma_client_rust::Selection::new(NAME, None, args, selections) - } - pub fn select( - args: author::ManyArgs, - nested_selections: Vec, - ) -> Self { - Self::Select(args, nested_selections) - } - pub fn include( - args: author::ManyArgs, - nested_selections: Vec, - ) -> Self { - Self::Include(args, nested_selections) - } - } - } - pub mod books { - use super::super::*; - - use super::{SetParam, WhereParam, WithParam}; - pub const NAME: &str = "books"; - pub struct Fetch(pub book::ManyArgs); - impl Fetch { - pub fn with(mut self, params: impl Into) -> Self { - self.0 = self.0.with(params.into()); - self - } - pub fn order_by(mut self, param: book::OrderByParam) -> Self { - self.0 = self.0.order_by(param); - self - } - pub fn skip(mut self, value: i64) -> Self { - self.0 = self.0.skip(value); - self - } - pub fn take(mut self, value: i64) -> Self { - self.0 = self.0.take(value); - self - } - pub fn cursor(mut self, value: book::UniqueWhereParam) -> Self { - self.0 = self.0.cursor(value.into()); - self - } - } - impl From for WithParam { - fn from(Fetch(v): Fetch) -> Self { - WithParam::Books(v) - } - } - pub fn fetch(params: Vec) -> Fetch { - Fetch(book::ManyArgs::new(params)) - } - pub struct Connect(pub Vec); - impl From for SetParam { - fn from(Connect(v): Connect) -> Self { - Self::ConnectBooks(v) - } - } - pub fn connect>(params: Vec) -> T { - Connect(params).into() - } - pub fn disconnect(params: Vec) -> SetParam { - SetParam::DisconnectBooks(params) - } - pub fn set(params: Vec) -> SetParam { - SetParam::SetBooks(params) - } - pub fn some(value: Vec) -> WhereParam { - WhereParam::BooksSome(value) - } - pub fn every(value: Vec) -> WhereParam { - WhereParam::BooksEvery(value) - } - pub fn none(value: Vec) -> WhereParam { - WhereParam::BooksNone(value) - } - pub enum Include { - Select(book::ManyArgs, Vec), - Include(book::ManyArgs, Vec), - Fetch(book::ManyArgs), - } - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::Books(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let (args, selections) = match self { - Self::Select(args, selections) => ( - args.to_graphql().0, - selections.into_iter().map(|s| s.to_selection()).collect(), - ), - Self::Include(args, selections) => (args.to_graphql().0, { - let mut nested_selections = - ::scalar_selections(); - nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); - nested_selections - }), - Self::Fetch(args) => ( - args.to_graphql().0, - ::scalar_selections(), - ), - }; - ::prisma_client_rust::Selection::new(NAME, None, args, selections) - } - pub fn select(args: book::ManyArgs, nested_selections: Vec) -> Self { - Self::Select(args, nested_selections) - } - pub fn include( - args: book::ManyArgs, - nested_selections: Vec, - ) -> Self { - Self::Include(args, nested_selections) - } - } - pub enum Select { - Select(book::ManyArgs, Vec), - Include(book::ManyArgs, Vec), - Fetch(book::ManyArgs), - } - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::Books(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let (args, selections) = match self { - Self::Select(args, selections) => ( - args.to_graphql().0, - selections.into_iter().map(|s| s.to_selection()).collect(), - ), - Self::Include(args, selections) => (args.to_graphql().0, { - let mut nested_selections = vec![]; - nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); - nested_selections - }), - Self::Fetch(args) => ( - args.to_graphql().0, - ::scalar_selections(), - ), - }; - ::prisma_client_rust::Selection::new(NAME, None, args, selections) - } - pub fn select(args: book::ManyArgs, nested_selections: Vec) -> Self { - Self::Select(args, nested_selections) - } - pub fn include( - args: book::ManyArgs, - nested_selections: Vec, - ) -> Self { - Self::Include(args, nested_selections) - } - } - } - pub mod genres { - use super::super::*; - - use super::{SetParam, WhereParam, WithParam}; - pub const NAME: &str = "genres"; - pub struct Fetch(pub genre::ManyArgs); - impl Fetch { - pub fn with(mut self, params: impl Into) -> Self { - self.0 = self.0.with(params.into()); - self - } - pub fn order_by(mut self, param: genre::OrderByParam) -> Self { - self.0 = self.0.order_by(param); - self - } - pub fn skip(mut self, value: i64) -> Self { - self.0 = self.0.skip(value); - self - } - pub fn take(mut self, value: i64) -> Self { - self.0 = self.0.take(value); - self - } - pub fn cursor(mut self, value: genre::UniqueWhereParam) -> Self { - self.0 = self.0.cursor(value.into()); - self - } - } - impl From for WithParam { - fn from(Fetch(v): Fetch) -> Self { - WithParam::Genres(v) - } - } - pub fn fetch(params: Vec) -> Fetch { - Fetch(genre::ManyArgs::new(params)) - } - pub struct Connect(pub Vec); - impl From for SetParam { - fn from(Connect(v): Connect) -> Self { - Self::ConnectGenres(v) - } - } - pub fn connect>(params: Vec) -> T { - Connect(params).into() - } - pub fn disconnect(params: Vec) -> SetParam { - SetParam::DisconnectGenres(params) - } - pub fn set(params: Vec) -> SetParam { - SetParam::SetGenres(params) - } - pub fn some(value: Vec) -> WhereParam { - WhereParam::GenresSome(value) - } - pub fn every(value: Vec) -> WhereParam { - WhereParam::GenresEvery(value) - } - pub fn none(value: Vec) -> WhereParam { - WhereParam::GenresNone(value) - } - pub enum Include { - Select(genre::ManyArgs, Vec), - Include(genre::ManyArgs, Vec), - Fetch(genre::ManyArgs), - } - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::Genres(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let (args, selections) = match self { - Self::Select(args, selections) => ( - args.to_graphql().0, - selections.into_iter().map(|s| s.to_selection()).collect(), - ), - Self::Include(args, selections) => (args.to_graphql().0, { - let mut nested_selections = - ::scalar_selections(); - nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); - nested_selections - }), - Self::Fetch(args) => ( - args.to_graphql().0, - ::scalar_selections(), - ), - }; - ::prisma_client_rust::Selection::new(NAME, None, args, selections) - } - pub fn select( - args: genre::ManyArgs, - nested_selections: Vec, - ) -> Self { - Self::Select(args, nested_selections) - } - pub fn include( - args: genre::ManyArgs, - nested_selections: Vec, - ) -> Self { - Self::Include(args, nested_selections) - } - } - pub enum Select { - Select(genre::ManyArgs, Vec), - Include(genre::ManyArgs, Vec), - Fetch(genre::ManyArgs), - } - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::Genres(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let (args, selections) = match self { - Self::Select(args, selections) => ( - args.to_graphql().0, - selections.into_iter().map(|s| s.to_selection()).collect(), - ), - Self::Include(args, selections) => (args.to_graphql().0, { - let mut nested_selections = vec![]; - nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); - nested_selections - }), - Self::Fetch(args) => ( - args.to_graphql().0, - ::scalar_selections(), - ), - }; - ::prisma_client_rust::Selection::new(NAME, None, args, selections) - } - pub fn select( - args: genre::ManyArgs, - nested_selections: Vec, - ) -> Self { - Self::Select(args, nested_selections) - } - pub fn include( - args: genre::ManyArgs, - nested_selections: Vec, - ) -> Self { - Self::Include(args, nested_selections) - } - } - } - pub mod sequences { - use super::super::*; - - use super::{SetParam, WhereParam, WithParam}; - pub const NAME: &str = "sequences"; - pub struct Fetch(pub sequence::ManyArgs); - impl Fetch { - pub fn with(mut self, params: impl Into) -> Self { - self.0 = self.0.with(params.into()); - self - } - pub fn order_by(mut self, param: sequence::OrderByParam) -> Self { - self.0 = self.0.order_by(param); - self - } - pub fn skip(mut self, value: i64) -> Self { - self.0 = self.0.skip(value); - self - } - pub fn take(mut self, value: i64) -> Self { - self.0 = self.0.take(value); - self - } - pub fn cursor(mut self, value: sequence::UniqueWhereParam) -> Self { - self.0 = self.0.cursor(value.into()); - self - } - } - impl From for WithParam { - fn from(Fetch(v): Fetch) -> Self { - WithParam::Sequences(v) - } - } - pub fn fetch(params: Vec) -> Fetch { - Fetch(sequence::ManyArgs::new(params)) - } - pub struct Connect(pub Vec); - impl From for SetParam { - fn from(Connect(v): Connect) -> Self { - Self::ConnectSequences(v) - } - } - pub fn connect>(params: Vec) -> T { - Connect(params).into() - } - pub fn disconnect(params: Vec) -> SetParam { - SetParam::DisconnectSequences(params) - } - pub fn set(params: Vec) -> SetParam { - SetParam::SetSequences(params) - } - pub fn some(value: Vec) -> WhereParam { - WhereParam::SequencesSome(value) - } - pub fn every(value: Vec) -> WhereParam { - WhereParam::SequencesEvery(value) - } - pub fn none(value: Vec) -> WhereParam { - WhereParam::SequencesNone(value) - } - pub enum Include { - Select(sequence::ManyArgs, Vec), - Include(sequence::ManyArgs, Vec), - Fetch(sequence::ManyArgs), - } - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::Sequences(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let (args, selections) = match self { - Self::Select(args, selections) => ( - args.to_graphql().0, - selections.into_iter().map(|s| s.to_selection()).collect(), - ), - Self::Include(args, selections) => (args.to_graphql().0, { - let mut nested_selections = < sequence :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; - nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); - nested_selections - }), - Self::Fetch(args) => ( - args.to_graphql().0, - ::scalar_selections(), - ), - }; - ::prisma_client_rust::Selection::new(NAME, None, args, selections) - } - pub fn select( - args: sequence::ManyArgs, - nested_selections: Vec, - ) -> Self { - Self::Select(args, nested_selections) - } - pub fn include( - args: sequence::ManyArgs, - nested_selections: Vec, - ) -> Self { - Self::Include(args, nested_selections) - } - } - pub enum Select { - Select(sequence::ManyArgs, Vec), - Include(sequence::ManyArgs, Vec), - Fetch(sequence::ManyArgs), - } - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::Sequences(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let (args, selections) = match self { - Self::Select(args, selections) => ( - args.to_graphql().0, - selections.into_iter().map(|s| s.to_selection()).collect(), - ), - Self::Include(args, selections) => (args.to_graphql().0, { - let mut nested_selections = vec![]; - nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); - nested_selections - }), - Self::Fetch(args) => ( - args.to_graphql().0, - ::scalar_selections(), - ), - }; - ::prisma_client_rust::Selection::new(NAME, None, args, selections) - } - pub fn select( - args: sequence::ManyArgs, - nested_selections: Vec, - ) -> Self { - Self::Select(args, nested_selections) - } - pub fn include( - args: sequence::ManyArgs, - nested_selections: Vec, - ) -> Self { - Self::Include(args, nested_selections) - } - } - } - pub fn create(name: String, _params: Vec) -> (String, Vec) { - (name, _params) - } - pub fn create_unchecked(name: String, _params: Vec) -> (String, Vec) { - (name, _params) - } - #[macro_export] - macro_rules ! _select_source { ($ (($ ($ func_arg : ident : $ func_arg_ty : ty) , +) =>) ? $ module_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { # [allow (warnings)] pub mod $ module_name { crate :: prisma :: source :: select ! (@ definitions ; $ module_name ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; use super :: * ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: SelectType for Selection { type Data = Data ; type ModelData = crate :: prisma :: source :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn select ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: source :: select ! (@ selections_to_params ; : select { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () ,] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } } ; ({ $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { { crate :: prisma :: source :: select ! (@ definitions ; ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: SelectType for Selection { type Data = Data ; type ModelData = crate :: prisma :: source :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: source :: select ! (@ selections_to_params ; : select { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () ,] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } ; (@ definitions ; $ ($ module_name : ident) ? ; $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) +) => { # [allow (warnings)] enum Fields { id , name , authors , books , genres , sequences } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] pub struct Data { $ (pub $ field : crate :: prisma :: source :: select ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } impl :: serde :: Serialize for Data { fn serialize < S > (& self , serializer : S) -> Result < S :: Ok , S :: Error > where S : :: serde :: Serializer , { use :: serde :: ser :: SerializeStruct ; let mut state = serializer . serialize_struct ("Data" , [$ (stringify ! ($ field) ,) +] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: source :: $ field :: NAME , & self . $ field) ? ;) * state . end () } } impl < 'de > :: serde :: Deserialize < 'de > for Data { fn deserialize < D > (deserializer : D) -> Result < Self , D :: Error > where D : :: serde :: Deserializer < 'de > , { # [allow (warnings)] enum Field { $ ($ field) , + , } impl < 'de > :: serde :: Deserialize < 'de > for Field { fn deserialize < D > (deserializer : D) -> Result < Field , D :: Error > where D : :: serde :: Deserializer < 'de > , { struct FieldVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for FieldVisitor { type Value = Field ; fn expecting (& self , formatter : & mut :: std :: fmt :: Formatter) -> :: std :: fmt :: Result { formatter . write_str (& [$ (crate :: prisma :: source :: $ field :: NAME) , + ,] . into_iter () . collect :: < Vec < _ >> () . join (", ")) } fn visit_str < E > (self , value : & str) -> Result < Field , E > where E : :: serde :: de :: Error , { match value { $ (crate :: prisma :: source :: $ field :: NAME => Ok (Field :: $ field)) , * , _ => Err (:: serde :: de :: Error :: unknown_field (value , FIELDS)) , } } } deserializer . deserialize_identifier (FieldVisitor) } } struct DataVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for DataVisitor { type Value = Data ; fn expecting (& self , formatter : & mut std :: fmt :: Formatter) -> std :: fmt :: Result { formatter . write_str ("struct Data") } fn visit_map < V > (self , mut map : V) -> Result < Data , V :: Error > where V : :: serde :: de :: MapAccess < 'de > , { $ (let mut $ field = None ;) * while let Some (key) = map . next_key () ? { match key { $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: source :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: source :: $ field :: NAME)) ? ;) * Ok (Data { $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "name" , "authors" , "books" , "genres" , "sequences"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: source :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; id) => { i32 } ; (@ field_type ; name) => { String } ; (@ field_type ; authors : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < authors :: Data > } ; (@ field_type ; authors) => { Vec < crate :: prisma :: author :: Data > } ; (@ field_type ; books : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < books :: Data > } ; (@ field_type ; books) => { Vec < crate :: prisma :: book :: Data > } ; (@ field_type ; genres : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < genres :: Data > } ; (@ field_type ; genres) => { Vec < crate :: prisma :: genre :: Data > } ; (@ field_type ; sequences : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < sequences :: Data > } ; (@ field_type ; sequences) => { Vec < crate :: prisma :: sequence :: Data > } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "Source" , available relations are "id, name, authors, books, genres, sequences")) } ; (@ field_module ; authors : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: author :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; books : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: book :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; genres : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: genre :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; sequences : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: sequence :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; id) => { Into :: < crate :: prisma :: source :: SelectParam > :: into (crate :: prisma :: source :: id :: Select) } ; (@ selection_field_to_selection_param ; name) => { Into :: < crate :: prisma :: source :: SelectParam > :: into (crate :: prisma :: source :: name :: Select) } ; (@ selection_field_to_selection_param ; authors $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: source :: SelectParam > :: into (crate :: prisma :: source :: authors :: Select :: $ selection_mode (crate :: prisma :: author :: ManyArgs :: new (crate :: prisma :: author :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: author :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; authors $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: source :: SelectParam > :: into (crate :: prisma :: source :: authors :: Select :: Fetch (crate :: prisma :: author :: ManyArgs :: new (crate :: prisma :: author :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; books $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: source :: SelectParam > :: into (crate :: prisma :: source :: books :: Select :: $ selection_mode (crate :: prisma :: book :: ManyArgs :: new (crate :: prisma :: book :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: book :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; books $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: source :: SelectParam > :: into (crate :: prisma :: source :: books :: Select :: Fetch (crate :: prisma :: book :: ManyArgs :: new (crate :: prisma :: book :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; genres $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: source :: SelectParam > :: into (crate :: prisma :: source :: genres :: Select :: $ selection_mode (crate :: prisma :: genre :: ManyArgs :: new (crate :: prisma :: genre :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: genre :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; genres $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: source :: SelectParam > :: into (crate :: prisma :: source :: genres :: Select :: Fetch (crate :: prisma :: genre :: ManyArgs :: new (crate :: prisma :: genre :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; sequences $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: source :: SelectParam > :: into (crate :: prisma :: source :: sequences :: Select :: $ selection_mode (crate :: prisma :: sequence :: ManyArgs :: new (crate :: prisma :: sequence :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: sequence :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; sequences $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: source :: SelectParam > :: into (crate :: prisma :: source :: sequences :: Select :: Fetch (crate :: prisma :: sequence :: ManyArgs :: new (crate :: prisma :: sequence :: select ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; $ ($ tokens : tt) *) => { compile_error ! (stringify ! ($ ($ tokens) *)) } ; (@ selections_to_params ; : $ macro_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { [$ (crate :: prisma :: source :: $ macro_name ! (@ selection_field_to_selection_param ; $ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) ,) +] } ; (@ filters_to_args ;) => { vec ! [] } ; (@ filters_to_args ; $ ($ t : tt) *) => { $ ($ t) * } ; (@ field_serde_name ; id) => { "id" } ; (@ field_serde_name ; name) => { "name" } ; (@ field_serde_name ; authors) => { "authors" } ; (@ field_serde_name ; books) => { "books" } ; (@ field_serde_name ; genres) => { "genres" } ; (@ field_serde_name ; sequences) => { "sequences" } ; } - pub use _select_source as select; - pub enum SelectParam { - Id(id::Select), - Name(name::Select), - Authors(authors::Select), - Books(books::Select), - Genres(genres::Select), - Sequences(sequences::Select), - } - impl SelectParam { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - match self { - Self::Id(data) => data.to_selection(), - Self::Name(data) => data.to_selection(), - Self::Authors(data) => data.to_selection(), - Self::Books(data) => data.to_selection(), - Self::Genres(data) => data.to_selection(), - Self::Sequences(data) => data.to_selection(), - } - } - } - #[macro_export] - macro_rules ! _include_source { ($ (($ ($ func_arg : ident : $ func_arg_ty : ty) , +) =>) ? $ module_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { # [allow (warnings)] pub mod $ module_name { crate :: prisma :: source :: include ! (@ definitions ; $ module_name ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; use super :: * ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: IncludeType for Selection { type Data = Data ; type ModelData = crate :: prisma :: source :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn include ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: source :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: source :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } } ; ({ $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { { crate :: prisma :: source :: include ! (@ definitions ; ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: IncludeType for Selection { type Data = Data ; type ModelData = crate :: prisma :: source :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: source :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: source :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } ; (@ definitions ; $ ($ module_name : ident) ? ; $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) +) => { # [allow (warnings)] enum Fields { authors , books , genres , sequences } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] pub struct Data { pub id : i32 , pub name : String , $ (pub $ field : crate :: prisma :: source :: include ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } impl :: serde :: Serialize for Data { fn serialize < S > (& self , serializer : S) -> Result < S :: Ok , S :: Error > where S : :: serde :: Serializer , { use :: serde :: ser :: SerializeStruct ; let mut state = serializer . serialize_struct ("Data" , [$ (stringify ! ($ field) ,) + stringify ! (id) , stringify ! (name)] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: source :: $ field :: NAME , & self . $ field) ? ;) * state . serialize_field (crate :: prisma :: source :: id :: NAME , & self . id) ? ; state . serialize_field (crate :: prisma :: source :: name :: NAME , & self . name) ? ; state . end () } } impl < 'de > :: serde :: Deserialize < 'de > for Data { fn deserialize < D > (deserializer : D) -> Result < Self , D :: Error > where D : :: serde :: Deserializer < 'de > , { # [allow (warnings)] enum Field { $ ($ field) , + , id , name } impl < 'de > :: serde :: Deserialize < 'de > for Field { fn deserialize < D > (deserializer : D) -> Result < Field , D :: Error > where D : :: serde :: Deserializer < 'de > , { struct FieldVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for FieldVisitor { type Value = Field ; fn expecting (& self , formatter : & mut :: std :: fmt :: Formatter) -> :: std :: fmt :: Result { formatter . write_str (& [$ (crate :: prisma :: source :: $ field :: NAME) , + , crate :: prisma :: source :: id :: NAME , crate :: prisma :: source :: name :: NAME] . into_iter () . collect :: < Vec < _ >> () . join (", ")) } fn visit_str < E > (self , value : & str) -> Result < Field , E > where E : :: serde :: de :: Error , { match value { $ (crate :: prisma :: source :: $ field :: NAME => Ok (Field :: $ field)) , * , crate :: prisma :: source :: id :: NAME => Ok (Field :: id) , crate :: prisma :: source :: name :: NAME => Ok (Field :: name) , _ => Err (:: serde :: de :: Error :: unknown_field (value , FIELDS)) , } } } deserializer . deserialize_identifier (FieldVisitor) } } struct DataVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for DataVisitor { type Value = Data ; fn expecting (& self , formatter : & mut std :: fmt :: Formatter) -> std :: fmt :: Result { formatter . write_str ("struct Data") } fn visit_map < V > (self , mut map : V) -> Result < Data , V :: Error > where V : :: serde :: de :: MapAccess < 'de > , { $ (let mut $ field = None ;) * let mut id = None ; let mut name = None ; while let Some (key) = map . next_key () ? { match key { Field :: id => { if id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: source :: id :: NAME)) ; } id = Some (map . next_value () ?) ; } Field :: name => { if name . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: source :: name :: NAME)) ; } name = Some (map . next_value () ?) ; } $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: source :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: source :: $ field :: NAME)) ? ;) * let id = id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: source :: id :: NAME)) ? ; let name = name . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: source :: name :: NAME)) ? ; Ok (Data { id , name , $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "name" , "authors" , "books" , "genres" , "sequences"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: source :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; authors : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < authors :: Data > } ; (@ field_type ; authors) => { Vec < crate :: prisma :: author :: Data > } ; (@ field_type ; books : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < books :: Data > } ; (@ field_type ; books) => { Vec < crate :: prisma :: book :: Data > } ; (@ field_type ; genres : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < genres :: Data > } ; (@ field_type ; genres) => { Vec < crate :: prisma :: genre :: Data > } ; (@ field_type ; sequences : $ selection_mode : ident { $ ($ selections : tt) + }) => { Vec < sequences :: Data > } ; (@ field_type ; sequences) => { Vec < crate :: prisma :: sequence :: Data > } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "Source" , available relations are "authors, books, genres, sequences")) } ; (@ field_module ; authors : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: author :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; books : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: book :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; genres : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: genre :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; sequences : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: sequence :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; authors $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: source :: IncludeParam > :: into (crate :: prisma :: source :: authors :: Include :: $ selection_mode (crate :: prisma :: author :: ManyArgs :: new (crate :: prisma :: author :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: author :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; authors $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: source :: IncludeParam > :: into (crate :: prisma :: source :: authors :: Include :: Fetch (crate :: prisma :: author :: ManyArgs :: new (crate :: prisma :: author :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; books $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: source :: IncludeParam > :: into (crate :: prisma :: source :: books :: Include :: $ selection_mode (crate :: prisma :: book :: ManyArgs :: new (crate :: prisma :: book :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: book :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; books $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: source :: IncludeParam > :: into (crate :: prisma :: source :: books :: Include :: Fetch (crate :: prisma :: book :: ManyArgs :: new (crate :: prisma :: book :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; genres $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: source :: IncludeParam > :: into (crate :: prisma :: source :: genres :: Include :: $ selection_mode (crate :: prisma :: genre :: ManyArgs :: new (crate :: prisma :: genre :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: genre :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; genres $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: source :: IncludeParam > :: into (crate :: prisma :: source :: genres :: Include :: Fetch (crate :: prisma :: genre :: ManyArgs :: new (crate :: prisma :: genre :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; sequences $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: source :: IncludeParam > :: into (crate :: prisma :: source :: sequences :: Include :: $ selection_mode (crate :: prisma :: sequence :: ManyArgs :: new (crate :: prisma :: sequence :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ? , crate :: prisma :: sequence :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; sequences $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: source :: IncludeParam > :: into (crate :: prisma :: source :: sequences :: Include :: Fetch (crate :: prisma :: sequence :: ManyArgs :: new (crate :: prisma :: sequence :: include ! (@ filters_to_args ; $ ($ ($ filters) +) ?)) $ ($ (. $ arg ($ ($ arg_params) *)) *) ?) ,) } } ; (@ selection_field_to_selection_param ; $ ($ tokens : tt) *) => { compile_error ! (stringify ! ($ ($ tokens) *)) } ; (@ selections_to_params ; : $ macro_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { [$ (crate :: prisma :: source :: $ macro_name ! (@ selection_field_to_selection_param ; $ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) ,) +] } ; (@ filters_to_args ;) => { vec ! [] } ; (@ filters_to_args ; $ ($ t : tt) *) => { $ ($ t) * } ; (@ field_serde_name ; id) => { "id" } ; (@ field_serde_name ; name) => { "name" } ; (@ field_serde_name ; authors) => { "authors" } ; (@ field_serde_name ; books) => { "books" } ; (@ field_serde_name ; genres) => { "genres" } ; (@ field_serde_name ; sequences) => { "sequences" } ; } - pub use _include_source as include; - pub enum IncludeParam { - Id(id::Include), - Name(name::Include), - Authors(authors::Include), - Books(books::Include), - Genres(genres::Include), - Sequences(sequences::Include), - } - impl IncludeParam { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - match self { - Self::Id(data) => data.to_selection(), - Self::Name(data) => data.to_selection(), - Self::Authors(data) => data.to_selection(), - Self::Books(data) => data.to_selection(), - Self::Genres(data) => data.to_selection(), - Self::Sequences(data) => data.to_selection(), - } - } - } - #[macro_export] - macro_rules ! _partial_unchecked_source { ($ struct_name : ident { $ ($ scalar_field : ident) + }) => { :: prisma_client_rust :: macros :: partial_unchecked ! { crate :: prisma :: source struct $ struct_name { # [serde (rename = "id")] pub id : i32 , # [serde (rename = "name")] pub name : String } [$ ($ scalar_field) , +] } } ; } - pub use _partial_unchecked_source as partial_unchecked; - #[derive(Debug, Clone, :: serde :: Serialize, :: serde :: Deserialize)] - pub struct Data { - #[serde(rename = "id")] - pub id: i32, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "authors")] - pub authors: Option>, - #[serde(rename = "books")] - pub books: Option>, - #[serde(rename = "genres")] - pub genres: Option>, - #[serde(rename = "sequences")] - pub sequences: Option>, - } - impl Data { - pub fn authors( - &self, - ) -> Result<&Vec, ::prisma_client_rust::RelationNotFetchedError> - { - self.authors - .as_ref() - .ok_or(::prisma_client_rust::RelationNotFetchedError::new( - stringify!(authors), - )) - } - pub fn books( - &self, - ) -> Result<&Vec, ::prisma_client_rust::RelationNotFetchedError> - { - self.books - .as_ref() - .ok_or(::prisma_client_rust::RelationNotFetchedError::new( - stringify!(books), - )) - } - pub fn genres( - &self, - ) -> Result<&Vec, ::prisma_client_rust::RelationNotFetchedError> - { - self.genres - .as_ref() - .ok_or(::prisma_client_rust::RelationNotFetchedError::new( - stringify!(genres), - )) - } - pub fn sequences( - &self, - ) -> Result<&Vec, ::prisma_client_rust::RelationNotFetchedError> - { - self.sequences - .as_ref() - .ok_or(::prisma_client_rust::RelationNotFetchedError::new( - stringify!(sequences), - )) - } - } - #[derive(Clone)] - pub enum WithParam { - Authors(super::author::ManyArgs), - Books(super::book::ManyArgs), - Genres(super::genre::ManyArgs), - Sequences(super::sequence::ManyArgs), - } - impl Into<::prisma_client_rust::Selection> for WithParam { - fn into(self) -> ::prisma_client_rust::Selection { - match self { - Self::Authors(args) => { - let (arguments, mut nested_selections) = args.to_graphql(); - nested_selections . extend (< super :: author :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) ; - ::prisma_client_rust::Selection::new( - authors::NAME, - None, - arguments, - nested_selections, - ) - } - Self::Books(args) => { - let (arguments, mut nested_selections) = args.to_graphql(); - nested_selections.extend( - ::scalar_selections( - ), - ); - ::prisma_client_rust::Selection::new( - books::NAME, - None, - arguments, - nested_selections, - ) - } - Self::Genres(args) => { - let (arguments, mut nested_selections) = args.to_graphql(); - nested_selections . extend (< super :: genre :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) ; - ::prisma_client_rust::Selection::new( - genres::NAME, - None, - arguments, - nested_selections, - ) - } - Self::Sequences(args) => { - let (arguments, mut nested_selections) = args.to_graphql(); - nested_selections . extend (< super :: sequence :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()) ; - ::prisma_client_rust::Selection::new( - sequences::NAME, - None, - arguments, - nested_selections, - ) - } - } - } - } - #[derive(Clone)] - pub enum SetParam { - SetId(i32), - IncrementId(i32), - DecrementId(i32), - MultiplyId(i32), - DivideId(i32), - SetName(String), - ConnectAuthors(Vec), - DisconnectAuthors(Vec), - SetAuthors(Vec), - ConnectBooks(Vec), - DisconnectBooks(Vec), - SetBooks(Vec), - ConnectGenres(Vec), - DisconnectGenres(Vec), - SetGenres(Vec), - ConnectSequences(Vec), - DisconnectSequences(Vec), - SetSequences(Vec), - } - impl From for (String, ::prisma_client_rust::PrismaValue) { - fn from(param: SetParam) -> Self { - match param { - SetParam::SetId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - ), - SetParam::IncrementId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "increment".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DecrementId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "decrement".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::MultiplyId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "multiply".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DivideId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "divide".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::SetName(value) => ( - name::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(value), - ), - SetParam::ConnectAuthors(where_params) => ( - authors::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "connect".to_string(), - ::prisma_client_rust::PrismaValue::List( - where_params - .into_iter() - .map(Into::::into) - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) - .collect(), - ), - )]), - ), - SetParam::DisconnectAuthors(where_params) => ( - authors::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "disconnect".to_string(), - ::prisma_client_rust::PrismaValue::List( - where_params - .into_iter() - .map(Into::::into) - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) - .collect(), - ), - )]), - ), - SetParam::SetAuthors(where_params) => ( - authors::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "set".to_string(), - ::prisma_client_rust::PrismaValue::List( - where_params - .into_iter() - .map(Into::::into) - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) - .collect(), - ), - )]), - ), - SetParam::ConnectBooks(where_params) => ( - books::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "connect".to_string(), - ::prisma_client_rust::PrismaValue::List( - where_params - .into_iter() - .map(Into::::into) - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) - .collect(), - ), - )]), - ), - SetParam::DisconnectBooks(where_params) => ( - books::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "disconnect".to_string(), - ::prisma_client_rust::PrismaValue::List( - where_params - .into_iter() - .map(Into::::into) - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) - .collect(), - ), - )]), - ), - SetParam::SetBooks(where_params) => ( - books::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "set".to_string(), - ::prisma_client_rust::PrismaValue::List( - where_params - .into_iter() - .map(Into::::into) - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) - .collect(), - ), - )]), - ), - SetParam::ConnectGenres(where_params) => ( - genres::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "connect".to_string(), - ::prisma_client_rust::PrismaValue::List( - where_params - .into_iter() - .map(Into::::into) - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) - .collect(), - ), - )]), - ), - SetParam::DisconnectGenres(where_params) => ( - genres::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "disconnect".to_string(), - ::prisma_client_rust::PrismaValue::List( - where_params - .into_iter() - .map(Into::::into) - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) - .collect(), - ), - )]), - ), - SetParam::SetGenres(where_params) => ( - genres::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "set".to_string(), - ::prisma_client_rust::PrismaValue::List( - where_params - .into_iter() - .map(Into::::into) - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) - .collect(), - ), - )]), - ), - SetParam::ConnectSequences(where_params) => ( - sequences::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "connect".to_string(), - ::prisma_client_rust::PrismaValue::List( - where_params - .into_iter() - .map(Into::::into) - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) - .collect(), - ), - )]), - ), - SetParam::DisconnectSequences(where_params) => ( - sequences::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "disconnect".to_string(), - ::prisma_client_rust::PrismaValue::List( - where_params - .into_iter() - .map(Into::::into) - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) - .collect(), - ), - )]), - ), - SetParam::SetSequences(where_params) => ( - sequences::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "set".to_string(), - ::prisma_client_rust::PrismaValue::List( - where_params - .into_iter() - .map(Into::::into) - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .map(|v| ::prisma_client_rust::PrismaValue::Object(vec![v])) - .collect(), - ), - )]), - ), - } - } - } - #[derive(Clone)] - pub enum UncheckedSetParam { - Id(i32), - Name(String), - } - impl From for SetParam { - fn from(param: UncheckedSetParam) -> Self { - match param { - UncheckedSetParam::Id(value) => Self::SetId(value), - UncheckedSetParam::Name(value) => Self::SetName(value), - } - } - } - #[derive(Clone)] - pub enum OrderByParam { - Id(::prisma_client_rust::Direction), - Name(::prisma_client_rust::Direction), - } - impl Into<(String, ::prisma_client_rust::PrismaValue)> for OrderByParam { - fn into(self) -> (String, ::prisma_client_rust::PrismaValue) { - match self { - Self::Id(direction) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(direction.to_string()), - ), - Self::Name(direction) => ( - name::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(direction.to_string()), - ), - } - } - } - #[derive(Clone)] - pub enum WhereParam { - Not(Vec), - Or(Vec), - And(Vec), - Id(_prisma::read_filters::IntFilter), - Name(_prisma::read_filters::StringFilter), - AuthorsSome(Vec), - AuthorsEvery(Vec), - AuthorsNone(Vec), - BooksSome(Vec), - BooksEvery(Vec), - BooksNone(Vec), - GenresSome(Vec), - GenresEvery(Vec), - GenresNone(Vec), - SequencesSome(Vec), - SequencesEvery(Vec), - SequencesNone(Vec), - } - impl ::prisma_client_rust::WhereInput for WhereParam { - fn serialize(self) -> ::prisma_client_rust::SerializedWhereInput { - let (name, value) = match self { - Self::Not(value) => ( - "NOT", - ::prisma_client_rust::SerializedWhereValue::Object( - ::prisma_client_rust::merge_fields( - value - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(Into::into) - .collect(), - ), - ), - ), - Self::Or(value) => ( - "OR", - ::prisma_client_rust::SerializedWhereValue::List( - value - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(Into::into) - .map(|v| vec![v]) - .map(::prisma_client_rust::PrismaValue::Object) - .collect(), - ), - ), - Self::And(value) => ( - "AND", - ::prisma_client_rust::SerializedWhereValue::Object( - ::prisma_client_rust::merge_fields( - value - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(Into::into) - .collect(), - ), - ), - ), - Self::Id(value) => (id::NAME, value.into()), - Self::Name(value) => (name::NAME, value.into()), - Self::AuthorsSome(where_params) => ( - authors::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "some".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::AuthorsEvery(where_params) => ( - authors::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "every".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::AuthorsNone(where_params) => ( - authors::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "none".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::BooksSome(where_params) => ( - books::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "some".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::BooksEvery(where_params) => ( - books::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "every".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::BooksNone(where_params) => ( - books::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "none".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::GenresSome(where_params) => ( - genres::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "some".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::GenresEvery(where_params) => ( - genres::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "every".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::GenresNone(where_params) => ( - genres::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "none".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::SequencesSome(where_params) => ( - sequences::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "some".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::SequencesEvery(where_params) => ( - sequences::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "every".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::SequencesNone(where_params) => ( - sequences::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "none".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - }; - ::prisma_client_rust::SerializedWhereInput::new(name, value.into()) - } - } - #[derive(Clone)] - pub enum UniqueWhereParam { - NameEquals(String), - IdEquals(i32), - } - impl From for WhereParam { - fn from(value: UniqueWhereParam) -> Self { - match value { - UniqueWhereParam::NameEquals(value) => { - Self::Name(_prisma::read_filters::StringFilter::Equals(value)) - } - UniqueWhereParam::IdEquals(value) => { - Self::Id(_prisma::read_filters::IntFilter::Equals(value)) - } - } - } - } - impl From<::prisma_client_rust::Operator> for WhereParam { - fn from(op: ::prisma_client_rust::Operator) -> Self { - match op { - ::prisma_client_rust::Operator::Not(value) => Self::Not(value), - ::prisma_client_rust::Operator::And(value) => Self::And(value), - ::prisma_client_rust::Operator::Or(value) => Self::Or(value), - } - } - } - #[derive(Clone)] - pub struct Types; - impl ::prisma_client_rust::ModelTypes for Types { - type Data = Data; - type Where = WhereParam; - type UncheckedSet = UncheckedSetParam; - type Set = SetParam; - type With = WithParam; - type OrderBy = OrderByParam; - type Cursor = UniqueWhereParam; - const MODEL: &'static str = NAME; - fn scalar_selections() -> Vec<::prisma_client_rust::Selection> { - vec![ - ::prisma_client_rust::sel(id::NAME), - ::prisma_client_rust::sel(name::NAME), - ] - } - } - pub type UniqueArgs = ::prisma_client_rust::UniqueArgs; - pub type ManyArgs = ::prisma_client_rust::ManyArgs; - pub type Count<'a> = ::prisma_client_rust::Count<'a, Types>; - pub type Create<'a> = ::prisma_client_rust::Create<'a, Types>; - pub type CreateMany<'a> = ::prisma_client_rust::CreateMany<'a, Types>; - pub type FindUnique<'a> = ::prisma_client_rust::FindUnique<'a, Types>; - pub type FindMany<'a> = ::prisma_client_rust::FindMany<'a, Types>; - pub type FindFirst<'a> = ::prisma_client_rust::FindFirst<'a, Types>; - pub type Update<'a> = ::prisma_client_rust::Update<'a, Types>; - pub type UpdateMany<'a> = ::prisma_client_rust::UpdateMany<'a, Types>; - pub type Upsert<'a> = ::prisma_client_rust::Upsert<'a, Types>; - pub type Delete<'a> = ::prisma_client_rust::Delete<'a, Types>; - pub type DeleteMany<'a> = ::prisma_client_rust::DeleteMany<'a, Types>; - #[derive(Clone)] - pub struct Actions<'a> { - pub client: &'a ::prisma_client_rust::PrismaClientInternals, - } - impl<'a> Actions<'a> { - pub fn find_unique(self, _where: UniqueWhereParam) -> FindUnique<'a> { - FindUnique::new(self.client, _where.into()) - } - pub fn find_first(self, _where: Vec) -> FindFirst<'a> { - FindFirst::new(self.client, _where) - } - pub fn find_many(self, _where: Vec) -> FindMany<'a> { - FindMany::new(self.client, _where) - } - pub fn create(self, name: String, mut _params: Vec) -> Create<'a> { - _params.extend([name::set(name)]); - Create::new(self.client, _params) - } - pub fn create_unchecked( - self, - name: String, - mut _params: Vec, - ) -> Create<'a> { - _params.extend([name::set(name)]); - Create::new(self.client, _params.into_iter().map(Into::into).collect()) - } - pub fn create_many(self, data: Vec<(String, Vec)>) -> CreateMany<'a> { - let data = data - .into_iter() - .map(|(name, mut _params)| { - _params.extend([name::set(name)]); - _params - }) - .collect(); - CreateMany::new(self.client, data) - } - pub fn update(self, _where: UniqueWhereParam, _params: Vec) -> Update<'a> { - Update::new(self.client, _where.into(), _params, vec![]) - } - pub fn update_unchecked( - self, - _where: UniqueWhereParam, - _params: Vec, - ) -> Update<'a> { - Update::new( - self.client, - _where.into(), - _params.into_iter().map(Into::into).collect(), - vec![], - ) - } - pub fn update_many( - self, - _where: Vec, - _params: Vec, - ) -> UpdateMany<'a> { - UpdateMany::new(self.client, _where, _params) - } - pub fn upsert( - self, - _where: UniqueWhereParam, - (name, mut _params): (String, Vec), - _update: Vec, - ) -> Upsert<'a> { - _params.extend([name::set(name)]); - Upsert::new(self.client, _where.into(), _params, _update) - } - pub fn delete(self, _where: UniqueWhereParam) -> Delete<'a> { - Delete::new(self.client, _where.into(), vec![]) - } - pub fn delete_many(self, _where: Vec) -> DeleteMany<'a> { - DeleteMany::new(self.client, _where) - } - pub fn count(self, _where: Vec) -> Count<'a> { - Count::new(self.client, _where) - } - } -} -pub mod translator { - - use super::*; - pub const NAME: &str = "Translator"; - pub mod id { - use super::super::*; - - use super::{OrderByParam, SetParam, UncheckedSetParam, UniqueWhereParam, WhereParam}; - pub const NAME: &str = "id"; - pub struct Set(pub i32); - impl From for SetParam { - fn from(Set(v): Set) -> Self { - Self::SetId(v) - } - } - impl From for UncheckedSetParam { - fn from(Set(v): Set) -> Self { - Self::Id(v) - } - } - pub fn set>(value: i32) -> T { - Set(value).into() - } - pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { - OrderByParam::Id(direction) - } - pub fn equals>(value: i32) -> T { - UniqueWhereParam::IdEquals(value).into() - } - ::prisma_client_rust::scalar_where_param_fns!(_prisma::read_filters::IntFilter, Id, { - fn in_vec(_: Vec) -> InVec; - fn not_in_vec(_: Vec) -> NotInVec; - fn lt(_: i32) -> Lt; - fn lte(_: i32) -> Lte; - fn gt(_: i32) -> Gt; - fn gte(_: i32) -> Gte; - fn not(_: i32) -> Not; - }); - pub fn increment(value: i32) -> SetParam { - SetParam::IncrementId(value) - } - pub fn decrement(value: i32) -> SetParam { - SetParam::DecrementId(value) - } - pub fn multiply(value: i32) -> SetParam { - SetParam::MultiplyId(value) - } - pub fn divide(value: i32) -> SetParam { - SetParam::DivideId(value) - } - pub struct Include; - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::Id(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - pub struct Select; - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::Id(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - } - pub mod position { - use super::super::*; - - use super::{OrderByParam, SetParam, UncheckedSetParam, WhereParam}; - pub const NAME: &str = "position"; - pub struct Set(pub i32); - impl From for SetParam { - fn from(Set(v): Set) -> Self { - Self::SetPosition(v) - } - } - impl From for UncheckedSetParam { - fn from(Set(v): Set) -> Self { - Self::Position(v) - } - } - pub fn set>(value: i32) -> T { - Set(value).into() - } - pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { - OrderByParam::Position(direction) - } - pub fn equals(value: i32) -> WhereParam { - WhereParam::Position(_prisma::read_filters::IntFilter::Equals(value)) - } - ::prisma_client_rust::scalar_where_param_fns!( - _prisma::read_filters::IntFilter, - Position, - { - fn in_vec(_: Vec) -> InVec; - fn not_in_vec(_: Vec) -> NotInVec; - fn lt(_: i32) -> Lt; - fn lte(_: i32) -> Lte; - fn gt(_: i32) -> Gt; - fn gte(_: i32) -> Gte; - fn not(_: i32) -> Not; - } - ); - pub fn increment(value: i32) -> SetParam { - SetParam::IncrementPosition(value) - } - pub fn decrement(value: i32) -> SetParam { - SetParam::DecrementPosition(value) - } - pub fn multiply(value: i32) -> SetParam { - SetParam::MultiplyPosition(value) - } - pub fn divide(value: i32) -> SetParam { - SetParam::DividePosition(value) - } - pub struct Include; - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::Position(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - pub struct Select; - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::Position(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - } - pub mod author_id { - use super::super::*; - - use super::{OrderByParam, SetParam, UncheckedSetParam, WhereParam}; - pub const NAME: &str = "author_id"; - pub struct Set(pub i32); - impl From for SetParam { - fn from(Set(v): Set) -> Self { - Self::SetAuthorId(v) - } - } - impl From for UncheckedSetParam { - fn from(Set(v): Set) -> Self { - Self::AuthorId(v) - } - } - pub fn set>(value: i32) -> T { - Set(value).into() - } - pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { - OrderByParam::AuthorId(direction) - } - pub fn equals(value: i32) -> WhereParam { - WhereParam::AuthorId(_prisma::read_filters::IntFilter::Equals(value)) - } - ::prisma_client_rust::scalar_where_param_fns!( - _prisma::read_filters::IntFilter, - AuthorId, - { - fn in_vec(_: Vec) -> InVec; - fn not_in_vec(_: Vec) -> NotInVec; - fn lt(_: i32) -> Lt; - fn lte(_: i32) -> Lte; - fn gt(_: i32) -> Gt; - fn gte(_: i32) -> Gte; - fn not(_: i32) -> Not; - } - ); - pub fn increment(value: i32) -> SetParam { - SetParam::IncrementAuthorId(value) - } - pub fn decrement(value: i32) -> SetParam { - SetParam::DecrementAuthorId(value) - } - pub fn multiply(value: i32) -> SetParam { - SetParam::MultiplyAuthorId(value) - } - pub fn divide(value: i32) -> SetParam { - SetParam::DivideAuthorId(value) - } - pub struct Include; - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::AuthorId(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - pub struct Select; - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::AuthorId(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - } - pub mod book_id { - use super::super::*; - - use super::{OrderByParam, SetParam, UncheckedSetParam, WhereParam}; - pub const NAME: &str = "book_id"; - pub struct Set(pub i32); - impl From for SetParam { - fn from(Set(v): Set) -> Self { - Self::SetBookId(v) - } - } - impl From for UncheckedSetParam { - fn from(Set(v): Set) -> Self { - Self::BookId(v) - } - } - pub fn set>(value: i32) -> T { - Set(value).into() - } - pub fn order(direction: ::prisma_client_rust::Direction) -> OrderByParam { - OrderByParam::BookId(direction) - } - pub fn equals(value: i32) -> WhereParam { - WhereParam::BookId(_prisma::read_filters::IntFilter::Equals(value)) - } - ::prisma_client_rust::scalar_where_param_fns!(_prisma::read_filters::IntFilter, BookId, { - fn in_vec(_: Vec) -> InVec; - fn not_in_vec(_: Vec) -> NotInVec; - fn lt(_: i32) -> Lt; - fn lte(_: i32) -> Lte; - fn gt(_: i32) -> Gt; - fn gte(_: i32) -> Gte; - fn not(_: i32) -> Not; - }); - pub fn increment(value: i32) -> SetParam { - SetParam::IncrementBookId(value) - } - pub fn decrement(value: i32) -> SetParam { - SetParam::DecrementBookId(value) - } - pub fn multiply(value: i32) -> SetParam { - SetParam::MultiplyBookId(value) - } - pub fn divide(value: i32) -> SetParam { - SetParam::DivideBookId(value) - } - pub struct Include; - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::BookId(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - pub struct Select; - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::BookId(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - ::prisma_client_rust::sel(NAME) - } - } - } - pub mod author { - use super::super::*; - - use super::{SetParam, WhereParam, WithParam}; - pub const NAME: &str = "author"; - pub struct Fetch(pub author::UniqueArgs); - impl Fetch { - pub fn with(mut self, params: impl Into) -> Self { - self.0 = self.0.with(params.into()); - self - } - } - impl From for WithParam { - fn from(Fetch(v): Fetch) -> Self { - WithParam::Author(v) - } - } - pub fn fetch() -> Fetch { - Fetch(author::UniqueArgs::new()) - } - pub struct Connect(author::UniqueWhereParam); - impl From for SetParam { - fn from(Connect(v): Connect) -> Self { - Self::ConnectAuthor(v) - } - } - pub fn connect>(value: author::UniqueWhereParam) -> T { - Connect(value).into() - } - pub fn is(value: Vec) -> WhereParam { - WhereParam::AuthorIs(value) - } - pub fn is_not(value: Vec) -> WhereParam { - WhereParam::AuthorIsNot(value) - } - pub enum Include { - Select(Vec), - Include(Vec), - Fetch, - } - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::Author(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let selections = match self { - Self::Select(selections) => { - selections.into_iter().map(|s| s.to_selection()).collect() - } - Self::Include(selections) => { - let mut nested_selections = - ::scalar_selections( - ); - nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); - nested_selections - } - Self::Fetch => { - ::scalar_selections() - } - }; - ::prisma_client_rust::Selection::new("author", None, [], selections) - } - pub fn select(nested_selections: Vec) -> Self { - Self::Select(nested_selections) - } - pub fn include(nested_selections: Vec) -> Self { - Self::Include(nested_selections) - } - } - pub enum Select { - Select(Vec), - Include(Vec), - Fetch, - } - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::Author(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let selections = match self { - Self::Select(selections) => { - selections.into_iter().map(|s| s.to_selection()).collect() - } - Self::Include(selections) => { - let mut nested_selections = vec![]; - nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); - nested_selections - } - Self::Fetch => { - ::scalar_selections() - } - }; - ::prisma_client_rust::Selection::new("author", None, [], selections) - } - pub fn select(nested_selections: Vec) -> Self { - Self::Select(nested_selections) - } - pub fn include(nested_selections: Vec) -> Self { - Self::Include(nested_selections) - } - } - } - pub mod book { - use super::super::*; - - use super::{SetParam, WhereParam, WithParam}; - pub const NAME: &str = "book"; - pub struct Fetch(pub book::UniqueArgs); - impl Fetch { - pub fn with(mut self, params: impl Into) -> Self { - self.0 = self.0.with(params.into()); - self - } - } - impl From for WithParam { - fn from(Fetch(v): Fetch) -> Self { - WithParam::Book(v) - } - } - pub fn fetch() -> Fetch { - Fetch(book::UniqueArgs::new()) - } - pub struct Connect(book::UniqueWhereParam); - impl From for SetParam { - fn from(Connect(v): Connect) -> Self { - Self::ConnectBook(v) - } - } - pub fn connect>(value: book::UniqueWhereParam) -> T { - Connect(value).into() - } - pub fn is(value: Vec) -> WhereParam { - WhereParam::BookIs(value) - } - pub fn is_not(value: Vec) -> WhereParam { - WhereParam::BookIsNot(value) - } - pub enum Include { - Select(Vec), - Include(Vec), - Fetch, - } - impl Into for Include { - fn into(self) -> super::IncludeParam { - super::IncludeParam::Book(self) - } - } - impl Include { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let selections = match self { - Self::Select(selections) => { - selections.into_iter().map(|s| s.to_selection()).collect() - } - Self::Include(selections) => { - let mut nested_selections = - ::scalar_selections(); - nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); - nested_selections - } - Self::Fetch => { - ::scalar_selections() - } - }; - ::prisma_client_rust::Selection::new("book", None, [], selections) - } - pub fn select(nested_selections: Vec) -> Self { - Self::Select(nested_selections) - } - pub fn include(nested_selections: Vec) -> Self { - Self::Include(nested_selections) - } - } - pub enum Select { - Select(Vec), - Include(Vec), - Fetch, - } - impl Into for Select { - fn into(self) -> super::SelectParam { - super::SelectParam::Book(self) - } - } - impl Select { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - let selections = match self { - Self::Select(selections) => { - selections.into_iter().map(|s| s.to_selection()).collect() - } - Self::Include(selections) => { - let mut nested_selections = vec![]; - nested_selections.extend(selections.into_iter().map(|s| s.to_selection())); - nested_selections - } - Self::Fetch => { - ::scalar_selections() - } - }; - ::prisma_client_rust::Selection::new("book", None, [], selections) - } - pub fn select(nested_selections: Vec) -> Self { - Self::Select(nested_selections) - } - pub fn include(nested_selections: Vec) -> Self { - Self::Include(nested_selections) - } - } - } - pub fn book_id_author_id>(book_id: i32, author_id: i32) -> T { - UniqueWhereParam::BookIdAuthorIdEquals(book_id, author_id).into() - } - pub fn create( - position: i32, - author: super::author::UniqueWhereParam, - book: super::book::UniqueWhereParam, - _params: Vec, - ) -> ( - i32, - super::author::UniqueWhereParam, - super::book::UniqueWhereParam, - Vec, - ) { - (position, author, book, _params) - } - pub fn create_unchecked( - position: i32, - author_id: i32, - book_id: i32, - _params: Vec, - ) -> (i32, i32, i32, Vec) { - (position, author_id, book_id, _params) - } - #[macro_export] - macro_rules ! _select_translator { ($ (($ ($ func_arg : ident : $ func_arg_ty : ty) , +) =>) ? $ module_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { # [allow (warnings)] pub mod $ module_name { crate :: prisma :: translator :: select ! (@ definitions ; $ module_name ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; use super :: * ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: SelectType for Selection { type Data = Data ; type ModelData = crate :: prisma :: translator :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn select ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: translator :: select ! (@ selections_to_params ; : select { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () ,] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } } ; ({ $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { { crate :: prisma :: translator :: select ! (@ definitions ; ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: SelectType for Selection { type Data = Data ; type ModelData = crate :: prisma :: translator :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: translator :: select ! (@ selections_to_params ; : select { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () ,] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } ; (@ definitions ; $ ($ module_name : ident) ? ; $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) +) => { # [allow (warnings)] enum Fields { id , position , author_id , book_id , author , book } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] pub struct Data { $ (pub $ field : crate :: prisma :: translator :: select ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } impl :: serde :: Serialize for Data { fn serialize < S > (& self , serializer : S) -> Result < S :: Ok , S :: Error > where S : :: serde :: Serializer , { use :: serde :: ser :: SerializeStruct ; let mut state = serializer . serialize_struct ("Data" , [$ (stringify ! ($ field) ,) +] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: translator :: $ field :: NAME , & self . $ field) ? ;) * state . end () } } impl < 'de > :: serde :: Deserialize < 'de > for Data { fn deserialize < D > (deserializer : D) -> Result < Self , D :: Error > where D : :: serde :: Deserializer < 'de > , { # [allow (warnings)] enum Field { $ ($ field) , + , } impl < 'de > :: serde :: Deserialize < 'de > for Field { fn deserialize < D > (deserializer : D) -> Result < Field , D :: Error > where D : :: serde :: Deserializer < 'de > , { struct FieldVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for FieldVisitor { type Value = Field ; fn expecting (& self , formatter : & mut :: std :: fmt :: Formatter) -> :: std :: fmt :: Result { formatter . write_str (& [$ (crate :: prisma :: translator :: $ field :: NAME) , + ,] . into_iter () . collect :: < Vec < _ >> () . join (", ")) } fn visit_str < E > (self , value : & str) -> Result < Field , E > where E : :: serde :: de :: Error , { match value { $ (crate :: prisma :: translator :: $ field :: NAME => Ok (Field :: $ field)) , * , _ => Err (:: serde :: de :: Error :: unknown_field (value , FIELDS)) , } } } deserializer . deserialize_identifier (FieldVisitor) } } struct DataVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for DataVisitor { type Value = Data ; fn expecting (& self , formatter : & mut std :: fmt :: Formatter) -> std :: fmt :: Result { formatter . write_str ("struct Data") } fn visit_map < V > (self , mut map : V) -> Result < Data , V :: Error > where V : :: serde :: de :: MapAccess < 'de > , { $ (let mut $ field = None ;) * while let Some (key) = map . next_key () ? { match key { $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: translator :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: translator :: $ field :: NAME)) ? ;) * Ok (Data { $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "position" , "author_id" , "book_id" , "author" , "book"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: translator :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; id) => { i32 } ; (@ field_type ; position) => { i32 } ; (@ field_type ; author_id) => { i32 } ; (@ field_type ; book_id) => { i32 } ; (@ field_type ; author : $ selection_mode : ident { $ ($ selections : tt) + }) => { author :: Data } ; (@ field_type ; author) => { crate :: prisma :: author :: Data } ; (@ field_type ; book : $ selection_mode : ident { $ ($ selections : tt) + }) => { book :: Data } ; (@ field_type ; book) => { crate :: prisma :: book :: Data } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "Translator" , available relations are "id, position, author_id, book_id, author, book")) } ; (@ field_module ; author : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: author :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; book : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: book :: select ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; id) => { Into :: < crate :: prisma :: translator :: SelectParam > :: into (crate :: prisma :: translator :: id :: Select) } ; (@ selection_field_to_selection_param ; position) => { Into :: < crate :: prisma :: translator :: SelectParam > :: into (crate :: prisma :: translator :: position :: Select) } ; (@ selection_field_to_selection_param ; author_id) => { Into :: < crate :: prisma :: translator :: SelectParam > :: into (crate :: prisma :: translator :: author_id :: Select) } ; (@ selection_field_to_selection_param ; book_id) => { Into :: < crate :: prisma :: translator :: SelectParam > :: into (crate :: prisma :: translator :: book_id :: Select) } ; (@ selection_field_to_selection_param ; author $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: translator :: SelectParam > :: into (crate :: prisma :: translator :: author :: Select :: $ selection_mode (crate :: prisma :: author :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; author $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: translator :: SelectParam > :: into (crate :: prisma :: translator :: author :: Select :: Fetch) } } ; (@ selection_field_to_selection_param ; book $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: translator :: SelectParam > :: into (crate :: prisma :: translator :: book :: Select :: $ selection_mode (crate :: prisma :: book :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; book $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: translator :: SelectParam > :: into (crate :: prisma :: translator :: book :: Select :: Fetch) } } ; (@ selection_field_to_selection_param ; $ ($ tokens : tt) *) => { compile_error ! (stringify ! ($ ($ tokens) *)) } ; (@ selections_to_params ; : $ macro_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { [$ (crate :: prisma :: translator :: $ macro_name ! (@ selection_field_to_selection_param ; $ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) ,) +] } ; (@ filters_to_args ;) => { vec ! [] } ; (@ filters_to_args ; $ ($ t : tt) *) => { $ ($ t) * } ; (@ field_serde_name ; id) => { "id" } ; (@ field_serde_name ; position) => { "position" } ; (@ field_serde_name ; author_id) => { "author_id" } ; (@ field_serde_name ; book_id) => { "book_id" } ; (@ field_serde_name ; author) => { "author" } ; (@ field_serde_name ; book) => { "book" } ; } - pub use _select_translator as select; - pub enum SelectParam { - Id(id::Select), - Position(position::Select), - AuthorId(author_id::Select), - BookId(book_id::Select), - Author(author::Select), - Book(book::Select), - } - impl SelectParam { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - match self { - Self::Id(data) => data.to_selection(), - Self::Position(data) => data.to_selection(), - Self::AuthorId(data) => data.to_selection(), - Self::BookId(data) => data.to_selection(), - Self::Author(data) => data.to_selection(), - Self::Book(data) => data.to_selection(), - } - } - } - #[macro_export] - macro_rules ! _include_translator { ($ (($ ($ func_arg : ident : $ func_arg_ty : ty) , +) =>) ? $ module_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { # [allow (warnings)] pub mod $ module_name { crate :: prisma :: translator :: include ! (@ definitions ; $ module_name ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; use super :: * ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: IncludeType for Selection { type Data = Data ; type ModelData = crate :: prisma :: translator :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } pub fn include ($ ($ ($ func_arg : $ func_arg_ty) , +) ?) -> Selection { Selection ([crate :: prisma :: translator :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: translator :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } } ; ({ $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { { crate :: prisma :: translator :: include ! (@ definitions ; ; $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) +) ; pub struct Selection (Vec < :: prisma_client_rust :: Selection >) ; impl :: prisma_client_rust :: IncludeType for Selection { type Data = Data ; type ModelData = crate :: prisma :: translator :: Data ; fn to_selections (self) -> Vec < :: prisma_client_rust :: Selection > { self . 0 } } Selection ([crate :: prisma :: translator :: include ! (@ selections_to_params ; : include { $ ($ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) + }) . into_iter () . map (| p | p . to_selection ()) . collect :: < Vec < _ >> () , < crate :: prisma :: translator :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections ()] . into_iter () . flatten () . collect :: < Vec < _ >> ()) } } ; (@ definitions ; $ ($ module_name : ident) ? ; $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) +) => { # [allow (warnings)] enum Fields { author , book } # [allow (warnings)] impl Fields { fn selections () { $ (let _ = Fields :: $ field ;) + } } # [allow (warnings)] # [derive (std :: fmt :: Debug , Clone)] pub struct Data { pub id : i32 , pub position : i32 , pub author_id : i32 , pub book_id : i32 , $ (pub $ field : crate :: prisma :: translator :: include ! (@ field_type ; $ field $ (: $ selection_mode { $ ($ selections) + }) ?) ,) + } impl :: serde :: Serialize for Data { fn serialize < S > (& self , serializer : S) -> Result < S :: Ok , S :: Error > where S : :: serde :: Serializer , { use :: serde :: ser :: SerializeStruct ; let mut state = serializer . serialize_struct ("Data" , [$ (stringify ! ($ field) ,) + stringify ! (id) , stringify ! (position) , stringify ! (author_id) , stringify ! (book_id)] . len ()) ? ; $ (state . serialize_field (crate :: prisma :: translator :: $ field :: NAME , & self . $ field) ? ;) * state . serialize_field (crate :: prisma :: translator :: id :: NAME , & self . id) ? ; state . serialize_field (crate :: prisma :: translator :: position :: NAME , & self . position) ? ; state . serialize_field (crate :: prisma :: translator :: author_id :: NAME , & self . author_id) ? ; state . serialize_field (crate :: prisma :: translator :: book_id :: NAME , & self . book_id) ? ; state . end () } } impl < 'de > :: serde :: Deserialize < 'de > for Data { fn deserialize < D > (deserializer : D) -> Result < Self , D :: Error > where D : :: serde :: Deserializer < 'de > , { # [allow (warnings)] enum Field { $ ($ field) , + , id , position , author_id , book_id } impl < 'de > :: serde :: Deserialize < 'de > for Field { fn deserialize < D > (deserializer : D) -> Result < Field , D :: Error > where D : :: serde :: Deserializer < 'de > , { struct FieldVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for FieldVisitor { type Value = Field ; fn expecting (& self , formatter : & mut :: std :: fmt :: Formatter) -> :: std :: fmt :: Result { formatter . write_str (& [$ (crate :: prisma :: translator :: $ field :: NAME) , + , crate :: prisma :: translator :: id :: NAME , crate :: prisma :: translator :: position :: NAME , crate :: prisma :: translator :: author_id :: NAME , crate :: prisma :: translator :: book_id :: NAME] . into_iter () . collect :: < Vec < _ >> () . join (", ")) } fn visit_str < E > (self , value : & str) -> Result < Field , E > where E : :: serde :: de :: Error , { match value { $ (crate :: prisma :: translator :: $ field :: NAME => Ok (Field :: $ field)) , * , crate :: prisma :: translator :: id :: NAME => Ok (Field :: id) , crate :: prisma :: translator :: position :: NAME => Ok (Field :: position) , crate :: prisma :: translator :: author_id :: NAME => Ok (Field :: author_id) , crate :: prisma :: translator :: book_id :: NAME => Ok (Field :: book_id) , _ => Err (:: serde :: de :: Error :: unknown_field (value , FIELDS)) , } } } deserializer . deserialize_identifier (FieldVisitor) } } struct DataVisitor ; impl < 'de > :: serde :: de :: Visitor < 'de > for DataVisitor { type Value = Data ; fn expecting (& self , formatter : & mut std :: fmt :: Formatter) -> std :: fmt :: Result { formatter . write_str ("struct Data") } fn visit_map < V > (self , mut map : V) -> Result < Data , V :: Error > where V : :: serde :: de :: MapAccess < 'de > , { $ (let mut $ field = None ;) * let mut id = None ; let mut position = None ; let mut author_id = None ; let mut book_id = None ; while let Some (key) = map . next_key () ? { match key { Field :: id => { if id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: translator :: id :: NAME)) ; } id = Some (map . next_value () ?) ; } Field :: position => { if position . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: translator :: position :: NAME)) ; } position = Some (map . next_value () ?) ; } Field :: author_id => { if author_id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: translator :: author_id :: NAME)) ; } author_id = Some (map . next_value () ?) ; } Field :: book_id => { if book_id . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: translator :: book_id :: NAME)) ; } book_id = Some (map . next_value () ?) ; } $ (Field :: $ field => { if $ field . is_some () { return Err (:: serde :: de :: Error :: duplicate_field (crate :: prisma :: translator :: $ field :: NAME)) ; } $ field = Some (map . next_value () ?) ; }) * } } $ (let $ field = $ field . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: translator :: $ field :: NAME)) ? ;) * let id = id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: translator :: id :: NAME)) ? ; let position = position . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: translator :: position :: NAME)) ? ; let author_id = author_id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: translator :: author_id :: NAME)) ? ; let book_id = book_id . ok_or_else (|| serde :: de :: Error :: missing_field (crate :: prisma :: translator :: book_id :: NAME)) ? ; Ok (Data { id , position , author_id , book_id , $ ($ field) , * }) } } const FIELDS : & 'static [& 'static str] = & ["id" , "position" , "author_id" , "book_id" , "author" , "book"] ; deserializer . deserialize_struct ("Data" , FIELDS , DataVisitor) } } $ ($ (pub mod $ field { crate :: prisma :: translator :: $ selection_mode ! (@ field_module ; $ field : $ selection_mode { $ ($ selections) + }) ; }) ?) + } ; (@ field_type ; author : $ selection_mode : ident { $ ($ selections : tt) + }) => { author :: Data } ; (@ field_type ; author) => { crate :: prisma :: author :: Data } ; (@ field_type ; book : $ selection_mode : ident { $ ($ selections : tt) + }) => { book :: Data } ; (@ field_type ; book) => { crate :: prisma :: book :: Data } ; (@ field_type ; $ field : ident $ ($ tokens : tt) *) => { compile_error ! (stringify ! (Cannot include nonexistent relation $ field on model "Translator" , available relations are "author, book")) } ; (@ field_module ; author : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: author :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; book : $ selection_mode : ident { $ ($ selections : tt) + }) => { crate :: prisma :: book :: include ! (@ definitions ; ; $ ($ selections) +) ; } ; (@ field_module ; $ ($ tokens : tt) *) => { } ; (@ selection_field_to_selection_param ; author $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: translator :: IncludeParam > :: into (crate :: prisma :: translator :: author :: Include :: $ selection_mode (crate :: prisma :: author :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; author $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: translator :: IncludeParam > :: into (crate :: prisma :: translator :: author :: Include :: Fetch) } } ; (@ selection_field_to_selection_param ; book $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? : $ selection_mode : ident { $ ($ selections : tt) + }) => { { Into :: < crate :: prisma :: translator :: IncludeParam > :: into (crate :: prisma :: translator :: book :: Include :: $ selection_mode (crate :: prisma :: book :: select ! (@ selections_to_params ; : $ selection_mode { $ ($ selections) + }) . into_iter () . collect ())) } } ; (@ selection_field_to_selection_param ; book $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ?) => { { Into :: < crate :: prisma :: translator :: IncludeParam > :: into (crate :: prisma :: translator :: book :: Include :: Fetch) } } ; (@ selection_field_to_selection_param ; $ ($ tokens : tt) *) => { compile_error ! (stringify ! ($ ($ tokens) *)) } ; (@ selections_to_params ; : $ macro_name : ident { $ ($ field : ident $ (($ ($ filters : tt) +) $ (. $ arg : ident ($ ($ arg_params : tt) *)) *) ? $ (: $ selection_mode : ident { $ ($ selections : tt) + }) ?) + }) => { [$ (crate :: prisma :: translator :: $ macro_name ! (@ selection_field_to_selection_param ; $ field $ (($ ($ filters) +) $ (. $ arg ($ ($ arg_params) *)) *) ? $ (: $ selection_mode { $ ($ selections) + }) ?) ,) +] } ; (@ filters_to_args ;) => { vec ! [] } ; (@ filters_to_args ; $ ($ t : tt) *) => { $ ($ t) * } ; (@ field_serde_name ; id) => { "id" } ; (@ field_serde_name ; position) => { "position" } ; (@ field_serde_name ; author_id) => { "author_id" } ; (@ field_serde_name ; book_id) => { "book_id" } ; (@ field_serde_name ; author) => { "author" } ; (@ field_serde_name ; book) => { "book" } ; } - pub use _include_translator as include; - pub enum IncludeParam { - Id(id::Include), - Position(position::Include), - AuthorId(author_id::Include), - BookId(book_id::Include), - Author(author::Include), - Book(book::Include), - } - impl IncludeParam { - pub fn to_selection(self) -> ::prisma_client_rust::Selection { - match self { - Self::Id(data) => data.to_selection(), - Self::Position(data) => data.to_selection(), - Self::AuthorId(data) => data.to_selection(), - Self::BookId(data) => data.to_selection(), - Self::Author(data) => data.to_selection(), - Self::Book(data) => data.to_selection(), - } - } - } - #[macro_export] - macro_rules ! _partial_unchecked_translator { ($ struct_name : ident { $ ($ scalar_field : ident) + }) => { :: prisma_client_rust :: macros :: partial_unchecked ! { crate :: prisma :: translator struct $ struct_name { # [serde (rename = "id")] pub id : i32 , # [serde (rename = "position")] pub position : i32 , # [serde (rename = "author_id")] pub author_id : i32 , # [serde (rename = "book_id")] pub book_id : i32 } [$ ($ scalar_field) , +] } } ; } - pub use _partial_unchecked_translator as partial_unchecked; - #[derive(Debug, Clone, :: serde :: Serialize, :: serde :: Deserialize)] - pub struct Data { - #[serde(rename = "id")] - pub id: i32, - #[serde(rename = "position")] - pub position: i32, - #[serde(rename = "author_id")] - pub author_id: i32, - #[serde(rename = "book_id")] - pub book_id: i32, - #[serde(rename = "author")] - pub author: Option>, - #[serde(rename = "book")] - pub book: Option>, - } - impl Data { - pub fn author( - &self, - ) -> Result<&super::author::Data, ::prisma_client_rust::RelationNotFetchedError> { - self.author - .as_ref() - .ok_or(::prisma_client_rust::RelationNotFetchedError::new( - stringify!(author), - )) - .map(|v| v.as_ref()) - } - pub fn book( - &self, - ) -> Result<&super::book::Data, ::prisma_client_rust::RelationNotFetchedError> { - self.book - .as_ref() - .ok_or(::prisma_client_rust::RelationNotFetchedError::new( - stringify!(book), - )) - .map(|v| v.as_ref()) - } - } - #[derive(Clone)] - pub enum WithParam { - Author(super::author::UniqueArgs), - Book(super::book::UniqueArgs), - } - impl Into<::prisma_client_rust::Selection> for WithParam { - fn into(self) -> ::prisma_client_rust::Selection { - match self { - Self::Author(args) => { - let mut selections = < super :: author :: Types as :: prisma_client_rust :: ModelTypes > :: scalar_selections () ; - selections.extend( - args.with_params - .into_iter() - .map(Into::<::prisma_client_rust::Selection>::into), - ); - ::prisma_client_rust::Selection::new(author::NAME, None, [], selections) - } - Self::Book(args) => { - let mut selections = - ::scalar_selections( - ); - selections.extend( - args.with_params - .into_iter() - .map(Into::<::prisma_client_rust::Selection>::into), - ); - ::prisma_client_rust::Selection::new(book::NAME, None, [], selections) - } - } - } - } - #[derive(Clone)] - pub enum SetParam { - SetId(i32), - IncrementId(i32), - DecrementId(i32), - MultiplyId(i32), - DivideId(i32), - SetPosition(i32), - IncrementPosition(i32), - DecrementPosition(i32), - MultiplyPosition(i32), - DividePosition(i32), - SetAuthorId(i32), - IncrementAuthorId(i32), - DecrementAuthorId(i32), - MultiplyAuthorId(i32), - DivideAuthorId(i32), - SetBookId(i32), - IncrementBookId(i32), - DecrementBookId(i32), - MultiplyBookId(i32), - DivideBookId(i32), - ConnectAuthor(super::author::UniqueWhereParam), - ConnectBook(super::book::UniqueWhereParam), - } - impl From for (String, ::prisma_client_rust::PrismaValue) { - fn from(param: SetParam) -> Self { - match param { - SetParam::SetId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - ), - SetParam::IncrementId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "increment".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DecrementId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "decrement".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::MultiplyId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "multiply".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DivideId(value) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "divide".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::SetPosition(value) => ( - position::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - ), - SetParam::IncrementPosition(value) => ( - position::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "increment".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DecrementPosition(value) => ( - position::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "decrement".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::MultiplyPosition(value) => ( - position::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "multiply".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DividePosition(value) => ( - position::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "divide".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::SetAuthorId(value) => ( - author_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - ), - SetParam::IncrementAuthorId(value) => ( - author_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "increment".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DecrementAuthorId(value) => ( - author_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "decrement".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::MultiplyAuthorId(value) => ( - author_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "multiply".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DivideAuthorId(value) => ( - author_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "divide".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::SetBookId(value) => ( - book_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - ), - SetParam::IncrementBookId(value) => ( - book_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "increment".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DecrementBookId(value) => ( - book_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "decrement".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::MultiplyBookId(value) => ( - book_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "multiply".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::DivideBookId(value) => ( - book_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "divide".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - ), - SetParam::ConnectAuthor(where_param) => ( - author::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "connect".to_string(), - ::prisma_client_rust::PrismaValue::Object( - [where_param] - .into_iter() - .map(Into::::into) - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - SetParam::ConnectBook(where_param) => ( - book::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Object(vec![( - "connect".to_string(), - ::prisma_client_rust::PrismaValue::Object( - [where_param] - .into_iter() - .map(Into::::into) - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - } - } - } - #[derive(Clone)] - pub enum UncheckedSetParam { - Id(i32), - Position(i32), - AuthorId(i32), - BookId(i32), - } - impl From for SetParam { - fn from(param: UncheckedSetParam) -> Self { - match param { - UncheckedSetParam::Id(value) => Self::SetId(value), - UncheckedSetParam::Position(value) => Self::SetPosition(value), - UncheckedSetParam::AuthorId(value) => Self::SetAuthorId(value), - UncheckedSetParam::BookId(value) => Self::SetBookId(value), - } - } - } - #[derive(Clone)] - pub enum OrderByParam { - Id(::prisma_client_rust::Direction), - Position(::prisma_client_rust::Direction), - AuthorId(::prisma_client_rust::Direction), - BookId(::prisma_client_rust::Direction), - } - impl Into<(String, ::prisma_client_rust::PrismaValue)> for OrderByParam { - fn into(self) -> (String, ::prisma_client_rust::PrismaValue) { - match self { - Self::Id(direction) => ( - id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(direction.to_string()), - ), - Self::Position(direction) => ( - position::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(direction.to_string()), - ), - Self::AuthorId(direction) => ( - author_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(direction.to_string()), - ), - Self::BookId(direction) => ( - book_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::String(direction.to_string()), - ), - } - } - } - #[derive(Clone)] - pub enum WhereParam { - Not(Vec), - Or(Vec), - And(Vec), - BookIdAuthorIdEquals(i32, i32), - Id(_prisma::read_filters::IntFilter), - Position(_prisma::read_filters::IntFilter), - AuthorId(_prisma::read_filters::IntFilter), - BookId(_prisma::read_filters::IntFilter), - AuthorIs(Vec), - AuthorIsNot(Vec), - BookIs(Vec), - BookIsNot(Vec), - } - impl ::prisma_client_rust::WhereInput for WhereParam { - fn serialize(self) -> ::prisma_client_rust::SerializedWhereInput { - let (name, value) = match self { - Self::Not(value) => ( - "NOT", - ::prisma_client_rust::SerializedWhereValue::Object( - ::prisma_client_rust::merge_fields( - value - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(Into::into) - .collect(), - ), - ), - ), - Self::Or(value) => ( - "OR", - ::prisma_client_rust::SerializedWhereValue::List( - value - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(Into::into) - .map(|v| vec![v]) - .map(::prisma_client_rust::PrismaValue::Object) - .collect(), - ), - ), - Self::And(value) => ( - "AND", - ::prisma_client_rust::SerializedWhereValue::Object( - ::prisma_client_rust::merge_fields( - value - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(Into::into) - .collect(), - ), - ), - ), - Self::BookIdAuthorIdEquals(book_id, author_id) => ( - "book_id_author_id", - ::prisma_client_rust::SerializedWhereValue::Object(vec![ - ( - book_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Int(book_id as i64), - ), - ( - author_id::NAME.to_string(), - ::prisma_client_rust::PrismaValue::Int(author_id as i64), - ), - ]), - ), - Self::Id(value) => (id::NAME, value.into()), - Self::Position(value) => (position::NAME, value.into()), - Self::AuthorId(value) => (author_id::NAME, value.into()), - Self::BookId(value) => (book_id::NAME, value.into()), - Self::AuthorIs(where_params) => ( - author::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "is".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::AuthorIsNot(where_params) => ( - author::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "isNot".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::BookIs(where_params) => ( - book::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "is".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - Self::BookIsNot(where_params) => ( - book::NAME, - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "isNot".to_string(), - ::prisma_client_rust::PrismaValue::Object( - where_params - .into_iter() - .map(::prisma_client_rust::WhereInput::serialize) - .map(::prisma_client_rust::SerializedWhereInput::transform_equals) - .collect(), - ), - )]), - ), - }; - ::prisma_client_rust::SerializedWhereInput::new(name, value.into()) - } - } - #[derive(Clone)] - pub enum UniqueWhereParam { - BookIdAuthorIdEquals(i32, i32), - IdEquals(i32), - } - impl From for WhereParam { - fn from(value: UniqueWhereParam) -> Self { - match value { - UniqueWhereParam::BookIdAuthorIdEquals(book_id, author_id) => { - Self::BookIdAuthorIdEquals(book_id, author_id) - } - UniqueWhereParam::IdEquals(value) => { - Self::Id(_prisma::read_filters::IntFilter::Equals(value)) - } - } - } - } - impl From<::prisma_client_rust::Operator> for WhereParam { - fn from(op: ::prisma_client_rust::Operator) -> Self { - match op { - ::prisma_client_rust::Operator::Not(value) => Self::Not(value), - ::prisma_client_rust::Operator::And(value) => Self::And(value), - ::prisma_client_rust::Operator::Or(value) => Self::Or(value), - } - } - } - #[derive(Clone)] - pub struct Types; - impl ::prisma_client_rust::ModelTypes for Types { - type Data = Data; - type Where = WhereParam; - type UncheckedSet = UncheckedSetParam; - type Set = SetParam; - type With = WithParam; - type OrderBy = OrderByParam; - type Cursor = UniqueWhereParam; - const MODEL: &'static str = NAME; - fn scalar_selections() -> Vec<::prisma_client_rust::Selection> { - vec![ - ::prisma_client_rust::sel(id::NAME), - ::prisma_client_rust::sel(position::NAME), - ::prisma_client_rust::sel(author_id::NAME), - ::prisma_client_rust::sel(book_id::NAME), - ] - } - } - pub type UniqueArgs = ::prisma_client_rust::UniqueArgs; - pub type ManyArgs = ::prisma_client_rust::ManyArgs; - pub type Count<'a> = ::prisma_client_rust::Count<'a, Types>; - pub type Create<'a> = ::prisma_client_rust::Create<'a, Types>; - pub type CreateMany<'a> = ::prisma_client_rust::CreateMany<'a, Types>; - pub type FindUnique<'a> = ::prisma_client_rust::FindUnique<'a, Types>; - pub type FindMany<'a> = ::prisma_client_rust::FindMany<'a, Types>; - pub type FindFirst<'a> = ::prisma_client_rust::FindFirst<'a, Types>; - pub type Update<'a> = ::prisma_client_rust::Update<'a, Types>; - pub type UpdateMany<'a> = ::prisma_client_rust::UpdateMany<'a, Types>; - pub type Upsert<'a> = ::prisma_client_rust::Upsert<'a, Types>; - pub type Delete<'a> = ::prisma_client_rust::Delete<'a, Types>; - pub type DeleteMany<'a> = ::prisma_client_rust::DeleteMany<'a, Types>; - #[derive(Clone)] - pub struct Actions<'a> { - pub client: &'a ::prisma_client_rust::PrismaClientInternals, - } - impl<'a> Actions<'a> { - pub fn find_unique(self, _where: UniqueWhereParam) -> FindUnique<'a> { - FindUnique::new(self.client, _where.into()) - } - pub fn find_first(self, _where: Vec) -> FindFirst<'a> { - FindFirst::new(self.client, _where) - } - pub fn find_many(self, _where: Vec) -> FindMany<'a> { - FindMany::new(self.client, _where) - } - pub fn create( - self, - position: i32, - author: super::author::UniqueWhereParam, - book: super::book::UniqueWhereParam, - mut _params: Vec, - ) -> Create<'a> { - _params.extend([ - position::set(position), - author::connect(author), - book::connect(book), - ]); - Create::new(self.client, _params) - } - pub fn create_unchecked( - self, - position: i32, - author_id: i32, - book_id: i32, - mut _params: Vec, - ) -> Create<'a> { - _params.extend([ - position::set(position), - author_id::set(author_id), - book_id::set(book_id), - ]); - Create::new(self.client, _params.into_iter().map(Into::into).collect()) - } - pub fn create_many(self, data: Vec<(i32, i32, i32, Vec)>) -> CreateMany<'a> { - let data = data - .into_iter() - .map(|(position, author_id, book_id, mut _params)| { - _params.extend([ - position::set(position), - author_id::set(author_id), - book_id::set(book_id), - ]); - _params - }) - .collect(); - CreateMany::new(self.client, data) - } - pub fn update(self, _where: UniqueWhereParam, _params: Vec) -> Update<'a> { - Update::new(self.client, _where.into(), _params, vec![]) - } - pub fn update_unchecked( - self, - _where: UniqueWhereParam, - _params: Vec, - ) -> Update<'a> { - Update::new( - self.client, - _where.into(), - _params.into_iter().map(Into::into).collect(), - vec![], - ) - } - pub fn update_many( - self, - _where: Vec, - _params: Vec, - ) -> UpdateMany<'a> { - UpdateMany::new(self.client, _where, _params) - } - pub fn upsert( - self, - _where: UniqueWhereParam, - (position, author, book, mut _params): ( - i32, - super::author::UniqueWhereParam, - super::book::UniqueWhereParam, - Vec, - ), - _update: Vec, - ) -> Upsert<'a> { - _params.extend([ - position::set(position), - author::connect(author), - book::connect(book), - ]); - Upsert::new(self.client, _where.into(), _params, _update) - } - pub fn delete(self, _where: UniqueWhereParam) -> Delete<'a> { - Delete::new(self.client, _where.into(), vec![]) - } - pub fn delete_many(self, _where: Vec) -> DeleteMany<'a> { - DeleteMany::new(self.client, _where) - } - pub fn count(self, _where: Vec) -> Count<'a> { - Count::new(self.client, _where) - } - } -} -pub mod _prisma { - pub struct PrismaClientBuilder { - url: Option, - action_notifier: ::prisma_client_rust::ActionNotifier, - } - impl PrismaClientBuilder { - fn new() -> Self { - Self { - url: None, - action_notifier: ::prisma_client_rust::ActionNotifier::new(), - } - } - pub fn with_url(mut self, url: String) -> Self { - self.url = Some(url); - self - } - pub async fn build(self) -> Result { - let internals = ::prisma_client_rust::PrismaClientInternals::new( - self.url, - self.action_notifier, - super::DATAMODEL_STR, - ) - .await?; - Ok(PrismaClient(internals)) - } - } - pub struct PrismaClient(::prisma_client_rust::PrismaClientInternals); - impl ::std::fmt::Debug for PrismaClient { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - f.debug_struct("PrismaClient").finish() - } - } - impl PrismaClient { - pub fn _builder() -> PrismaClientBuilder { - PrismaClientBuilder::new() - } - pub fn _query_raw( - &self, - query: ::prisma_client_rust::Raw, - ) -> ::prisma_client_rust::QueryRaw { - ::prisma_client_rust::QueryRaw::new(&self.0, query, super::DATABASE_STR) - } - pub fn _execute_raw( - &self, - query: ::prisma_client_rust::Raw, - ) -> ::prisma_client_rust::ExecuteRaw { - ::prisma_client_rust::ExecuteRaw::new(&self.0, query, super::DATABASE_STR) - } - pub async fn _batch< - 'batch, - T: ::prisma_client_rust::BatchContainer<'batch, Marker>, - Marker, - >( - &self, - queries: T, - ) -> ::prisma_client_rust::Result< - >::ReturnType, - > { - ::prisma_client_rust::batch(queries, &self.0).await - } - pub fn _transaction(&self) -> ::prisma_client_rust::TransactionBuilder { - ::prisma_client_rust::TransactionBuilder::_new(self, &self.0) - } - pub fn author_annotation(&self) -> super::author_annotation::Actions { - super::author_annotation::Actions { client: &self.0 } - } - pub fn author(&self) -> super::author::Actions { - super::author::Actions { client: &self.0 } - } - pub fn book_annotation(&self) -> super::book_annotation::Actions { - super::book_annotation::Actions { client: &self.0 } - } - pub fn book_author(&self) -> super::book_author::Actions { - super::book_author::Actions { client: &self.0 } - } - pub fn book_genre(&self) -> super::book_genre::Actions { - super::book_genre::Actions { client: &self.0 } - } - pub fn book_sequence(&self) -> super::book_sequence::Actions { - super::book_sequence::Actions { client: &self.0 } - } - pub fn book(&self) -> super::book::Actions { - super::book::Actions { client: &self.0 } - } - pub fn genre(&self) -> super::genre::Actions { - super::genre::Actions { client: &self.0 } - } - pub fn sequence(&self) -> super::sequence::Actions { - super::sequence::Actions { client: &self.0 } - } - pub fn source(&self) -> super::source::Actions { - super::source::Actions { client: &self.0 } - } - pub fn translator(&self) -> super::translator::Actions { - super::translator::Actions { client: &self.0 } - } - } - impl ::prisma_client_rust::PrismaClient for PrismaClient { - fn internals(&self) -> &::prisma_client_rust::PrismaClientInternals { - &self.0 - } - fn internals_mut(&mut self) -> &mut ::prisma_client_rust::PrismaClientInternals { - &mut self.0 - } - fn with_tx_id(&self, tx_id: Option<::prisma_client_rust::query_core::TxId>) -> Self { - Self(self.0.with_tx_id(tx_id)) - } - } - #[derive(Debug, Clone, Copy, :: serde :: Serialize, :: serde :: Deserialize, PartialEq, Eq)] - pub enum AuthorAnnotationScalarFieldEnum { - #[serde(rename = "id")] - Id, - #[serde(rename = "author_id")] - AuthorId, - #[serde(rename = "title")] - Title, - #[serde(rename = "text")] - Text, - #[serde(rename = "file")] - File, - } - impl ToString for AuthorAnnotationScalarFieldEnum { - fn to_string(&self) -> String { - match self { - Self::Id => "id".to_string(), - Self::AuthorId => "author_id".to_string(), - Self::Title => "title".to_string(), - Self::Text => "text".to_string(), - Self::File => "file".to_string(), - } - } - } - #[derive(Debug, Clone, Copy, :: serde :: Serialize, :: serde :: Deserialize, PartialEq, Eq)] - pub enum AuthorScalarFieldEnum { - #[serde(rename = "id")] - Id, - #[serde(rename = "source_id")] - SourceId, - #[serde(rename = "remote_id")] - RemoteId, - #[serde(rename = "first_name")] - FirstName, - #[serde(rename = "last_name")] - LastName, - #[serde(rename = "middle_name")] - MiddleName, - } - impl ToString for AuthorScalarFieldEnum { - fn to_string(&self) -> String { - match self { - Self::Id => "id".to_string(), - Self::SourceId => "source_id".to_string(), - Self::RemoteId => "remote_id".to_string(), - Self::FirstName => "first_name".to_string(), - Self::LastName => "last_name".to_string(), - Self::MiddleName => "middle_name".to_string(), - } - } - } - #[derive(Debug, Clone, Copy, :: serde :: Serialize, :: serde :: Deserialize, PartialEq, Eq)] - pub enum BookAnnotationScalarFieldEnum { - #[serde(rename = "id")] - Id, - #[serde(rename = "book_id")] - BookId, - #[serde(rename = "title")] - Title, - #[serde(rename = "text")] - Text, - #[serde(rename = "file")] - File, - } - impl ToString for BookAnnotationScalarFieldEnum { - fn to_string(&self) -> String { - match self { - Self::Id => "id".to_string(), - Self::BookId => "book_id".to_string(), - Self::Title => "title".to_string(), - Self::Text => "text".to_string(), - Self::File => "file".to_string(), - } - } - } - #[derive(Debug, Clone, Copy, :: serde :: Serialize, :: serde :: Deserialize, PartialEq, Eq)] - pub enum BookAuthorScalarFieldEnum { - #[serde(rename = "id")] - Id, - #[serde(rename = "author_id")] - AuthorId, - #[serde(rename = "book_id")] - BookId, - } - impl ToString for BookAuthorScalarFieldEnum { - fn to_string(&self) -> String { - match self { - Self::Id => "id".to_string(), - Self::AuthorId => "author_id".to_string(), - Self::BookId => "book_id".to_string(), - } - } - } - #[derive(Debug, Clone, Copy, :: serde :: Serialize, :: serde :: Deserialize, PartialEq, Eq)] - pub enum BookGenreScalarFieldEnum { - #[serde(rename = "id")] - Id, - #[serde(rename = "genre_id")] - GenreId, - #[serde(rename = "book_id")] - BookId, - } - impl ToString for BookGenreScalarFieldEnum { - fn to_string(&self) -> String { - match self { - Self::Id => "id".to_string(), - Self::GenreId => "genre_id".to_string(), - Self::BookId => "book_id".to_string(), - } - } - } - #[derive(Debug, Clone, Copy, :: serde :: Serialize, :: serde :: Deserialize, PartialEq, Eq)] - pub enum BookScalarFieldEnum { - #[serde(rename = "id")] - Id, - #[serde(rename = "source_id")] - SourceId, - #[serde(rename = "remote_id")] - RemoteId, - #[serde(rename = "title")] - Title, - #[serde(rename = "lang")] - Lang, - #[serde(rename = "file_type")] - FileType, - #[serde(rename = "uploaded")] - Uploaded, - #[serde(rename = "is_deleted")] - IsDeleted, - #[serde(rename = "pages")] - Pages, - #[serde(rename = "year")] - Year, - } - impl ToString for BookScalarFieldEnum { - fn to_string(&self) -> String { - match self { - Self::Id => "id".to_string(), - Self::SourceId => "source_id".to_string(), - Self::RemoteId => "remote_id".to_string(), - Self::Title => "title".to_string(), - Self::Lang => "lang".to_string(), - Self::FileType => "file_type".to_string(), - Self::Uploaded => "uploaded".to_string(), - Self::IsDeleted => "is_deleted".to_string(), - Self::Pages => "pages".to_string(), - Self::Year => "year".to_string(), - } - } - } - #[derive(Debug, Clone, Copy, :: serde :: Serialize, :: serde :: Deserialize, PartialEq, Eq)] - pub enum BookSequenceScalarFieldEnum { - #[serde(rename = "id")] - Id, - #[serde(rename = "position")] - Position, - #[serde(rename = "sequence_id")] - SequenceId, - #[serde(rename = "book_id")] - BookId, - } - impl ToString for BookSequenceScalarFieldEnum { - fn to_string(&self) -> String { - match self { - Self::Id => "id".to_string(), - Self::Position => "position".to_string(), - Self::SequenceId => "sequence_id".to_string(), - Self::BookId => "book_id".to_string(), - } - } - } - #[derive(Debug, Clone, Copy, :: serde :: Serialize, :: serde :: Deserialize, PartialEq, Eq)] - pub enum GenreScalarFieldEnum { - #[serde(rename = "id")] - Id, - #[serde(rename = "source_id")] - SourceId, - #[serde(rename = "remote_id")] - RemoteId, - #[serde(rename = "code")] - Code, - #[serde(rename = "description")] - Description, - #[serde(rename = "meta")] - Meta, - } - impl ToString for GenreScalarFieldEnum { - fn to_string(&self) -> String { - match self { - Self::Id => "id".to_string(), - Self::SourceId => "source_id".to_string(), - Self::RemoteId => "remote_id".to_string(), - Self::Code => "code".to_string(), - Self::Description => "description".to_string(), - Self::Meta => "meta".to_string(), - } - } - } - #[derive(Debug, Clone, Copy, :: serde :: Serialize, :: serde :: Deserialize, PartialEq, Eq)] - pub enum QueryMode { - #[serde(rename = "default")] - Default, - #[serde(rename = "insensitive")] - Insensitive, - } - impl ToString for QueryMode { - fn to_string(&self) -> String { - match self { - Self::Default => "default".to_string(), - Self::Insensitive => "insensitive".to_string(), - } - } - } - #[derive(Debug, Clone, Copy, :: serde :: Serialize, :: serde :: Deserialize, PartialEq, Eq)] - pub enum SequenceScalarFieldEnum { - #[serde(rename = "id")] - Id, - #[serde(rename = "source_id")] - SourceId, - #[serde(rename = "remote_id")] - RemoteId, - #[serde(rename = "name")] - Name, - } - impl ToString for SequenceScalarFieldEnum { - fn to_string(&self) -> String { - match self { - Self::Id => "id".to_string(), - Self::SourceId => "source_id".to_string(), - Self::RemoteId => "remote_id".to_string(), - Self::Name => "name".to_string(), - } - } - } - #[derive(Debug, Clone, Copy, :: serde :: Serialize, :: serde :: Deserialize, PartialEq, Eq)] - pub enum SortOrder { - #[serde(rename = "asc")] - Asc, - #[serde(rename = "desc")] - Desc, - } - impl ToString for SortOrder { - fn to_string(&self) -> String { - match self { - Self::Asc => "asc".to_string(), - Self::Desc => "desc".to_string(), - } - } - } - #[derive(Debug, Clone, Copy, :: serde :: Serialize, :: serde :: Deserialize, PartialEq, Eq)] - pub enum SourceScalarFieldEnum { - #[serde(rename = "id")] - Id, - #[serde(rename = "name")] - Name, - } - impl ToString for SourceScalarFieldEnum { - fn to_string(&self) -> String { - match self { - Self::Id => "id".to_string(), - Self::Name => "name".to_string(), - } - } - } - #[derive(Debug, Clone, Copy, :: serde :: Serialize, :: serde :: Deserialize, PartialEq, Eq)] - pub enum TransactionIsolationLevel { - #[serde(rename = "ReadUncommitted")] - ReadUncommitted, - #[serde(rename = "ReadCommitted")] - ReadCommitted, - #[serde(rename = "RepeatableRead")] - RepeatableRead, - #[serde(rename = "Serializable")] - Serializable, - } - impl ToString for TransactionIsolationLevel { - fn to_string(&self) -> String { - match self { - Self::ReadUncommitted => "ReadUncommitted".to_string(), - Self::ReadCommitted => "ReadCommitted".to_string(), - Self::RepeatableRead => "RepeatableRead".to_string(), - Self::Serializable => "Serializable".to_string(), - } - } - } - impl ::prisma_client_rust::TransactionIsolationLevel for TransactionIsolationLevel {} - #[derive(Debug, Clone, Copy, :: serde :: Serialize, :: serde :: Deserialize, PartialEq, Eq)] - pub enum TranslatorScalarFieldEnum { - #[serde(rename = "id")] - Id, - #[serde(rename = "position")] - Position, - #[serde(rename = "author_id")] - AuthorId, - #[serde(rename = "book_id")] - BookId, - } - impl ToString for TranslatorScalarFieldEnum { - fn to_string(&self) -> String { - match self { - Self::Id => "id".to_string(), - Self::Position => "position".to_string(), - Self::AuthorId => "author_id".to_string(), - Self::BookId => "book_id".to_string(), - } - } - } - pub mod read_filters { - #[derive(Clone)] - pub enum IntFilter { - Equals(i32), - InVec(Vec), - NotInVec(Vec), - Lt(i32), - Lte(i32), - Gt(i32), - Gte(i32), - Not(i32), - } - impl Into<::prisma_client_rust::SerializedWhereValue> for IntFilter { - fn into(self) -> ::prisma_client_rust::SerializedWhereValue { - match self { - Self::Equals(value) => { - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "equals".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]) - } - Self::InVec(value) => { - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "in".to_string(), - ::prisma_client_rust::PrismaValue::List( - value - .into_iter() - .map(|value| { - ::prisma_client_rust::PrismaValue::Int(value as i64) - }) - .collect(), - ), - )]) - } - Self::NotInVec(value) => { - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "notIn".to_string(), - ::prisma_client_rust::PrismaValue::List( - value - .into_iter() - .map(|value| { - ::prisma_client_rust::PrismaValue::Int(value as i64) - }) - .collect(), - ), - )]) - } - Self::Lt(value) => ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "lt".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - Self::Lte(value) => ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "lte".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - Self::Gt(value) => ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "gt".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - Self::Gte(value) => ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "gte".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - Self::Not(value) => ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "not".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - } - } - } - #[derive(Clone)] - pub enum IntNullableFilter { - Equals(Option), - InVec(Vec), - NotInVec(Vec), - Lt(i32), - Lte(i32), - Gt(i32), - Gte(i32), - Not(Option), - } - impl Into<::prisma_client_rust::SerializedWhereValue> for IntNullableFilter { - fn into(self) -> ::prisma_client_rust::SerializedWhereValue { - match self { - Self::Equals(value) => { - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "equals".to_string(), - value - .map(|value| ::prisma_client_rust::PrismaValue::Int(value as i64)) - .unwrap_or_else(|| ::prisma_client_rust::PrismaValue::Null), - )]) - } - Self::InVec(value) => { - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "in".to_string(), - ::prisma_client_rust::PrismaValue::List( - value - .into_iter() - .map(|value| { - ::prisma_client_rust::PrismaValue::Int(value as i64) - }) - .collect(), - ), - )]) - } - Self::NotInVec(value) => { - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "notIn".to_string(), - ::prisma_client_rust::PrismaValue::List( - value - .into_iter() - .map(|value| { - ::prisma_client_rust::PrismaValue::Int(value as i64) - }) - .collect(), - ), - )]) - } - Self::Lt(value) => ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "lt".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - Self::Lte(value) => ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "lte".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - Self::Gt(value) => ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "gt".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - Self::Gte(value) => ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "gte".to_string(), - ::prisma_client_rust::PrismaValue::Int(value as i64), - )]), - Self::Not(value) => ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "not".to_string(), - value - .map(|value| ::prisma_client_rust::PrismaValue::Int(value as i64)) - .unwrap_or_else(|| ::prisma_client_rust::PrismaValue::Null), - )]), - } - } - } - #[derive(Clone)] - pub enum StringFilter { - Equals(String), - InVec(Vec), - NotInVec(Vec), - Lt(String), - Lte(String), - Gt(String), - Gte(String), - Contains(String), - StartsWith(String), - EndsWith(String), - Mode(super::super::QueryMode), - Not(String), - } - impl Into<::prisma_client_rust::SerializedWhereValue> for StringFilter { - fn into(self) -> ::prisma_client_rust::SerializedWhereValue { - match self { - Self::Equals(value) => { - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "equals".to_string(), - ::prisma_client_rust::PrismaValue::String(value), - )]) - } - Self::InVec(value) => { - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "in".to_string(), - ::prisma_client_rust::PrismaValue::List( - value - .into_iter() - .map(|value| ::prisma_client_rust::PrismaValue::String(value)) - .collect(), - ), - )]) - } - Self::NotInVec(value) => { - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "notIn".to_string(), - ::prisma_client_rust::PrismaValue::List( - value - .into_iter() - .map(|value| ::prisma_client_rust::PrismaValue::String(value)) - .collect(), - ), - )]) - } - Self::Lt(value) => ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "lt".to_string(), - ::prisma_client_rust::PrismaValue::String(value), - )]), - Self::Lte(value) => ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "lte".to_string(), - ::prisma_client_rust::PrismaValue::String(value), - )]), - Self::Gt(value) => ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "gt".to_string(), - ::prisma_client_rust::PrismaValue::String(value), - )]), - Self::Gte(value) => ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "gte".to_string(), - ::prisma_client_rust::PrismaValue::String(value), - )]), - Self::Contains(value) => { - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "contains".to_string(), - ::prisma_client_rust::PrismaValue::String(value), - )]) - } - Self::StartsWith(value) => { - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "startsWith".to_string(), - ::prisma_client_rust::PrismaValue::String(value), - )]) - } - Self::EndsWith(value) => { - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "endsWith".to_string(), - ::prisma_client_rust::PrismaValue::String(value), - )]) - } - Self::Mode(value) => { - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "mode".to_string(), - ::prisma_client_rust::PrismaValue::Enum(value.to_string()), - )]) - } - Self::Not(value) => ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "not".to_string(), - ::prisma_client_rust::PrismaValue::String(value), - )]), - } - } - } - #[derive(Clone)] - pub enum StringNullableFilter { - Equals(Option), - InVec(Vec), - NotInVec(Vec), - Lt(String), - Lte(String), - Gt(String), - Gte(String), - Contains(String), - StartsWith(String), - EndsWith(String), - Mode(super::super::QueryMode), - Not(Option), - } - impl Into<::prisma_client_rust::SerializedWhereValue> for StringNullableFilter { - fn into(self) -> ::prisma_client_rust::SerializedWhereValue { - match self { - Self::Equals(value) => { - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "equals".to_string(), - value - .map(|value| ::prisma_client_rust::PrismaValue::String(value)) - .unwrap_or_else(|| ::prisma_client_rust::PrismaValue::Null), - )]) - } - Self::InVec(value) => { - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "in".to_string(), - ::prisma_client_rust::PrismaValue::List( - value - .into_iter() - .map(|value| ::prisma_client_rust::PrismaValue::String(value)) - .collect(), - ), - )]) - } - Self::NotInVec(value) => { - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "notIn".to_string(), - ::prisma_client_rust::PrismaValue::List( - value - .into_iter() - .map(|value| ::prisma_client_rust::PrismaValue::String(value)) - .collect(), - ), - )]) - } - Self::Lt(value) => ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "lt".to_string(), - ::prisma_client_rust::PrismaValue::String(value), - )]), - Self::Lte(value) => ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "lte".to_string(), - ::prisma_client_rust::PrismaValue::String(value), - )]), - Self::Gt(value) => ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "gt".to_string(), - ::prisma_client_rust::PrismaValue::String(value), - )]), - Self::Gte(value) => ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "gte".to_string(), - ::prisma_client_rust::PrismaValue::String(value), - )]), - Self::Contains(value) => { - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "contains".to_string(), - ::prisma_client_rust::PrismaValue::String(value), - )]) - } - Self::StartsWith(value) => { - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "startsWith".to_string(), - ::prisma_client_rust::PrismaValue::String(value), - )]) - } - Self::EndsWith(value) => { - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "endsWith".to_string(), - ::prisma_client_rust::PrismaValue::String(value), - )]) - } - Self::Mode(value) => { - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "mode".to_string(), - ::prisma_client_rust::PrismaValue::Enum(value.to_string()), - )]) - } - Self::Not(value) => ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "not".to_string(), - value - .map(|value| ::prisma_client_rust::PrismaValue::String(value)) - .unwrap_or_else(|| ::prisma_client_rust::PrismaValue::Null), - )]), - } - } - } - #[derive(Clone)] - pub enum DateTimeFilter { - Equals( - ::prisma_client_rust::chrono::DateTime<::prisma_client_rust::chrono::FixedOffset>, - ), - InVec( - Vec< - ::prisma_client_rust::chrono::DateTime< - ::prisma_client_rust::chrono::FixedOffset, - >, - >, - ), - NotInVec( - Vec< - ::prisma_client_rust::chrono::DateTime< - ::prisma_client_rust::chrono::FixedOffset, - >, - >, - ), - Lt(::prisma_client_rust::chrono::DateTime<::prisma_client_rust::chrono::FixedOffset>), - Lte(::prisma_client_rust::chrono::DateTime<::prisma_client_rust::chrono::FixedOffset>), - Gt(::prisma_client_rust::chrono::DateTime<::prisma_client_rust::chrono::FixedOffset>), - Gte(::prisma_client_rust::chrono::DateTime<::prisma_client_rust::chrono::FixedOffset>), - Not(::prisma_client_rust::chrono::DateTime<::prisma_client_rust::chrono::FixedOffset>), - } - impl Into<::prisma_client_rust::SerializedWhereValue> for DateTimeFilter { - fn into(self) -> ::prisma_client_rust::SerializedWhereValue { - match self { - Self::Equals(value) => { - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "equals".to_string(), - ::prisma_client_rust::PrismaValue::DateTime(value), - )]) - } - Self::InVec(value) => { - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "in".to_string(), - ::prisma_client_rust::PrismaValue::List( - value - .into_iter() - .map(|value| ::prisma_client_rust::PrismaValue::DateTime(value)) - .collect(), - ), - )]) - } - Self::NotInVec(value) => { - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "notIn".to_string(), - ::prisma_client_rust::PrismaValue::List( - value - .into_iter() - .map(|value| ::prisma_client_rust::PrismaValue::DateTime(value)) - .collect(), - ), - )]) - } - Self::Lt(value) => ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "lt".to_string(), - ::prisma_client_rust::PrismaValue::DateTime(value), - )]), - Self::Lte(value) => ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "lte".to_string(), - ::prisma_client_rust::PrismaValue::DateTime(value), - )]), - Self::Gt(value) => ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "gt".to_string(), - ::prisma_client_rust::PrismaValue::DateTime(value), - )]), - Self::Gte(value) => ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "gte".to_string(), - ::prisma_client_rust::PrismaValue::DateTime(value), - )]), - Self::Not(value) => ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "not".to_string(), - ::prisma_client_rust::PrismaValue::DateTime(value), - )]), - } - } - } - #[derive(Clone)] - pub enum BoolFilter { - Equals(bool), - Not(bool), - } - impl Into<::prisma_client_rust::SerializedWhereValue> for BoolFilter { - fn into(self) -> ::prisma_client_rust::SerializedWhereValue { - match self { - Self::Equals(value) => { - ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "equals".to_string(), - ::prisma_client_rust::PrismaValue::Boolean(value), - )]) - } - Self::Not(value) => ::prisma_client_rust::SerializedWhereValue::Object(vec![( - "not".to_string(), - ::prisma_client_rust::PrismaValue::Boolean(value), - )]), - } - } - } - } -} -pub use _prisma::*; diff --git a/src/serializers/author.rs b/src/serializers/author.rs index fdbde12..040323c 100644 --- a/src/serializers/author.rs +++ b/src/serializers/author.rs @@ -1,13 +1,10 @@ +use chrono::NaiveDate; use serde::Serialize; -use crate::prisma::{author, book}; +use super::date::naive_date_serializer; +use super::sequence::Sequence; -use super::{ - sequence::Sequence, - utils::{get_available_types, get_sequences, get_translators}, -}; - -#[derive(Serialize)] +#[derive(sqlx::FromRow, sqlx::Type, Serialize)] pub struct Author { pub id: i32, pub first_name: String, @@ -16,28 +13,7 @@ pub struct Author { pub annotation_exists: bool, } -impl From for Author { - fn from(val: author::Data) -> Self { - let author::Data { - id, - first_name, - last_name, - middle_name, - author_annotation, - .. - } = val; - - Author { - id, - first_name, - last_name, - middle_name: middle_name.unwrap_or("".to_string()), - annotation_exists: author_annotation.unwrap().is_some(), - } - } -} - -#[derive(Serialize)] +#[derive(sqlx::FromRow, Serialize)] pub struct AuthorBook { pub id: i32, pub title: String, @@ -45,39 +21,9 @@ pub struct AuthorBook { pub file_type: String, pub year: i32, pub available_types: Vec, - pub uploaded: String, + #[serde(serialize_with = "naive_date_serializer::serialize")] + pub uploaded: NaiveDate, pub translators: Vec, pub sequences: Vec, pub annotation_exists: bool, } - -impl From for AuthorBook { - fn from(val: book::Data) -> Self { - let book::Data { - id, - title, - lang, - file_type, - year, - uploaded, - translations, - book_sequences, - book_annotation, - source, - .. - } = val; - - AuthorBook { - id, - title, - lang, - file_type: file_type.clone(), - year, - available_types: get_available_types(file_type, source.unwrap().name), - uploaded: uploaded.format("%Y-%m-%d").to_string(), - translators: get_translators(translations), - sequences: get_sequences(book_sequences), - annotation_exists: book_annotation.unwrap().is_some(), - } - } -} diff --git a/src/serializers/author_annotation.rs b/src/serializers/author_annotation.rs index c5cc6ac..1ff5322 100644 --- a/src/serializers/author_annotation.rs +++ b/src/serializers/author_annotation.rs @@ -1,30 +1,9 @@ use serde::Serialize; -use crate::prisma::author_annotation; - -#[derive(Serialize)] +#[derive(sqlx::FromRow, Serialize)] pub struct AuthorAnnotation { pub id: i32, pub title: String, pub text: String, pub file: Option, } - -impl From for AuthorAnnotation { - fn from(val: author_annotation::Data) -> Self { - let author_annotation::Data { - id, - title, - text, - file, - .. - } = val; - - AuthorAnnotation { - id, - title, - text, - file, - } - } -} diff --git a/src/serializers/book.rs b/src/serializers/book.rs index 7404c0d..a342505 100644 --- a/src/serializers/book.rs +++ b/src/serializers/book.rs @@ -1,15 +1,9 @@ -use chrono::{NaiveDate, NaiveDateTime, NaiveTime}; +use chrono::NaiveDate; use serde::{Deserialize, Serialize}; -use crate::prisma::book::{self}; +use super::date::naive_date_serializer; -use super::{ - author::Author, - genre::Genre, - sequence::Sequence, - source::Source, - utils::{get_authors, get_available_types, get_genres, get_sequences, get_translators}, -}; +use super::{author::Author, genre::Genre, sequence::Sequence, source::Source}; fn default_langs() -> Vec { vec!["ru".to_string(), "be".to_string(), "uk".to_string()] @@ -26,49 +20,6 @@ pub struct BookFilter { pub id_lte: Option, } -impl BookFilter { - pub fn get_filter_vec(self) -> Vec { - let mut result = vec![]; - - result.push(book::lang::in_vec(self.allowed_langs)); - - match self.is_deleted { - Some(v) => { - result.push(book::is_deleted::equals(v)); - } - None => { - result.push(book::is_deleted::equals(false)); - } - }; - - if let Some(uploaded_gte) = self.uploaded_gte { - result.push(book::uploaded::gte( - NaiveDateTime::new(uploaded_gte, NaiveTime::default()) - .and_utc() - .into(), - )); - }; - - if let Some(uploaded_lte) = self.uploaded_lte { - result.push(book::uploaded::lte( - NaiveDateTime::new(uploaded_lte, NaiveTime::default()) - .and_utc() - .into(), - )); - }; - - if let Some(id_gte) = self.id_gte { - result.push(book::id::gte(id_gte)); - }; - - if let Some(id_lte) = self.id_lte { - result.push(book::id::lte(id_lte)); - }; - - result - } -} - #[derive(Serialize)] pub struct RemoteBook { pub id: i32, @@ -77,7 +28,8 @@ pub struct RemoteBook { pub file_type: String, pub year: i32, pub available_types: Vec, - pub uploaded: String, + #[serde(serialize_with = "naive_date_serializer::serialize")] + pub uploaded: NaiveDate, pub authors: Vec, pub translators: Vec, pub sequences: Vec, @@ -86,64 +38,12 @@ pub struct RemoteBook { pub remote_id: i32, } -impl From for RemoteBook { - fn from(value: book::Data) -> Self { - let book::Data { - id, - title, - lang, - file_type, - year, - uploaded, - book_authors, - translations, - book_sequences, - book_annotation, - source, - remote_id, - .. - } = value; - - Self { - id, - title, - lang, - file_type: file_type.clone(), - year, - available_types: get_available_types(file_type, source.clone().unwrap().name), - uploaded: uploaded.format("%Y-%m-%d").to_string(), - authors: get_authors(book_authors), - translators: get_translators(translations), - sequences: get_sequences(book_sequences), - annotation_exists: book_annotation.unwrap().is_some(), - source: source.unwrap().as_ref().clone().into(), - remote_id, - } - } -} - #[derive(Serialize)] pub struct BaseBook { pub id: i32, pub available_types: Vec, } -impl From for BaseBook { - fn from(value: book::Data) -> Self { - let book::Data { - id, - file_type, - source, - .. - } = value; - - Self { - id, - available_types: get_available_types(file_type, source.clone().unwrap().name), - } - } -} - #[derive(Serialize)] pub struct DetailBook { pub id: i32, @@ -152,7 +52,8 @@ pub struct DetailBook { pub file_type: String, pub year: i32, pub available_types: Vec, - pub uploaded: String, + #[serde(serialize_with = "naive_date_serializer::serialize")] + pub uploaded: NaiveDate, pub authors: Vec, pub translators: Vec, pub sequences: Vec, @@ -164,48 +65,6 @@ pub struct DetailBook { pub pages: Option, } -impl From for DetailBook { - fn from(value: book::Data) -> Self { - let book::Data { - id, - title, - lang, - file_type, - year, - uploaded, - book_authors, - translations, - book_sequences, - book_annotation, - source, - remote_id, - book_genres, - is_deleted, - pages, - .. - } = value; - - Self { - id, - title, - lang, - file_type: file_type.clone(), - year, - available_types: get_available_types(file_type, source.clone().unwrap().name), - uploaded: uploaded.format("%Y-%m-%d").to_string(), - authors: get_authors(book_authors), - translators: get_translators(translations), - sequences: get_sequences(book_sequences), - annotation_exists: book_annotation.unwrap().is_some(), - source: source.unwrap().as_ref().clone().into(), - remote_id, - genres: get_genres(book_genres), - is_deleted, - pages, - } - } -} - #[derive(Deserialize)] pub struct RandomBookFilter { pub allowed_langs: Vec, @@ -220,42 +79,10 @@ pub struct Book { pub file_type: String, pub year: i32, pub available_types: Vec, - pub uploaded: String, + #[serde(serialize_with = "naive_date_serializer::serialize")] + pub uploaded: NaiveDate, pub authors: Vec, pub translators: Vec, pub sequences: Vec, pub annotation_exists: bool, } - -impl From for Book { - fn from(value: book::Data) -> Self { - let book::Data { - id, - title, - lang, - file_type, - year, - uploaded, - book_authors, - translations, - book_sequences, - book_annotation, - source, - .. - } = value; - - Self { - id, - title, - lang, - file_type: file_type.clone(), - year, - available_types: get_available_types(file_type, source.clone().unwrap().name), - uploaded: uploaded.format("%Y-%m-%d").to_string(), - authors: get_authors(book_authors), - translators: get_translators(translations), - sequences: get_sequences(book_sequences), - annotation_exists: book_annotation.unwrap().is_some(), - } - } -} diff --git a/src/serializers/book_annotation.rs b/src/serializers/book_annotation.rs index cce478a..75591c5 100644 --- a/src/serializers/book_annotation.rs +++ b/src/serializers/book_annotation.rs @@ -1,30 +1,9 @@ use serde::Serialize; -use crate::prisma::book_annotation; - -#[derive(Serialize)] +#[derive(sqlx::FromRow, Serialize)] pub struct BookAnnotation { pub id: i32, pub title: String, pub text: String, pub file: Option, } - -impl From for BookAnnotation { - fn from(value: book_annotation::Data) -> Self { - let book_annotation::Data { - id, - title, - text, - file, - .. - } = value; - - Self { - id, - title, - text, - file, - } - } -} diff --git a/src/serializers/date.rs b/src/serializers/date.rs new file mode 100644 index 0000000..498162d --- /dev/null +++ b/src/serializers/date.rs @@ -0,0 +1,16 @@ +use chrono::NaiveDate; +use serde::Serializer; + +const FORMAT: &str = "%Y-%m-%d"; + +pub mod naive_date_serializer { + use super::*; + + pub fn serialize(date: &NaiveDate, serializer: S) -> Result + where + S: Serializer, + { + let formatted_date = date.format(FORMAT).to_string(); + serializer.serialize_str(&formatted_date) + } +} diff --git a/src/serializers/genre.rs b/src/serializers/genre.rs index 58ee6a6..f33344a 100644 --- a/src/serializers/genre.rs +++ b/src/serializers/genre.rs @@ -1,10 +1,8 @@ use serde::{Deserialize, Serialize}; -use crate::prisma::genre; - use super::source::Source; -#[derive(Serialize)] +#[derive(sqlx::FromRow, sqlx::Type, Serialize)] pub struct Genre { pub id: i32, pub source: Source, @@ -14,29 +12,6 @@ pub struct Genre { pub meta: String, } -impl From for Genre { - fn from(val: genre::Data) -> Self { - let genre::Data { - id, - remote_id, - code, - description, - meta, - source, - .. - } = val; - - Genre { - id, - remote_id, - code, - description, - meta, - source: source.unwrap().as_ref().clone().into(), - } - } -} - #[derive(Deserialize)] pub struct GenreFilter { pub meta: Option, diff --git a/src/serializers/mod.rs b/src/serializers/mod.rs index 3b0af14..6aedd1a 100644 --- a/src/serializers/mod.rs +++ b/src/serializers/mod.rs @@ -3,6 +3,7 @@ pub mod author; pub mod author_annotation; pub mod book; pub mod book_annotation; +pub mod date; pub mod genre; pub mod pagination; pub mod sequence; diff --git a/src/serializers/sequence.rs b/src/serializers/sequence.rs index bf2f386..3d59b19 100644 --- a/src/serializers/sequence.rs +++ b/src/serializers/sequence.rs @@ -1,27 +1,16 @@ +use chrono::NaiveDate; use serde::Serialize; -use crate::prisma::{book, sequence}; +use super::author::Author; +use super::date::naive_date_serializer; -use super::{ - author::Author, - utils::{get_authors, get_available_types, get_translators}, -}; - -#[derive(Serialize)] +#[derive(sqlx::FromRow, sqlx::Type, Serialize)] pub struct Sequence { pub id: i32, pub name: String, } -impl From for Sequence { - fn from(val: sequence::Data) -> Self { - let sequence::Data { id, name, .. } = val; - - Sequence { id, name } - } -} - -#[derive(Serialize)] +#[derive(sqlx::FromRow, Serialize)] pub struct SequenceBook { pub id: i32, pub title: String, @@ -29,42 +18,10 @@ pub struct SequenceBook { pub file_type: String, pub year: i32, pub available_types: Vec, - pub uploaded: String, + #[serde(serialize_with = "naive_date_serializer::serialize")] + pub uploaded: NaiveDate, pub authors: Vec, pub translators: Vec, pub annotation_exists: bool, pub position: i32, } - -impl From for SequenceBook { - fn from(value: book::Data) -> Self { - let book::Data { - id, - title, - lang, - file_type, - year, - uploaded, - book_authors, - translations, - book_annotation, - source, - book_sequences, - .. - } = value; - - Self { - id, - title, - lang, - file_type: file_type.clone(), - year, - available_types: get_available_types(file_type, source.clone().unwrap().name), - uploaded: uploaded.format("%Y-%m-%d").to_string(), - authors: get_authors(book_authors), - translators: get_translators(translations), - annotation_exists: book_annotation.unwrap().is_some(), - position: book_sequences.unwrap().first().unwrap().position, - } - } -} diff --git a/src/serializers/source.rs b/src/serializers/source.rs index 9463f20..d30253d 100644 --- a/src/serializers/source.rs +++ b/src/serializers/source.rs @@ -1,17 +1,7 @@ use serde::Serialize; -use crate::prisma::source; - -#[derive(Serialize)] +#[derive(sqlx::FromRow, sqlx::Type, Serialize)] pub struct Source { pub id: i32, pub name: String, } - -impl From for Source { - fn from(val: source::Data) -> Self { - let source::Data { id, name, .. } = val; - - Source { id, name } - } -} diff --git a/src/serializers/translator.rs b/src/serializers/translator.rs index 87a79cd..080ff43 100644 --- a/src/serializers/translator.rs +++ b/src/serializers/translator.rs @@ -1,14 +1,11 @@ +use chrono::NaiveDate; use serde::Serialize; -use crate::prisma::book; +use super::date::naive_date_serializer; -use super::{ - author::Author, - sequence::Sequence, - utils::{get_authors, get_available_types, get_sequences}, -}; +use super::{author::Author, sequence::Sequence}; -#[derive(Serialize)] +#[derive(sqlx::FromRow, Serialize)] pub struct TranslatorBook { pub id: i32, pub title: String, @@ -16,39 +13,9 @@ pub struct TranslatorBook { pub file_type: String, pub year: i32, pub available_types: Vec, - pub uploaded: String, + #[serde(serialize_with = "naive_date_serializer::serialize")] + pub uploaded: NaiveDate, pub authors: Vec, pub sequences: Vec, pub annotation_exists: bool, } - -impl From for TranslatorBook { - fn from(val: book::Data) -> Self { - let book::Data { - id, - title, - lang, - file_type, - year, - uploaded, - book_authors, - book_sequences, - book_annotation, - source, - .. - } = val; - - TranslatorBook { - id, - title, - lang, - file_type: file_type.clone(), - year, - available_types: get_available_types(file_type.clone(), source.unwrap().name), - uploaded: uploaded.format("%Y-%m-%d").to_string(), - authors: get_authors(book_authors), - sequences: get_sequences(book_sequences), - annotation_exists: book_annotation.unwrap().is_some(), - } - } -} diff --git a/src/serializers/utils.rs b/src/serializers/utils.rs index 6dd523d..f4a9466 100644 --- a/src/serializers/utils.rs +++ b/src/serializers/utils.rs @@ -1,7 +1,3 @@ -use crate::prisma::{book_author, book_genre, book_sequence, translator}; - -use super::{author::Author, genre::Genre, sequence::Sequence}; - pub fn get_available_types(file_type: String, source_name: String) -> Vec { if file_type == "fb2" && source_name == "flibusta" { vec![ @@ -14,35 +10,3 @@ pub fn get_available_types(file_type: String, source_name: String) -> Vec>) -> Vec { - book_authors - .unwrap() - .iter() - .map(|item| item.author.clone().unwrap().as_ref().clone().into()) - .collect() -} - -pub fn get_translators(translations: Option>) -> Vec { - translations - .unwrap() - .iter() - .map(|item| item.author.clone().unwrap().as_ref().clone().into()) - .collect() -} - -pub fn get_sequences(book_sequences: Option>) -> Vec { - book_sequences - .unwrap() - .iter() - .map(|item| item.sequence.clone().unwrap().as_ref().clone().into()) - .collect() -} - -pub fn get_genres(book_genres: Option>) -> Vec { - book_genres - .unwrap() - .iter() - .map(|item| item.genre.clone().unwrap().as_ref().clone().into()) - .collect() -} diff --git a/src/views/authors.rs b/src/views/authors.rs index 8282bf0..338bfae 100644 --- a/src/views/authors.rs +++ b/src/views/authors.rs @@ -10,40 +10,51 @@ use axum::{ use crate::{ meilisearch::{get_meili_client, AuthorMeili}, - prisma::{ - author, - author_annotation::{self}, - book, book_author, book_sequence, translator, - }, serializers::{ allowed_langs::AllowedLangs, author::{Author, AuthorBook}, author_annotation::AuthorAnnotation, + book::BaseBook, pagination::{Page, PageWithParent, Pagination}, + sequence::Sequence, }, }; use super::{common::get_random_item::get_random_item, Database}; async fn get_authors(db: Database, pagination: Query) -> impl IntoResponse { - let authors_count = db.author().count(vec![]).exec().await.unwrap(); - - let authors = db - .author() - .find_many(vec![]) - .with(author::author_annotation::fetch()) - .order_by(author::id::order(prisma_client_rust::Direction::Asc)) - .skip((pagination.page - 1) * pagination.size) - .take(pagination.size) - .exec() + let authors_count = sqlx::query_scalar!("SELECT COUNT(*) FROM authors",) + .fetch_one(&db.0) .await + .unwrap() .unwrap(); - let page: Page = Page::new( - authors.iter().map(|item| item.clone().into()).collect(), - authors_count, - &pagination, - ); + let authors = sqlx::query_as!( + Author, + r#" + SELECT + a.id, + a.first_name, + a.last_name, + COALESCE(a.middle_name, '') AS "middle_name!: String", + CASE + WHEN aa.id IS NOT NULL THEN true + ELSE false + END AS "annotation_exists!: bool" + FROM authors a + LEFT JOIN author_annotations aa ON a.id = aa.author + ORDER BY a.id ASC + OFFSET $1 + LIMIT $2 + "#, + (pagination.page - 1) * pagination.size, + pagination.size + ) + .fetch_all(&db.0) + .await + .unwrap(); + + let page: Page = Page::new(authors, authors_count, &pagination); Json(page) } @@ -64,43 +75,80 @@ async fn get_random_author( get_random_item::(authors_index, filter).await }; - let author = db - .author() - .find_unique(author::id::equals(author_id)) - .with(author::author_annotation::fetch()) - .exec() - .await - .unwrap() - .unwrap(); + let author = sqlx::query_as!( + Author, + r#" + SELECT + a.id, + a.first_name, + a.last_name, + COALESCE(a.middle_name, '') AS "middle_name!: String", + CASE + WHEN aa.id IS NOT NULL THEN true + ELSE false + END AS "annotation_exists!: bool" + FROM authors a + LEFT JOIN author_annotations aa ON a.id = aa.author + WHERE a.id = $1 + "#, + author_id + ) + .fetch_one(&db.0) + .await + .unwrap(); - Json::(author.into()) + Json::(author) } async fn get_author(db: Database, Path(author_id): Path) -> impl IntoResponse { - let author = db - .author() - .find_unique(author::id::equals(author_id)) - .with(author::author_annotation::fetch()) - .exec() - .await - .unwrap(); + let author = sqlx::query_as!( + Author, + r#" + SELECT + a.id, + a.first_name, + a.last_name, + COALESCE(a.middle_name, '') AS "middle_name!: String", + CASE + WHEN aa.id IS NOT NULL THEN true + ELSE false + END AS "annotation_exists!: bool" + FROM authors a + LEFT JOIN author_annotations aa ON a.id = aa.author + WHERE a.id = $1 + "#, + author_id + ) + .fetch_optional(&db.0) + .await + .unwrap(); match author { - Some(author) => Json::(author.into()).into_response(), + Some(author) => Json::(author).into_response(), None => StatusCode::NOT_FOUND.into_response(), } } async fn get_author_annotation(db: Database, Path(author_id): Path) -> impl IntoResponse { - let author_annotation = db - .author_annotation() - .find_unique(author_annotation::author_id::equals(author_id)) - .exec() - .await - .unwrap(); + let author_annotation = sqlx::query_as!( + AuthorAnnotation, + r#" + SELECT + aa.id, + aa.title, + aa.text, + aa.file + FROM author_annotations aa + WHERE aa.author = $1 + "#, + author_id + ) + .fetch_optional(&db.0) + .await + .unwrap(); match author_annotation { - Some(annotation) => Json::(annotation.into()).into_response(), + Some(annotation) => Json::(annotation).into_response(), None => StatusCode::NOT_FOUND.into_response(), } } @@ -113,50 +161,109 @@ async fn get_author_books( >, pagination: Query, ) -> impl IntoResponse { - let author = db - .author() - .find_unique(author::id::equals(author_id)) - .with(author::author_annotation::fetch()) - .exec() - .await - .unwrap(); + let author = sqlx::query_as!( + Author, + r#" + SELECT + a.id, + a.first_name, + a.last_name, + COALESCE(a.middle_name, '') AS "middle_name!: String", + CASE + WHEN aa.id IS NOT NULL THEN true + ELSE false + END AS "annotation_exists!: bool" + FROM authors a + LEFT JOIN author_annotations aa ON a.id = aa.author + WHERE a.id = $1 + "#, + author_id + ) + .fetch_optional(&db.0) + .await + .unwrap(); let author = match author { Some(author) => author, None => return StatusCode::NOT_FOUND.into_response(), }; - let books_filter = vec![ - book::is_deleted::equals(false), - book::book_authors::some(vec![book_author::author_id::equals(author_id)]), - book::lang::in_vec(allowed_langs.clone()), - ]; + let books_count = sqlx::query_scalar!( + r#" + SELECT COUNT(*) + FROM books b + JOIN book_authors ba ON b.id = ba.book + WHERE b.is_deleted = false AND ba.author = $1 AND b.lang = ANY($2) + "#, + author_id, + &allowed_langs + ) + .fetch_one(&db.0) + .await + .unwrap() + .unwrap(); - let books_count = db.book().count(books_filter.clone()).exec().await.unwrap(); - - let books = db - .book() - .find_many(books_filter) - .with(book::source::fetch()) - .with(book::book_annotation::fetch()) - .with( - book::translations::fetch(vec![]) - .with(translator::author::fetch().with(author::author_annotation::fetch())), - ) - .with(book::book_sequences::fetch(vec![]).with(book_sequence::sequence::fetch())) - .order_by(book::title::order(prisma_client_rust::Direction::Asc)) - .skip((pagination.page - 1) * pagination.size) - .take(pagination.size) - .exec() + let books = sqlx::query_as!( + AuthorBook, + r#" + SELECT + b.id, + b.title, + b.lang, + b.file_type, + b.year, + CASE WHEN b.file_type = 'fb2' THEN ARRAY['fb2', 'epub', 'mobi', 'fb2zip'] ELSE ARRAY[b.file_type] END AS "available_types!: Vec", + b.uploaded, + ( + SELECT + JSON_AGG( + JSON_BUILD_OBJECT( + 'id', authors.id, + 'first_name', authors.first_name, + 'last_name', authors.last_name, + 'middle_name', authors.middle_name, + 'annotation_exists', EXISTS( + SELECT * FROM author_annotations WHERE author = authors.id + ) + ) + ) + FROM translations + JOIN authors ON authors.id = translations.author + WHERE translations.book = b.id + ) AS "translators!: Vec", + ( + SELECT + JSON_AGG( + JSON_BUILD_OBJECT( + 'id', sequences.id, + 'name', sequences.name + ) + ) + FROM book_sequences + JOIN sequences ON sequences.id = book_sequences.sequence + WHERE book_sequences.book = b.id + ) AS "sequences!: Vec", + EXISTS( + SELECT * FROM book_annotations WHERE book = b.id + ) AS "annotation_exists!: bool" + FROM books b + JOIN book_authors ba ON b.id = ba.book + WHERE b.is_deleted = false AND ba.author = $1 AND b.lang = ANY($2) + ORDER BY b.title ASC + OFFSET $3 + LIMIT $4 + "#, + author_id, + &allowed_langs, + (pagination.page - 1) * pagination.size, + pagination.size + ) + .fetch_all(&db.0) .await .unwrap(); - let page: PageWithParent = PageWithParent::new( - author.into(), - books.iter().map(|item| item.clone().into()).collect(), - books_count, - &pagination, - ); + let page: PageWithParent = + PageWithParent::new(author, books, books_count, &pagination); Json(page).into_response() } @@ -168,27 +275,31 @@ async fn get_author_books_available_types( AllowedLangs, >, ) -> impl IntoResponse { - let books = db - .book() - .find_many(vec![ - book::is_deleted::equals(false), - book::book_authors::some(vec![book_author::author_id::equals(author_id)]), - book::lang::in_vec(allowed_langs), - ]) - .exec() + // TODO: refactor + + let books = sqlx::query_as!( + BaseBook, + r#" + SELECT + b.id, + CASE WHEN b.file_type = 'fb2' THEN ARRAY['fb2', 'epub', 'mobi', 'fb2zip'] ELSE ARRAY[b.file_type] END AS "available_types!: Vec" + FROM books b + JOIN book_authors ba ON b.id = ba.book + WHERE b.is_deleted = false AND ba.author = $1 AND b.lang = ANY($2) + "#, + author_id, + &allowed_langs + ) + .fetch_all(&db.0) .await .unwrap(); let mut file_types: HashSet = HashSet::new(); for book in books { - file_types.insert(book.file_type.clone()); - } - - if file_types.contains("fb2") { - file_types.insert("epub".to_string()); - file_types.insert("mobi".to_string()); - file_types.insert("fb2zip".to_string()); + for file_type in book.available_types { + file_types.insert(file_type); + } } Json::>(file_types.into_iter().collect()) @@ -225,14 +336,27 @@ async fn search_authors( let total = result.estimated_total_hits.unwrap(); let author_ids: Vec = result.hits.iter().map(|a| a.result.id).collect(); - let mut authors = db - .author() - .find_many(vec![author::id::in_vec(author_ids.clone())]) - .with(author::author_annotation::fetch()) - .order_by(author::id::order(prisma_client_rust::Direction::Asc)) - .exec() - .await - .unwrap(); + let mut authors = sqlx::query_as!( + Author, + r#" + SELECT + a.id, + a.first_name, + a.last_name, + COALESCE(a.middle_name, '') AS "middle_name!: String", + CASE + WHEN aa.id IS NOT NULL THEN true + ELSE false + END AS "annotation_exists!: bool" + FROM authors a + LEFT JOIN author_annotations aa ON a.id = aa.author + WHERE a.id = ANY($1) + "#, + &author_ids + ) + .fetch_all(&db.0) + .await + .unwrap(); authors.sort_by(|a, b| { let a_pos = author_ids.iter().position(|i| *i == a.id).unwrap(); @@ -241,11 +365,7 @@ async fn search_authors( a_pos.cmp(&b_pos) }); - let page: Page = Page::new( - authors.iter().map(|item| item.clone().into()).collect(), - total.try_into().unwrap(), - &pagination, - ); + let page: Page = Page::new(authors, total.try_into().unwrap(), &pagination); Json(page) } diff --git a/src/views/books.rs b/src/views/books.rs index 3f38f4a..9a68780 100644 --- a/src/views/books.rs +++ b/src/views/books.rs @@ -5,20 +5,18 @@ use axum::{ routing::get, Json, Router, }; -use prisma_client_rust::Direction; use crate::{ meilisearch::{get_meili_client, BookMeili}, - prisma::{ - author, - book::{self}, - book_annotation, book_author, book_genre, book_sequence, genre, translator, - }, serializers::{ allowed_langs::AllowedLangs, + author::Author, book::{BaseBook, Book, BookFilter, DetailBook, RandomBookFilter, RemoteBook}, book_annotation::BookAnnotation, + genre::Genre, pagination::{Page, Pagination}, + sequence::Sequence, + source::Source, }, }; @@ -29,36 +27,123 @@ pub async fn get_books( axum_extra::extract::Query(book_filter): axum_extra::extract::Query, pagination: Query, ) -> impl IntoResponse { - let filter = book_filter.get_filter_vec(); + let books_count = sqlx::query_scalar!( + r#" + SELECT COUNT(*) FROM books + WHERE lang = ANY($1) AND + ($2::boolean IS NULL OR is_deleted = $2) AND + ($3::date IS NULL OR uploaded >= $3) AND + ($4::date IS NULL OR uploaded <= $4) AND + ($5::integer IS NULL OR id >= $5) AND + ($6::integer IS NULL OR id <= $6) + "#, + &book_filter.allowed_langs, + book_filter.is_deleted, + book_filter.uploaded_gte, + book_filter.uploaded_lte, + book_filter.id_gte, + book_filter.id_lte, + ) + .fetch_one(&db.0) + .await + .unwrap() + .unwrap(); - let books_count = db.book().count(filter.clone()).exec().await.unwrap(); - - let books = db - .book() - .find_many(filter) - .with(book::book_annotation::fetch()) - .with(book::source::fetch()) - .with( - book::book_authors::fetch(vec![]) - .with(book_author::author::fetch().with(author::author_annotation::fetch())), - ) - .with( - book::translations::fetch(vec![]) - .with(translator::author::fetch().with(author::author_annotation::fetch())), - ) - .with(book::book_sequences::fetch(vec![]).with(book_sequence::sequence::fetch())) - .order_by(book::id::order(Direction::Asc)) - .skip((pagination.page - 1) * pagination.size) - .take(pagination.size) - .exec() + let books = sqlx::query_as!( + RemoteBook, + r#" + SELECT + b.id, + b.title, + b.lang, + b.file_type, + b.year, + CASE WHEN b.file_type = 'fb2' THEN ARRAY['fb2', 'epub', 'mobi', 'fb2zip'] ELSE ARRAY[b.file_type] END AS "available_types!: Vec", + b.uploaded, + ( + SELECT + JSON_AGG( + JSON_BUILD_OBJECT( + 'id', authors.id, + 'first_name', authors.first_name, + 'last_name', authors.last_name, + 'middle_name', authors.middle_name, + 'annotation_exists', EXISTS( + SELECT * FROM author_annotations WHERE author = authors.id + ) + ) + ) + FROM book_authors + JOIN authors ON authors.id = book_authors.author + WHERE book_authors.book = b.id + ) AS "authors!: Vec", + ( + SELECT + JSON_AGG( + JSON_BUILD_OBJECT( + 'id', authors.id, + 'first_name', authors.first_name, + 'last_name', authors.last_name, + 'middle_name', authors.middle_name, + 'annotation_exists', EXISTS( + SELECT * FROM author_annotations WHERE author = authors.id + ) + ) + ) + FROM translations + JOIN authors ON authors.id = translations.author + WHERE translations.book = b.id + ) AS "translators!: Vec", + ( + SELECT + JSON_AGG( + JSON_BUILD_OBJECT( + 'id', sequences.id, + 'name', sequences.name + ) + ) + FROM book_sequences + JOIN sequences ON sequences.id = book_sequences.sequence + WHERE book_sequences.book = b.id + ) AS "sequences!: Vec", + EXISTS( + SELECT * FROM book_annotations WHERE book = b.id + ) AS "annotation_exists!: bool", + ( + SELECT + JSON_BUILD_OBJECT( + 'id', sources.id, + 'name', sources.name + ) + FROM sources + WHERE sources.id = b.source + ) AS "source!: Source", + b.remote_id + FROM books b + WHERE lang = ANY($1) AND + ($2::boolean IS NULL OR is_deleted = $2) AND + ($3::date IS NULL OR uploaded >= $3) AND + ($4::date IS NULL OR uploaded <= $4) AND + ($5::integer IS NULL OR id >= $5) AND + ($6::integer IS NULL OR id <= $6) + ORDER BY b.id ASC + OFFSET $7 + LIMIT $8 + "#, + &book_filter.allowed_langs, + book_filter.is_deleted, + book_filter.uploaded_gte, + book_filter.uploaded_lte, + book_filter.id_gte, + book_filter.id_lte, + (pagination.page - 1) * pagination.size, + pagination.size, + ) + .fetch_all(&db.0) .await .unwrap(); - let page: Page = Page::new( - books.iter().map(|item| item.clone().into()).collect(), - books_count, - &pagination, - ); + let page: Page = Page::new(books, books_count, &pagination); Json(page) } @@ -68,26 +153,59 @@ pub async fn get_base_books( axum_extra::extract::Query(book_filter): axum_extra::extract::Query, pagination: Query, ) -> impl IntoResponse { - let filter = book_filter.get_filter_vec(); + let books_count = sqlx::query_scalar!( + r#" + SELECT COUNT(*) FROM books + WHERE lang = ANY($1) AND + ($2::boolean IS NULL OR is_deleted = $2) AND + ($3::date IS NULL OR uploaded >= $3) AND + ($4::date IS NULL OR uploaded <= $4) AND + ($5::integer IS NULL OR id >= $5) AND + ($6::integer IS NULL OR id <= $6) + "#, + &book_filter.allowed_langs, + book_filter.is_deleted, + book_filter.uploaded_gte, + book_filter.uploaded_lte, + book_filter.id_gte, + book_filter.id_lte, + ) + .fetch_one(&db.0) + .await + .unwrap() + .unwrap(); - let books_count = db.book().count(filter.clone()).exec().await.unwrap(); - - let books = db - .book() - .find_many(filter) - .with(book::source::fetch()) - .order_by(book::id::order(Direction::Asc)) - .skip((pagination.page - 1) * pagination.size) - .take(pagination.size) - .exec() + let books = sqlx::query_as!( + BaseBook, + r#" + SELECT + b.id, + CASE WHEN b.file_type = 'fb2' THEN ARRAY['fb2', 'epub', 'mobi', 'fb2zip'] ELSE ARRAY[b.file_type] END AS "available_types!: Vec" + FROM books b + WHERE lang = ANY($1) AND + ($2::boolean IS NULL OR is_deleted = $2) AND + ($3::date IS NULL OR uploaded >= $3) AND + ($4::date IS NULL OR uploaded <= $4) AND + ($5::integer IS NULL OR id >= $5) AND + ($6::integer IS NULL OR id <= $6) + ORDER BY b.id ASC + OFFSET $7 + LIMIT $8 + "#, + &book_filter.allowed_langs, + book_filter.is_deleted, + book_filter.uploaded_gte, + book_filter.uploaded_lte, + book_filter.id_gte, + book_filter.id_lte, + (pagination.page - 1) * pagination.size, + pagination.size, + ) + .fetch_all(&db.0) .await .unwrap(); - let page: Page = Page::new( - books.iter().map(|item| item.clone().into()).collect(), - books_count, - &pagination, - ); + let page: Page = Page::new(books, books_count, &pagination); Json(page) } @@ -114,60 +232,217 @@ pub async fn get_random_book( get_random_item::(authors_index, filter).await }; - let book = db - .book() - .find_unique(book::id::equals(book_id)) - .with(book::book_annotation::fetch()) - .with(book::source::fetch()) - .with( - book::book_authors::fetch(vec![]) - .with(book_author::author::fetch().with(author::author_annotation::fetch())), - ) - .with( - book::translations::fetch(vec![]) - .with(translator::author::fetch().with(author::author_annotation::fetch())), - ) - .with(book::book_sequences::fetch(vec![]).with(book_sequence::sequence::fetch())) - .with( - book::book_genres::fetch(vec![]) - .with(book_genre::genre::fetch().with(genre::source::fetch())), - ) - .exec() + let book = sqlx::query_as!( + DetailBook, + r#" + SELECT + b.id, + b.title, + b.lang, + b.file_type, + b.year, + CASE WHEN b.file_type = 'fb2' THEN ARRAY['fb2', 'epub', 'mobi', 'fb2zip'] ELSE ARRAY[b.file_type] END AS "available_types!: Vec", + b.uploaded, + ( + SELECT + JSON_AGG( + JSON_BUILD_OBJECT( + 'id', authors.id, + 'first_name', authors.first_name, + 'last_name', authors.last_name, + 'middle_name', authors.middle_name, + 'annotation_exists', EXISTS( + SELECT * FROM author_annotations WHERE author = authors.id + ) + ) + ) + FROM book_authors + JOIN authors ON authors.id = book_authors.author + WHERE book_authors.book = b.id + ) AS "authors!: Vec", + ( + SELECT + JSON_AGG( + JSON_BUILD_OBJECT( + 'id', authors.id, + 'first_name', authors.first_name, + 'last_name', authors.last_name, + 'middle_name', authors.middle_name, + 'annotation_exists', EXISTS( + SELECT * FROM author_annotations WHERE author = authors.id + ) + ) + ) + FROM translations + JOIN authors ON authors.id = translations.author + WHERE translations.book = b.id + ) AS "translators!: Vec", + ( + SELECT + JSON_AGG( + JSON_BUILD_OBJECT( + 'id', sequences.id, + 'name', sequences.name + ) + ) + FROM book_sequences + JOIN sequences ON sequences.id = book_sequences.sequence + WHERE book_sequences.book = b.id + ) AS "sequences!: Vec", + ( + SELECT + JSON_AGG( + JSON_BUILD_OBJECT( + 'id', genres.id, + 'code', genres.code, + 'description', genres.description, + 'meta', genres.meta, + 'source', JSON_BUILD_OBJECT( + 'id', sources.id, + 'name', sources.name + ) + ) + ) + FROM book_genres + JOIN genres ON genres.id = book_genres.genre + JOIN sources ON sources.id = genres.source + WHERE book_genres.book = b.id + ) AS "genres!: Vec", + EXISTS( + SELECT * FROM book_annotations WHERE book = b.id + ) AS "annotation_exists!: bool", + ( + SELECT + JSON_BUILD_OBJECT( + 'id', sources.id, + 'name', sources.name + ) + FROM sources + WHERE sources.id = b.source + ) AS "source!: Source", + b.remote_id, + b.is_deleted, + b.pages + FROM books b + WHERE b.id = $1 + "#, + book_id + ) + .fetch_optional(&db.0) .await .unwrap() .unwrap(); - Json::(book.into()).into_response() + Json::(book).into_response() } pub async fn get_remote_book( db: Database, - Path((source_id, remote_id)): Path<(i32, i32)>, + Path((source_id, remote_id)): Path<(i16, i32)>, ) -> impl IntoResponse { - let book = db - .book() - .find_unique(book::source_id_remote_id(source_id, remote_id)) - .with(book::book_annotation::fetch()) - .with(book::source::fetch()) - .with( - book::book_authors::fetch(vec![]) - .with(book_author::author::fetch().with(author::author_annotation::fetch())), - ) - .with( - book::translations::fetch(vec![]) - .with(translator::author::fetch().with(author::author_annotation::fetch())), - ) - .with(book::book_sequences::fetch(vec![]).with(book_sequence::sequence::fetch())) - .with( - book::book_genres::fetch(vec![]) - .with(book_genre::genre::fetch().with(genre::source::fetch())), - ) - .exec() + let book = sqlx::query_as!( + DetailBook, + r#" + SELECT + b.id, + b.title, + b.lang, + b.file_type, + b.year, + CASE WHEN b.file_type = 'fb2' THEN ARRAY['fb2', 'epub', 'mobi', 'fb2zip'] ELSE ARRAY[b.file_type] END AS "available_types!: Vec", + b.uploaded, + ( + SELECT + JSON_AGG( + JSON_BUILD_OBJECT( + 'id', authors.id, + 'first_name', authors.first_name, + 'last_name', authors.last_name, + 'middle_name', authors.middle_name, + 'annotation_exists', EXISTS( + SELECT * FROM author_annotations WHERE author = authors.id + ) + ) + ) + FROM book_authors + JOIN authors ON authors.id = book_authors.author + WHERE book_authors.book = b.id + ) AS "authors!: Vec", + ( + SELECT + JSON_AGG( + JSON_BUILD_OBJECT( + 'id', authors.id, + 'first_name', authors.first_name, + 'last_name', authors.last_name, + 'middle_name', authors.middle_name, + 'annotation_exists', EXISTS( + SELECT * FROM author_annotations WHERE author = authors.id + ) + ) + ) + FROM translations + JOIN authors ON authors.id = translations.author + WHERE translations.book = b.id + ) AS "translators!: Vec", + ( + SELECT + JSON_AGG( + JSON_BUILD_OBJECT( + 'id', sequences.id, + 'name', sequences.name + ) + ) + FROM book_sequences + JOIN sequences ON sequences.id = book_sequences.sequence + WHERE book_sequences.book = b.id + ) AS "sequences!: Vec", + ( + SELECT + JSON_AGG( + JSON_BUILD_OBJECT( + 'id', genres.id, + 'code', genres.code, + 'description', genres.description, + 'meta', genres.meta, + 'source', JSON_BUILD_OBJECT( + 'id', sources.id, + 'name', sources.name + ) + ) + ) + FROM book_genres + JOIN genres ON genres.id = book_genres.genre + JOIN sources ON sources.id = genres.source + WHERE book_genres.book = b.id + ) AS "genres!: Vec", + EXISTS( + SELECT * FROM book_annotations WHERE book = b.id + ) AS "annotation_exists!: bool", + ( + SELECT + JSON_BUILD_OBJECT( + 'id', sources.id, + 'name', sources.name + ) + FROM sources + WHERE sources.id = b.source + ) AS "source!: Source", + b.remote_id, + b.is_deleted, + b.pages + FROM books b + WHERE b.source = $1 AND b.remote_id = $2 + "#, + source_id, + remote_id + ) + .fetch_optional(&db.0) .await .unwrap(); match book { - Some(book) => Json::(book.into()).into_response(), + Some(book) => Json::(book).into_response(), None => StatusCode::NOT_FOUND.into_response(), } } @@ -203,21 +478,72 @@ pub async fn search_books( let total = result.estimated_total_hits.unwrap(); let book_ids: Vec = result.hits.iter().map(|a| a.result.id).collect(); - let mut books = db - .book() - .find_many(vec![book::id::in_vec(book_ids.clone())]) - .with(book::book_annotation::fetch()) - .with(book::source::fetch()) - .with( - book::book_authors::fetch(vec![]) - .with(book_author::author::fetch().with(author::author_annotation::fetch())), - ) - .with( - book::translations::fetch(vec![]) - .with(translator::author::fetch().with(author::author_annotation::fetch())), - ) - .with(book::book_sequences::fetch(vec![]).with(book_sequence::sequence::fetch())) - .exec() + let mut books = sqlx::query_as!( + Book, + r#" + SELECT + b.id, + b.title, + b.lang, + b.file_type, + b.year, + CASE WHEN b.file_type = 'fb2' THEN ARRAY['fb2', 'epub', 'mobi', 'fb2zip'] ELSE ARRAY[b.file_type] END AS "available_types!: Vec", + b.uploaded, + ( + SELECT + JSON_AGG( + JSON_BUILD_OBJECT( + 'id', authors.id, + 'first_name', authors.first_name, + 'last_name', authors.last_name, + 'middle_name', authors.middle_name, + 'annotation_exists', EXISTS( + SELECT * FROM author_annotations WHERE author = authors.id + ) + ) + ) + FROM book_authors + JOIN authors ON authors.id = book_authors.author + WHERE book_authors.book = b.id + ) AS "authors!: Vec", + ( + SELECT + JSON_AGG( + JSON_BUILD_OBJECT( + 'id', authors.id, + 'first_name', authors.first_name, + 'last_name', authors.last_name, + 'middle_name', authors.middle_name, + 'annotation_exists', EXISTS( + SELECT * FROM author_annotations WHERE author = authors.id + ) + ) + ) + FROM translations + JOIN authors ON authors.id = translations.author + WHERE translations.book = b.id + ) AS "translators!: Vec", + ( + SELECT + JSON_AGG( + JSON_BUILD_OBJECT( + 'id', sequences.id, + 'name', sequences.name + ) + ) + FROM book_sequences + JOIN sequences ON sequences.id = book_sequences.sequence + WHERE book_sequences.book = b.id + ) AS "sequences!: Vec", + EXISTS( + SELECT * FROM book_annotations WHERE book = b.id + ) AS "annotation_exists!: bool" + FROM books b + WHERE b.id = ANY($1) + "#, + &book_ids + ) + .fetch_all(&db.0) .await .unwrap(); @@ -228,54 +554,138 @@ pub async fn search_books( a_pos.cmp(&b_pos) }); - let page: Page = Page::new( - books.iter().map(|item| item.clone().into()).collect(), - total.try_into().unwrap(), - &pagination, - ); + let page: Page = Page::new(books, total.try_into().unwrap(), &pagination); Json(page) } pub async fn get_book(db: Database, Path(book_id): Path) -> impl IntoResponse { - let book = db - .book() - .find_unique(book::id::equals(book_id)) - .with(book::book_annotation::fetch()) - .with(book::source::fetch()) - .with( - book::book_authors::fetch(vec![]) - .with(book_author::author::fetch().with(author::author_annotation::fetch())), - ) - .with( - book::translations::fetch(vec![]) - .with(translator::author::fetch().with(author::author_annotation::fetch())), - ) - .with(book::book_sequences::fetch(vec![]).with(book_sequence::sequence::fetch())) - .with( - book::book_genres::fetch(vec![]) - .with(book_genre::genre::fetch().with(genre::source::fetch())), - ) - .exec() + let book = sqlx::query_as!( + DetailBook, + r#" + SELECT + b.id, + b.title, + b.lang, + b.file_type, + b.year, + CASE WHEN b.file_type = 'fb2' THEN ARRAY['fb2', 'epub', 'mobi', 'fb2zip'] ELSE ARRAY[b.file_type] END AS "available_types!: Vec", + b.uploaded, + ( + SELECT + JSON_AGG( + JSON_BUILD_OBJECT( + 'id', authors.id, + 'first_name', authors.first_name, + 'last_name', authors.last_name, + 'middle_name', authors.middle_name, + 'annotation_exists', EXISTS( + SELECT * FROM author_annotations WHERE author = authors.id + ) + ) + ) + FROM book_authors + JOIN authors ON authors.id = book_authors.author + WHERE book_authors.book = b.id + ) AS "authors!: Vec", + ( + SELECT + JSON_AGG( + JSON_BUILD_OBJECT( + 'id', authors.id, + 'first_name', authors.first_name, + 'last_name', authors.last_name, + 'middle_name', authors.middle_name, + 'annotation_exists', EXISTS( + SELECT * FROM author_annotations WHERE author = authors.id + ) + ) + ) + FROM translations + JOIN authors ON authors.id = translations.author + WHERE translations.book = b.id + ) AS "translators!: Vec", + ( + SELECT + JSON_AGG( + JSON_BUILD_OBJECT( + 'id', sequences.id, + 'name', sequences.name + ) + ) + FROM book_sequences + JOIN sequences ON sequences.id = book_sequences.sequence + WHERE book_sequences.book = b.id + ) AS "sequences!: Vec", + ( + SELECT + JSON_AGG( + JSON_BUILD_OBJECT( + 'id', genres.id, + 'code', genres.code, + 'description', genres.description, + 'meta', genres.meta, + 'source', JSON_BUILD_OBJECT( + 'id', sources.id, + 'name', sources.name + ) + ) + ) + FROM book_genres + JOIN genres ON genres.id = book_genres.genre + JOIN sources ON sources.id = genres.source + WHERE book_genres.book = b.id + ) AS "genres!: Vec", + EXISTS( + SELECT * FROM book_annotations WHERE book = b.id + ) AS "annotation_exists!: bool", + ( + SELECT + JSON_BUILD_OBJECT( + 'id', sources.id, + 'name', sources.name + ) + FROM sources + WHERE sources.id = b.source + ) AS "source!: Source", + b.remote_id, + b.is_deleted, + b.pages + FROM books b + WHERE b.id = $1 + "#, + book_id + ) + .fetch_optional(&db.0) .await .unwrap(); match book { - Some(book) => Json::(book.into()).into_response(), + Some(book) => Json::(book).into_response(), None => StatusCode::NOT_FOUND.into_response(), } } pub async fn get_book_annotation(db: Database, Path(book_id): Path) -> impl IntoResponse { - let book_annotation = db - .book_annotation() - .find_unique(book_annotation::book_id::equals(book_id)) - .exec() - .await - .unwrap(); + let book_annotation = sqlx::query_as!( + BookAnnotation, + r#" + SELECT + id, + title, + text, + file + FROM book_annotations + WHERE book = $1 + "#, + book_id + ) + .fetch_optional(&db.0) + .await + .unwrap(); match book_annotation { - Some(book_annotation) => Json::(book_annotation.into()).into_response(), + Some(book_annotation) => Json::(book_annotation).into_response(), None => StatusCode::NOT_FOUND.into_response(), } } diff --git a/src/views/genres.rs b/src/views/genres.rs index e2541bb..87785f8 100644 --- a/src/views/genres.rs +++ b/src/views/genres.rs @@ -1,16 +1,14 @@ use std::collections::HashSet; use axum::{extract::Query, response::IntoResponse, routing::get, Json, Router}; -use prisma_client_rust::Direction; -use crate::{ - prisma::genre, - serializers::{ - genre::{Genre, GenreFilter}, - pagination::{Page, Pagination}, - }, +use crate::serializers::{ + genre::{Genre, GenreFilter}, + pagination::{Page, Pagination}, }; +use crate::serializers::source::Source; + use super::Database; pub async fn get_genres( @@ -18,43 +16,80 @@ pub async fn get_genres( pagination: Query, Query(GenreFilter { meta }): Query, ) -> impl IntoResponse { - let filter = { - match meta { - Some(meta) => vec![genre::meta::equals(meta)], - None => vec![], - } - }; + let genres_count = sqlx::query_scalar!( + r#" + SELECT COUNT(*) FROM genres + WHERE (meta = $1 OR $1 IS NULL) + "#, + meta + ) + .fetch_one(&db.0) + .await + .unwrap() + .unwrap(); - let genres_count = db.genre().count(filter.clone()).exec().await.unwrap(); + let genres = sqlx::query_as!( + Genre, + r#" + SELECT + genres.id, + genres.remote_id, + genres.code, + genres.description, + genres.meta, + ( + SELECT + JSON_BUILD_OBJECT( + 'id', sources.id, + 'name', sources.name + ) + FROM sources + WHERE sources.id = genres.source + ) AS "source!: Source" + FROM genres + WHERE (meta = $1 OR $1 IS NULL) + ORDER BY genres.id ASC + LIMIT $2 OFFSET $3 + "#, + meta, + pagination.size, + (pagination.page - 1) * pagination.size + ) + .fetch_all(&db.0) + .await + .unwrap(); - let genres = db - .genre() - .find_many(filter) - .with(genre::source::fetch()) - .order_by(genre::id::order(Direction::Asc)) - .skip((pagination.page - 1) * pagination.size) - .take(pagination.size) - .exec() - .await - .unwrap(); - - let page: Page = Page::new( - genres.iter().map(|item| item.clone().into()).collect(), - genres_count, - &pagination, - ); + let page: Page = Page::new(genres, genres_count, &pagination); Json(page) } pub async fn get_genre_metas(db: Database) -> impl IntoResponse { - let genres = db - .genre() - .find_many(vec![]) - .order_by(genre::id::order(Direction::Asc)) - .exec() - .await - .unwrap(); + let genres = sqlx::query_as!( + Genre, + r#" + SELECT + genres.id, + genres.remote_id, + genres.code, + genres.description, + genres.meta, + ( + SELECT + JSON_BUILD_OBJECT( + 'id', sources.id, + 'name', sources.name + ) + FROM sources + WHERE sources.id = genres.source + ) AS "source!: Source" + FROM genres + ORDER BY genres.id ASC + "# + ) + .fetch_all(&db.0) + .await + .unwrap(); let mut metas: HashSet = HashSet::new(); diff --git a/src/views/mod.rs b/src/views/mod.rs index e9c2ecd..4ee06b4 100644 --- a/src/views/mod.rs +++ b/src/views/mod.rs @@ -1,5 +1,3 @@ -use std::sync::Arc; - use axum::{ http::{self, Request, StatusCode}, middleware::{self, Next}, @@ -8,10 +6,11 @@ use axum::{ Extension, Router, }; use axum_prometheus::PrometheusMetricLayer; +use sqlx::PgPool; use tower_http::trace::{self, TraceLayer}; use tracing::Level; -use crate::{config::CONFIG, db::get_prisma_client, prisma::PrismaClient}; +use crate::{config::CONFIG, db::get_postgres_pool}; use self::translators::get_translators_router; use self::{ @@ -26,7 +25,7 @@ pub mod genres; pub mod sequences; pub mod translators; -pub type Database = Extension>; +pub type Database = Extension; async fn auth(req: Request, next: Next) -> Result { let auth_header = req @@ -48,7 +47,7 @@ async fn auth(req: Request, next: Next) -> Result Router { - let client = Arc::new(get_prisma_client().await); + let client = get_postgres_pool().await; let (prometheus_layer, metric_handle) = PrometheusMetricLayer::pair(); diff --git a/src/views/sequences.rs b/src/views/sequences.rs index bed27b7..cf06ac6 100644 --- a/src/views/sequences.rs +++ b/src/views/sequences.rs @@ -10,9 +10,10 @@ use axum::{ use crate::{ meilisearch::{get_meili_client, SequenceMeili}, - prisma::{author, book, book_author, book_sequence, sequence, translator}, serializers::{ allowed_langs::AllowedLangs, + author::Author, + book::BaseBook, pagination::{Page, PageWithParent, Pagination}, sequence::{Sequence, SequenceBook}, }, @@ -36,15 +37,18 @@ async fn get_random_sequence( get_random_item::(authors_index, filter).await }; - let sequence = db - .sequence() - .find_unique(sequence::id::equals(sequence_id)) - .exec() - .await - .unwrap() - .unwrap(); + let sequence = sqlx::query_as!( + Sequence, + r#" + SELECT id, name FROM sequences WHERE id = $1 + "#, + sequence_id + ) + .fetch_one(&db.0) + .await + .unwrap(); - Json::(sequence.into()) + Json::(sequence) } async fn search_sequence( @@ -78,12 +82,16 @@ async fn search_sequence( let total = result.estimated_total_hits.unwrap(); let sequence_ids: Vec = result.hits.iter().map(|a| a.result.id).collect(); - let mut sequences = db - .sequence() - .find_many(vec![sequence::id::in_vec(sequence_ids.clone())]) - .exec() - .await - .unwrap(); + let mut sequences = sqlx::query_as!( + Sequence, + r#" + SELECT id, name FROM sequences WHERE id = ANY($1) + "#, + &sequence_ids + ) + .fetch_all(&db.0) + .await + .unwrap(); sequences.sort_by(|a, b| { let a_pos = sequence_ids.iter().position(|i| *i == a.id).unwrap(); @@ -92,25 +100,25 @@ async fn search_sequence( a_pos.cmp(&b_pos) }); - let page: Page = Page::new( - sequences.iter().map(|item| item.clone().into()).collect(), - total.try_into().unwrap(), - &pagination, - ); + let page: Page = Page::new(sequences, total.try_into().unwrap(), &pagination); Json(page) } async fn get_sequence(db: Database, Path(sequence_id): Path) -> impl IntoResponse { - let sequence = db - .sequence() - .find_unique(sequence::id::equals(sequence_id)) - .exec() - .await - .unwrap(); + let sequence = sqlx::query_as!( + Sequence, + r#" + SELECT id, name FROM sequences WHERE id = $1 + "#, + sequence_id + ) + .fetch_optional(&db.0) + .await + .unwrap(); match sequence { - Some(sequence) => Json::(sequence.into()).into_response(), + Some(sequence) => Json::(sequence).into_response(), None => StatusCode::NOT_FOUND.into_response(), } } @@ -122,27 +130,34 @@ async fn get_sequence_available_types( AllowedLangs, >, ) -> impl IntoResponse { - let books = db - .book() - .find_many(vec![ - book::is_deleted::equals(false), - book::book_sequences::some(vec![book_sequence::sequence_id::equals(sequence_id)]), - book::lang::in_vec(allowed_langs), - ]) - .exec() + // TODO: refactor + + let books = sqlx::query_as!( + BaseBook, + r#" + SELECT + b.id, + CASE WHEN b.file_type = 'fb2' THEN ARRAY['fb2', 'epub', 'mobi', 'fb2zip'] ELSE ARRAY[b.file_type] END AS "available_types!: Vec" + FROM books b + JOIN book_sequences bs ON b.id = bs.book + WHERE + b.is_deleted = FALSE AND + bs.sequence = $1 AND + b.lang = ANY($2) + "#, + sequence_id, + &allowed_langs + ) + .fetch_all(&db.0) .await .unwrap(); let mut file_types: HashSet = HashSet::new(); for book in books { - file_types.insert(book.file_type.clone()); - } - - if file_types.contains("fb2") { - file_types.insert("epub".to_string()); - file_types.insert("mobi".to_string()); - file_types.insert("fb2zip".to_string()); + for file_type in book.available_types { + file_types.insert(file_type); + } } Json::>(file_types.into_iter().collect()) @@ -156,83 +171,137 @@ async fn get_sequence_books( >, pagination: Query, ) -> impl IntoResponse { - let sequence = db - .sequence() - .find_unique(sequence::id::equals(sequence_id)) - .exec() - .await - .unwrap(); + let sequence = sqlx::query_as!( + Sequence, + r#" + SELECT id, name FROM sequences WHERE id = $1 + "#, + sequence_id + ) + .fetch_optional(&db.0) + .await + .unwrap(); let sequence = match sequence { Some(v) => v, None => return StatusCode::NOT_FOUND.into_response(), }; - let books_filter = vec![ - book_sequence::book::is(vec![ - book::is_deleted::equals(false), - book::lang::in_vec(allowed_langs.clone()), - ]), - book_sequence::sequence_id::equals(sequence.id), - ]; + // let books_filter = vec![ + // book_sequence::book::is(vec![ + // book::is_deleted::equals(false), + // book::lang::in_vec(allowed_langs.clone()), + // ]), + // book_sequence::sequence_id::equals(sequence.id), + // ]; - let books_count = db - .book_sequence() - .count(books_filter.clone()) - .exec() + let books_count = sqlx::query_scalar!( + "SELECT COUNT(*) FROM book_sequences bs + JOIN books b ON b.id = bs.book + WHERE + b.is_deleted = FALSE AND + bs.sequence = $1 AND + b.lang = ANY($2)", + sequence.id, + &allowed_langs + ) + .fetch_one(&db.0) + .await + .unwrap() + .unwrap(); + + let mut books = sqlx::query_as!( + SequenceBook, + r#" + SELECT + b.id, + b.title, + b.lang, + b.file_type, + b.year, + CASE WHEN b.file_type = 'fb2' THEN ARRAY['fb2', 'epub', 'mobi', 'fb2zip'] ELSE ARRAY[b.file_type] END AS "available_types!: Vec", + b.uploaded, + ( + SELECT + JSON_AGG( + JSON_BUILD_OBJECT( + 'id', authors.id, + 'first_name', authors.first_name, + 'last_name', authors.last_name, + 'middle_name', authors.middle_name, + 'annotation_exists', EXISTS( + SELECT * FROM author_annotations WHERE author = authors.id + ) + ) + ) + FROM book_authors + JOIN authors ON authors.id = book_authors.author + WHERE book_authors.book = b.id + ) AS "authors!: Vec", + ( + SELECT + JSON_AGG( + JSON_BUILD_OBJECT( + 'id', authors.id, + 'first_name', authors.first_name, + 'last_name', authors.last_name, + 'middle_name', authors.middle_name, + 'annotation_exists', EXISTS( + SELECT * FROM author_annotations WHERE author = authors.id + ) + ) + ) + FROM translations + JOIN authors ON authors.id = translations.author + WHERE translations.book = b.id + ) AS "translators!: Vec", + EXISTS( + SELECT * FROM book_annotations WHERE book = b.id + ) AS "annotation_exists!: bool", + bs.position + FROM books b + JOIN book_sequences bs ON b.id = bs.book + WHERE + b.is_deleted = FALSE AND + bs.sequence = $1 AND + b.lang = ANY($2) + ORDER BY bs.position + LIMIT $3 OFFSET $4 + "#, + sequence.id, + &allowed_langs, + pagination.size, + (pagination.page - 1) * pagination.size, + ) + .fetch_all(&db.0) .await .unwrap(); - let book_sequences = db - .book_sequence() - .find_many(vec![ - book_sequence::book::is(vec![ - book::is_deleted::equals(false), - book::lang::in_vec(allowed_langs.clone()), - ]), - book_sequence::sequence_id::equals(sequence.id), - ]) - .order_by(book_sequence::position::order( - prisma_client_rust::Direction::Asc, - )) - .skip((pagination.page - 1) * pagination.size) - .take(pagination.size) - .exec() - .await - .unwrap(); + // let books = db + // .book() + // .find_many(vec![book::id::in_vec(book_ids)]) + // .with(book::source::fetch()) + // .with(book::book_annotation::fetch()) + // .with( + // book::book_authors::fetch(vec![]) + // .with(book_author::author::fetch().with(author::author_annotation::fetch())), + // ) + // .with( + // book::translations::fetch(vec![]) + // .with(translator::author::fetch().with(author::author_annotation::fetch())), + // ) + // .with(book::book_sequences::fetch(vec![ + // book_sequence::sequence_id::equals(sequence.id), + // ])) + // .order_by(book::id::order(prisma_client_rust::Direction::Asc)) + // .exec() + // .await + // .unwrap(); - let book_ids: Vec = book_sequences.iter().map(|a| a.book_id).collect(); - - let books = db - .book() - .find_many(vec![book::id::in_vec(book_ids)]) - .with(book::source::fetch()) - .with(book::book_annotation::fetch()) - .with( - book::book_authors::fetch(vec![]) - .with(book_author::author::fetch().with(author::author_annotation::fetch())), - ) - .with( - book::translations::fetch(vec![]) - .with(translator::author::fetch().with(author::author_annotation::fetch())), - ) - .with(book::book_sequences::fetch(vec![ - book_sequence::sequence_id::equals(sequence.id), - ])) - .order_by(book::id::order(prisma_client_rust::Direction::Asc)) - .exec() - .await - .unwrap(); - - let mut sequence_books = books - .iter() - .map(|item| item.clone().into()) - .collect::>(); - - sequence_books.sort_by(|a, b| a.position.cmp(&b.position)); + books.sort_by(|a, b| a.position.cmp(&b.position)); let page: PageWithParent = - PageWithParent::new(sequence.into(), sequence_books, books_count, &pagination); + PageWithParent::new(sequence, books, books_count, &pagination); Json(page).into_response() } diff --git a/src/views/translators.rs b/src/views/translators.rs index d25c53b..835d162 100644 --- a/src/views/translators.rs +++ b/src/views/translators.rs @@ -10,15 +10,12 @@ use axum::{ use crate::{ meilisearch::{get_meili_client, AuthorMeili}, - prisma::{ - author, - book::{self}, - book_author, book_sequence, translator, - }, serializers::{ allowed_langs::AllowedLangs, author::Author, + book::BaseBook, pagination::{Page, PageWithParent, Pagination}, + sequence::Sequence, translator::TranslatorBook, }, }; @@ -33,50 +30,103 @@ async fn get_translated_books( >, pagination: Query, ) -> impl IntoResponse { - let translator = db - .author() - .find_unique(author::id::equals(translator_id)) - .with(author::author_annotation::fetch()) - .exec() - .await - .unwrap(); + let translator = sqlx::query_as!( + Author, + r#" + SELECT + a.id, + a.first_name, + a.last_name, + COALESCE(a.middle_name, '') AS "middle_name!: String", + CASE + WHEN aa.id IS NOT NULL THEN true + ELSE false + END AS "annotation_exists!: bool" + FROM authors a + LEFT JOIN author_annotations aa ON a.id = aa.author + WHERE a.id = $1 + "#, + translator_id + ) + .fetch_optional(&db.0) + .await + .unwrap(); let translator = match translator { Some(translator) => translator, None => return StatusCode::NOT_FOUND.into_response(), }; - let books_filter = vec![ - book::is_deleted::equals(false), - book::translations::some(vec![translator::author_id::equals(translator_id)]), - book::lang::in_vec(allowed_langs.clone()), - ]; + let books_count = sqlx::query_scalar!( + r#" + SELECT COUNT(*) + FROM books b + JOIN book_authors ba ON b.id = ba.book + WHERE + b.is_deleted = false + AND ba.author = $1 + AND b.lang = ANY($2) + "#, + translator_id, + &allowed_langs + ) + .fetch_one(&db.0) + .await + .unwrap() + .unwrap(); - let books_count = db.book().count(books_filter.clone()).exec().await.unwrap(); - - let books = db - .book() - .find_many(books_filter) - .with(book::source::fetch()) - .with(book::book_annotation::fetch()) - .with( - book::book_authors::fetch(vec![]) - .with(book_author::author::fetch().with(author::author_annotation::fetch())), - ) - .with(book::book_sequences::fetch(vec![]).with(book_sequence::sequence::fetch())) - .order_by(book::title::order(prisma_client_rust::Direction::Asc)) - .skip((pagination.page - 1) * pagination.size) - .take(pagination.size) - .exec() + let books = sqlx::query_as!( + TranslatorBook, + r#" + SELECT + b.id, + b.title, + b.lang, + b.file_type, + b.year, + CASE WHEN b.file_type = 'fb2' THEN ARRAY['fb2', 'epub', 'mobi', 'fb2zip'] ELSE ARRAY[b.file_type] END AS "available_types!: Vec", + b.uploaded, + ( + SELECT + JSON_AGG( + JSON_BUILD_OBJECT( + 'id', authors.id, + 'first_name', authors.first_name, + 'last_name', authors.last_name, + 'middle_name', authors.middle_name, + 'annotation_exists', EXISTS( + SELECT * FROM author_annotations WHERE author = authors.id + ) + ) + ) + FROM book_authors + JOIN authors ON authors.id = book_authors.author + WHERE book_authors.book = b.id + ) AS "authors!: Vec", + ( + SELECT + JSON_AGG( + JSON_BUILD_OBJECT( + 'id', sequences.id, + 'name', sequences.name + ) + ) + FROM book_sequences + JOIN sequences ON sequences.id = book_sequences.sequence + WHERE book_sequences.book = b.id + ) AS "sequences!: Vec", + EXISTS( + SELECT * FROM book_annotations WHERE book = b.id + ) AS "annotation_exists!: bool" + FROM books b + "#, + ) + .fetch_all(&db.0) .await .unwrap(); - let page: PageWithParent = PageWithParent::new( - translator.into(), - books.iter().map(|item| item.clone().into()).collect(), - books_count, - &pagination, - ); + let page: PageWithParent = + PageWithParent::new(translator, books, books_count, &pagination); Json(page).into_response() } @@ -88,27 +138,34 @@ async fn get_translated_books_available_types( AllowedLangs, >, ) -> impl IntoResponse { - let books = db - .book() - .find_many(vec![ - book::is_deleted::equals(false), - book::translations::some(vec![translator::author_id::equals(translator_id)]), - book::lang::in_vec(allowed_langs), - ]) - .exec() + // TODO: refactor + + let books = sqlx::query_as!( + BaseBook, + r#" + SELECT + b.id, + CASE WHEN b.file_type = 'fb2' THEN ARRAY['fb2', 'epub', 'mobi', 'fb2zip'] ELSE ARRAY[b.file_type] END AS "available_types!: Vec" + FROM books b + JOIN book_authors ba ON b.id = ba.book + WHERE + b.is_deleted = false + AND ba.author = $1 + AND b.lang = ANY($2) + "#, + translator_id, + &allowed_langs + ) + .fetch_all(&db.0) .await .unwrap(); let mut file_types: HashSet = HashSet::new(); for book in books { - file_types.insert(book.file_type.clone()); - } - - if file_types.contains("fb2") { - file_types.insert("epub".to_string()); - file_types.insert("mobi".to_string()); - file_types.insert("fb2zip".to_string()); + for file_type in book.available_types { + file_types.insert(file_type); + } } Json::>(file_types.into_iter().collect()) @@ -145,14 +202,27 @@ async fn search_translators( let total = result.estimated_total_hits.unwrap(); let translator_ids: Vec = result.hits.iter().map(|a| a.result.id).collect(); - let mut translators = db - .author() - .find_many(vec![author::id::in_vec(translator_ids.clone())]) - .with(author::author_annotation::fetch()) - .order_by(author::id::order(prisma_client_rust::Direction::Asc)) - .exec() - .await - .unwrap(); + let mut translators = sqlx::query_as!( + Author, + r#" + SELECT + a.id, + a.first_name, + a.last_name, + COALESCE(a.middle_name, '') AS "middle_name!: String", + CASE + WHEN aa.id IS NOT NULL THEN true + ELSE false + END AS "annotation_exists!: bool" + FROM authors a + LEFT JOIN author_annotations aa ON a.id = aa.author + WHERE a.id = ANY($1) + "#, + &translator_ids + ) + .fetch_all(&db.0) + .await + .unwrap(); translators.sort_by(|a, b| { let a_pos = translator_ids.iter().position(|i| *i == a.id).unwrap(); @@ -161,11 +231,7 @@ async fn search_translators( a_pos.cmp(&b_pos) }); - let page: Page = Page::new( - translators.iter().map(|item| item.clone().into()).collect(), - total.try_into().unwrap(), - &pagination, - ); + let page: Page = Page::new(translators, total.try_into().unwrap(), &pagination); Json(page) }