diff --git a/.github/workflows/validation-rust.yaml b/.github/workflows/validation-rust.yaml index 66d494e..b96fb5f 100644 --- a/.github/workflows/validation-rust.yaml +++ b/.github/workflows/validation-rust.yaml @@ -16,6 +16,7 @@ name: Rust Validation env: RUSTDOCFLAGS: -D warnings RUSTFLAGS: -D warnings -C debuginfo=1 + RUST_BACKTRACE: 1 CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse jobs: diff --git a/Cargo.lock b/Cargo.lock index b9091cb..8c4be29 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,50 @@ # It is not intended for manual editing. version = 3 +[[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.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" +dependencies = [ + "getrandom", + "once_cell", + "version_check", +] + +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "allocator-api2" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" + [[package]] name = "android-tzdata" version = "0.1.1" @@ -17,6 +61,12 @@ dependencies = [ "libc", ] +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + [[package]] name = "atomic" version = "0.5.3" @@ -29,38 +79,176 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bigdecimal" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9324c8014cd04590682b34f1e9448d38f0674d0f7b2dc553331016ef0e4e9ebc" +dependencies = [ + "autocfg", + "libm", + "num-bigint", + "num-integer", + "num-traits", +] + +[[package]] +name = "bindgen" +version = "0.69.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" +dependencies = [ + "bitflags", + "cexpr", + "clang-sys", + "itertools", + "lazy_static", + "lazycell", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 2.0.61", +] + [[package]] name = "bitflags" version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + [[package]] name = "block-buffer" version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ - "generic-array 0.14.7", + "generic-array", +] + +[[package]] +name = "borsh" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbe5b10e214954177fb1dc9fbd20a1a2608fe99e6c832033bdc7cea287a20d77" +dependencies = [ + "borsh-derive", + "cfg_aliases", +] + +[[package]] +name = "borsh-derive" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7a8646f94ab393e43e8b35a2558b1624bed28b97ee09c5d15456e3c9463f46d" +dependencies = [ + "once_cell", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.61", + "syn_derive", +] + +[[package]] +name = "btoi" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dd6407f73a9b8b6162d8a2ef999fe6afd7cc15902ebf42c5cd296addf17e0ad" +dependencies = [ + "num-traits", ] +[[package]] +name = "bufstream" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40e38929add23cdf8a366df9b0e088953150724bcbe5fc330b0d8eb3b328eec8" + [[package]] name = "bumpalo" version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +[[package]] +name = "bytecheck" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23cdc57ce23ac53c931e88a43d06d070a6fd142f2617be5855eb75efc9beb1c2" +dependencies = [ + "bytecheck_derive", + "ptr_meta", + "simdutf8", +] + +[[package]] +name = "bytecheck_derive" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3db406d29fbcd95542e92559bed4d8ad92636d1ca8b3b72ede10b4bcc010e659" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "byteorder" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" +[[package]] +name = "bytes" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" + [[package]] name = "cc" version = "1.0.97" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "099a5357d84c4c61eb35fc8eafa9a79a902c2f76911e5747ced4e032edd8d9b4" +dependencies = [ + "jobserver", + "libc", + "once_cell", +] + +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] [[package]] name = "cfg-if" @@ -68,6 +256,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" + [[package]] name = "chrono" version = "0.4.38" @@ -82,6 +276,36 @@ dependencies = [ "windows-targets", ] +[[package]] +name = "clang-sys" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "cmake" +version = "0.1.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130" +dependencies = [ + "cc", +] + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "core-foundation-sys" version = "0.8.6" @@ -97,49 +321,134 @@ dependencies = [ "libc", ] +[[package]] +name = "crc32fast" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1137cd7e7fc0fb5d3c5a8678be38ec56e819125d8d7907411fe24ccb943faca8" +dependencies = [ + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-epoch", + "crossbeam-queue", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab3db02a9c5b5121e1e42fbdb1aeb65f5e02624cc58c43f2884c6ccac0b82f95" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-queue" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" + [[package]] name = "crypto-common" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "generic-array 0.14.7", + "generic-array", "typenum", ] [[package]] -name = "diesel" -version = "2.1.6" +name = "darling" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff236accb9a5069572099f0b350a92e9560e8e63a9b8d546162f4a5e03026bb2" +checksum = "54e36fcd13ed84ffdfda6f5be89b31287cbb80c439841fe69e04841435464391" dependencies = [ - "bitflags", - "byteorder", - "diesel_derives", - "mysqlclient-sys", - "percent-encoding", - "url", + "darling_core", + "darling_macro", ] [[package]] -name = "diesel_derives" -version = "2.1.4" +name = "darling_core" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14701062d6bed917b5c7103bdffaee1e4609279e240488ad24e7bd979ca6866c" +checksum = "9c2cf1c23a687a1feeb728783b993c4e1ad83d99f351801977dd809b48d0a70f" dependencies = [ - "diesel_table_macro_syntax", + "fnv", + "ident_case", "proc-macro2", "quote", - "syn", + "strsim", + "syn 2.0.61", ] [[package]] -name = "diesel_table_macro_syntax" -version = "0.1.0" +name = "darling_macro" +version = "0.20.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" +dependencies = [ + "darling_core", + "quote", + "syn 2.0.61", +] + +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", +] + +[[package]] +name = "derive_utils" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc5557efc453706fed5e4fa85006fe9817c224c3f480a34c7e5959fd700921c5" +checksum = "61bb5a1014ce6dfc2a378578509abe775a5aa06bff584a547555d9efdb81b926" dependencies = [ - "syn", + "proc-macro2", + "quote", + "syn 2.0.61", ] [[package]] @@ -158,6 +467,12 @@ version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59f8e79d1fbf76bdfbde321e902714bf6c49df88a7dda6fc682fc2979226962d" +[[package]] +name = "either" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" + [[package]] name = "equivalent" version = "1.0.1" @@ -165,88 +480,210 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] -name = "form_urlencoded" -version = "1.2.1" +name = "errno" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ - "percent-encoding", + "libc", + "windows-sys", ] [[package]] -name = "generic-array" -version = "0.14.7" +name = "fastrand" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" + +[[package]] +name = "flate2" +version = "1.0.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" dependencies = [ - "typenum", - "version_check", + "crc32fast", + "libz-sys", + "miniz_oxide", ] [[package]] -name = "generic-array" -version = "1.0.0" +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 = "fe739944a5406424e080edccb6add95685130b9f160d5407c639c7df0c5836b0" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" dependencies = [ - "typenum", + "foreign-types-shared", ] [[package]] -name = "getrandom" -version = "0.2.15" +name = "foreign-types-shared" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ - "cfg-if", - "libc", - "wasi", + "percent-encoding", ] [[package]] -name = "glob" -version = "0.3.1" +name = "frunk" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" +checksum = "11a351b59e12f97b4176ee78497dff72e4276fb1ceb13e19056aca7fa0206287" +dependencies = [ + "frunk_core", + "frunk_derives", + "frunk_proc_macros", +] [[package]] -name = "hashbrown" -version = "0.14.5" +name = "frunk_core" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +checksum = "af2469fab0bd07e64ccf0ad57a1438f63160c69b2e57f04a439653d68eb558d6" [[package]] -name = "heck" -version = "0.5.0" +name = "frunk_derives" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" +checksum = "b0fa992f1656e1707946bbba340ad244f0814009ef8c0118eb7b658395f19a2e" +dependencies = [ + "frunk_proc_macro_helpers", + "quote", + "syn 2.0.61", +] [[package]] -name = "iana-time-zone" -version = "0.1.60" +name = "frunk_proc_macro_helpers" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +checksum = "35b54add839292b743aeda6ebedbd8b11e93404f902c56223e51b9ec18a13d2c" dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows-core", + "frunk_core", + "proc-macro2", + "quote", + "syn 2.0.61", ] [[package]] -name = "iana-time-zone-haiku" +name = "frunk_proc_macros" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +checksum = "71b85a1d4a9a6b300b41c05e8e13ef2feca03e0334127f29eca9506a7fe13a93" dependencies = [ - "cc", + "frunk_core", + "frunk_proc_macro_helpers", + "quote", + "syn 2.0.61", ] [[package]] -name = "idna" -version = "0.5.0" +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[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.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +dependencies = [ + "ahash 0.7.8", +] + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash 0.8.11", + "allocator-api2", +] + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "iana-time-zone" +version = "0.1.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[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 = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ @@ -261,7 +698,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", - "hashbrown", + "hashbrown 0.14.5", +] + +[[package]] +name = "io-enum" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53b53d712d99a73eec59ee5e4fe6057f8052142d38eeafbbffcb06b36d738a6e" +dependencies = [ + "derive_utils", +] + +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", ] [[package]] @@ -270,6 +725,15 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +[[package]] +name = "jobserver" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e" +dependencies = [ + "libc", +] + [[package]] name = "js-sys" version = "0.3.69" @@ -285,6 +749,12 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + [[package]] name = "libc" version = "0.2.154" @@ -292,159 +762,616 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" [[package]] -name = "lipsum" -version = "0.8.2" +name = "libloading" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" +dependencies = [ + "cfg-if", + "windows-targets", +] + +[[package]] +name = "libm" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" + +[[package]] +name = "libz-sys" +version = "1.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e143b5e666b2695d28f6bca6497720813f699c9602dd7f5cac91008b8ada7f9" +dependencies = [ + "cc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" + +[[package]] +name = "lipsum" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8451846f1f337e44486666989fbce40be804da139d5a4477d6b88ece5dc69f4" +dependencies = [ + "rand", + "rand_chacha", +] + +[[package]] +name = "log" +version = "0.4.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" + +[[package]] +name = "lru" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc" +dependencies = [ + "hashbrown 0.14.5", +] + +[[package]] +name = "md-5" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" +dependencies = [ + "cfg-if", + "digest", +] + +[[package]] +name = "memchr" +version = "2.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" + +[[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.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +dependencies = [ + "adler", +] + +[[package]] +name = "mysql" +version = "25.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4cc09a8118051e4617886c9c6e693c61444c2eeb5f9a792dc5d631501706565" +dependencies = [ + "bufstream", + "bytes", + "crossbeam", + "flate2", + "io-enum", + "libc", + "lru", + "mysql_common", + "named_pipe", + "native-tls", + "once_cell", + "pem", + "percent-encoding", + "serde", + "serde_json", + "socket2", + "twox-hash", + "url", +] + +[[package]] +name = "mysql-common-derive" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afe0450cc9344afff34915f8328600ab5ae19260802a334d0f72d2d5bdda3bfe" +dependencies = [ + "darling", + "heck 0.4.1", + "num-bigint", + "proc-macro-crate", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.61", + "termcolor", + "thiserror", +] + +[[package]] +name = "mysql_common" +version = "0.32.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ccdc1fe2bb3ef97e07ba4397327ed45509a1e2e499e2f8265243879cbc7313c" +dependencies = [ + "base64 0.21.7", + "bigdecimal", + "bindgen", + "bitflags", + "bitvec", + "btoi", + "byteorder", + "bytes", + "cc", + "cmake", + "crc32fast", + "flate2", + "frunk", + "lazy_static", + "mysql-common-derive", + "num-bigint", + "num-traits", + "rand", + "regex", + "rust_decimal", + "saturating", + "serde", + "serde_json", + "sha1", + "sha2", + "smallvec", + "subprocess", + "thiserror", + "time", + "uuid", + "zstd", +] + +[[package]] +name = "named_pipe" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad9c443cce91fc3e12f017290db75dde490d685cdaaf508d7159d7cf41f0eb2b" +dependencies = [ + "winapi", +] + +[[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 = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "num-bigint" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "openssl" +version = "0.10.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" +dependencies = [ + "bitflags", + "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.61", +] + +[[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.102" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c597637d56fbc83893a35eb0dd04b2b8e7a50c91e64e9493e398b5df4fb45fa2" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "pem" +version = "3.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e459365e590736a54c3fa561947c84837534b8e9af6fc5bf781307e82658fae" +dependencies = [ + "base64 0.22.1", + "serde", +] + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "pkg-config" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "proc-macro-crate" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +dependencies = [ + "toml_edit 0.21.1", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "ptr_meta" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" +dependencies = [ + "ptr_meta_derive", +] + +[[package]] +name = "ptr_meta_derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[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", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "regex" +version = "1.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8451846f1f337e44486666989fbce40be804da139d5a4477d6b88ece5dc69f4" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" dependencies = [ - "rand", - "rand_chacha", + "aho-corasick", + "memchr", + "regex-syntax", ] [[package]] -name = "log" -version = "0.4.21" +name = "regex-syntax" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" [[package]] -name = "md-5" -version = "0.10.6" +name = "rend" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" +checksum = "71fe3824f5629716b1589be05dacd749f6aa084c87e00e016714a8cdfccc997c" dependencies = [ - "cfg-if", - "digest", + "bytecheck", ] [[package]] -name = "memchr" -version = "2.7.2" +name = "rkyv" +version = "0.7.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" +checksum = "5cba464629b3394fc4dbc6f940ff8f5b4ff5c7aef40f29166fd4ad12acbc99c0" +dependencies = [ + "bitvec", + "bytecheck", + "bytes", + "hashbrown 0.12.3", + "ptr_meta", + "rend", + "rkyv_derive", + "seahash", + "tinyvec", + "uuid", +] [[package]] -name = "mysqlclient-sys" -version = "0.2.5" +name = "rkyv_derive" +version = "0.7.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f61b381528ba293005c42a409dd73d034508e273bf90481f17ec2e964a6e969b" +checksum = "a7dddfff8de25e6f62b9d64e6e432bf1c6736c57d20323e15ee10435fbda7c65" dependencies = [ - "pkg-config", - "vcpkg", + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] -name = "num-traits" -version = "0.2.19" +name = "rust_decimal" +version = "1.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +checksum = "1790d1c4c0ca81211399e0e0af16333276f375209e71a37b67698a373db5b47a" dependencies = [ - "autocfg", + "arrayvec", + "borsh", + "bytes", + "num-traits", + "rand", + "rkyv", + "serde", + "serde_json", ] [[package]] -name = "once_cell" -version = "1.19.0" +name = "rustc-hash" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] -name = "percent-encoding" -version = "2.3.1" +name = "rustix" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys", +] [[package]] -name = "pkg-config" -version = "0.3.30" +name = "ryu" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] -name = "ppv-lite86" -version = "0.2.17" +name = "saturating" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "ece8e78b2f38ec51c51f5d475df0a7187ba5111b2a28bdc761ee05b075d40a71" [[package]] -name = "proc-macro2" -version = "1.0.82" +name = "schannel" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" dependencies = [ - "unicode-ident", + "windows-sys", ] [[package]] -name = "quote" -version = "1.0.36" +name = "seahash" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" -dependencies = [ - "proc-macro2", -] +checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" [[package]] -name = "rand" -version = "0.8.5" +name = "security-framework" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" dependencies = [ + "bitflags", + "core-foundation", + "core-foundation-sys", "libc", - "rand_chacha", - "rand_core", -] - -[[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", + "security-framework-sys", ] [[package]] -name = "rand_core" -version = "0.6.4" +name = "security-framework-sys" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +checksum = "317936bbbd05227752583946b9e66d7ce3b489f84e11a94a510b4437fef407d7" dependencies = [ - "getrandom", + "core-foundation-sys", + "libc", ] -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - [[package]] name = "serde" -version = "1.0.200" +version = "1.0.201" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddc6f9cc94d67c0e21aaf7eda3a010fd3af78ebf6e096aa6e2e13c79749cce4f" +checksum = "780f1cebed1629e4753a1a38a3c72d30b97ec044f0aef68cb26650a3c5cf363c" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.200" +version = "1.0.201" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "856f046b9400cee3c8c94ed572ecdb752444c24528c035cd35882aad6f492bcb" +checksum = "c5e405930b9796f1c00bee880d03fc7e0bb4b9a11afc776885ffe84320da2865" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.61", ] [[package]] name = "serde_json" -version = "1.0.116" +version = "1.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e17db7126d17feb94eb3fad46bf1a96b034e8aacbc2e775fe81505f8b0b2813" +checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" dependencies = [ "itoa", "ryu", @@ -460,6 +1387,17 @@ dependencies = [ "serde", ] +[[package]] +name = "sha1" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + [[package]] name = "sha1_smol" version = "1.0.0" @@ -477,6 +1415,67 @@ dependencies = [ "digest", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "simdutf8" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "socket2" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +dependencies = [ + "libc", + "windows-sys", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "subprocess" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c2e86926081dda636c546d8c5e641661049d7562a68f5488be4a1f7f66f6086" +dependencies = [ + "libc", + "winapi", +] + +[[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.61" @@ -488,6 +1487,36 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn_derive" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1329189c02ff984e9736652b1631330da25eaa6bc639089ed4915d25446cbe7b" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.61", +] + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "tempfile" +version = "3.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +dependencies = [ + "cfg-if", + "fastrand", + "rustix", + "windows-sys", +] + [[package]] name = "termcolor" version = "1.4.1" @@ -497,6 +1526,55 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "thiserror" +version = "1.0.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "579e9083ca58dd9dcf91a9923bb9054071b9ebbd800b342194c9feb0ee89fc18" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2470041c06ec3ac1ab38d0356a6119054dedaea53e12fbefc0de730a1c08524" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.61", +] + +[[package]] +name = "time" +version = "0.3.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +dependencies = [ + "deranged", + "num-conv", + "powerfmt", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "time-macros" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" +dependencies = [ + "num-conv", + "time-core", +] + [[package]] name = "tinyvec" version = "1.6.0" @@ -521,7 +1599,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit", + "toml_edit 0.22.12", ] [[package]] @@ -533,6 +1611,17 @@ dependencies = [ "serde", ] +[[package]] +name = "toml_edit" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" +dependencies = [ + "indexmap", + "toml_datetime", + "winnow 0.5.40", +] + [[package]] name = "toml_edit" version = "0.22.12" @@ -543,7 +1632,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "winnow", + "winnow 0.6.8", ] [[package]] @@ -561,6 +1650,17 @@ dependencies = [ "toml", ] +[[package]] +name = "twox-hash" +version = "1.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" +dependencies = [ + "cfg-if", + "rand", + "static_assertions", +] + [[package]] name = "typenum" version = "1.17.0" @@ -581,10 +1681,8 @@ dependencies = [ name = "udf-examples" version = "0.5.5" dependencies = [ - "diesel", - "generic-array 1.0.0", - "lazy_static", "lipsum", + "mysql", "sha2", "udf", "uuid", @@ -594,11 +1692,11 @@ dependencies = [ name = "udf-macros" version = "0.5.5" dependencies = [ - "heck", + "heck 0.5.0", "lazy_static", "proc-macro2", "quote", - "syn", + "syn 2.0.61", "trybuild", "udf", "udf-sys", @@ -692,7 +1790,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn", + "syn 2.0.61", "wasm-bindgen-shared", ] @@ -714,7 +1812,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.61", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -725,6 +1823,22 @@ version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +[[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-util" version = "0.1.8" @@ -734,6 +1848,12 @@ dependencies = [ "windows-sys", ] +[[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-core" version = "0.52.0" @@ -816,6 +1936,15 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" +[[package]] +name = "winnow" +version = "0.5.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +dependencies = [ + "memchr", +] + [[package]] name = "winnow" version = "0.6.8" @@ -824,3 +1953,60 @@ checksum = "c3c52e9c97a68071b23e836c9380edae937f17b9c4667bd021973efc689f618d" dependencies = [ "memchr", ] + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + +[[package]] +name = "zerocopy" +version = "0.7.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.61", +] + +[[package]] +name = "zstd" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d789b1514203a1120ad2429eae43a7bd32b90976a7bb8a05f7ec02fa88cc23a" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "7.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cd99b45c6bc03a018c8b8a86025678c87e55526064e38f9df301989dce7ec0a" +dependencies = [ + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "2.0.10+zstd.1.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c253a4914af5bafc8fa8c86ee400827e83cf6ec01195ec1f1ed8441bf00d65aa" +dependencies = [ + "cc", + "pkg-config", +] diff --git a/udf-examples/Cargo.toml b/udf-examples/Cargo.toml index 914d214..309019a 100644 --- a/udf-examples/Cargo.toml +++ b/udf-examples/Cargo.toml @@ -9,14 +9,12 @@ crate-type = ["cdylib"] [dependencies] lipsum = "0.8.2" -generic-array = "1.0.0" sha2 = "0.10.8" udf = { path = "../udf", features = ["mock", "logging-debug"] } uuid = { version = "1.8.0", features = ["v1", "v3", "v4", "v5", "fast-rng"] } [dev-dependencies] -diesel = { version = "2.1.6", default-features = false, features = ["mysql"] } -lazy_static = "1.4.0" +mysql = "25.0.0" [features] # Used to optionally enable integration tests diff --git a/udf-examples/src/avg2.rs b/udf-examples/src/avg2.rs index 0c6c664..5b81c6c 100644 --- a/udf-examples/src/avg2.rs +++ b/udf-examples/src/avg2.rs @@ -1,10 +1,10 @@ -//! Aggregate cost window function +//! Example average function //! -//! Takes a quantity and a real to return the average value within the window. +//! This is just a reimplemenation of builtin `AVG` //! //! ```sql //! CREATE FUNCTION avg2 RETURNS integer SONAME 'libudf_examples.so'; -//! SELECT avg2(int_column, real_column); +//! SELECT avg2(value); //! ``` // Ignore loss of precision when we cast i64 to f64 #![allow(clippy::cast_precision_loss)] @@ -12,33 +12,26 @@ use udf::prelude::*; -// We reuse our errors from avgcost here, for convenience -use crate::avgcost::Errors; - #[derive(Debug, Default)] struct Avg2 { count: u64, sum: f64, } -#[register] +#[register(alias = "test_avg2_alias")] impl BasicUdf for Avg2 { type Returns<'a> = Option; fn init(cfg: &UdfCfg, args: &ArgList) -> Result { - if args.len() != 2 { - return Err(Errors::WrongArgCount(args.len()).to_string()); + if args.len() != 1 { + return Err(format!( + "this function expected 1 argument; got {}", + args.len() + )); } - let a0 = args.get(0).unwrap(); - let a1 = args.get(1).unwrap(); - - if !a0.value().is_int() { - return Err(Errors::FirstArgType(&a0).to_string()); - } - if !a1.value().is_real() { - return Err(Errors::SecondArgType(&a1).to_string()); - } + let mut a0 = args.get(0).unwrap(); + a0.set_type_coercion(SqlType::Real); cfg.set_maybe_null(true); cfg.set_decimals(10); @@ -61,7 +54,7 @@ impl BasicUdf for Avg2 { } } -#[register] +#[register(alias = "test_avg2_alias")] impl AggregateUdf for Avg2 { fn clear( &mut self, @@ -78,23 +71,8 @@ impl AggregateUdf for Avg2 { args: &ArgList, _error: Option, ) -> Result<(), NonZeroU8> { - let in_qty; - let in_sum; - - if let Some(q) = args.get(0).unwrap().value().as_int() { - in_qty = q; - } else { - return Ok(()); - }; - - if let Some(s) = args.get(1).unwrap().value().as_real() { - in_sum = s; - } else { - return Ok(()); - } - - self.count += in_qty as u64; - self.sum += in_sum; + self.count += 1; + self.sum += args.get(0).unwrap().value().as_real().unwrap(); Ok(()) } @@ -106,23 +84,8 @@ impl AggregateUdf for Avg2 { args: &ArgList, _error: Option, ) -> Result<(), NonZeroU8> { - let in_qty; - let in_sum; - - if let Some(q) = args.get(0).unwrap().value().as_int() { - in_qty = q; - } else { - return Ok(()); - }; - - if let Some(s) = args.get(1).unwrap().value().as_real() { - in_sum = s; - } else { - return Ok(()); - } - - self.count -= in_qty as u64; - self.sum -= in_sum; + self.count -= 1; + self.sum -= args.get(0).unwrap().value().as_real().unwrap(); Ok(()) } diff --git a/udf-examples/tests/attribute.rs b/udf-examples/tests/attribute.rs index 2a29e35..60b8e06 100644 --- a/udf-examples/tests/attribute.rs +++ b/udf-examples/tests/attribute.rs @@ -3,11 +3,9 @@ mod backend; use backend::get_db_connection; -use diesel::dsl::sql; -use diesel::prelude::*; -use diesel::sql_types::Text; +use mysql::prelude::*; -const SETUP: [&str; 4] = [ +const SETUP: &[&str] = &[ "create or replace function udf_attribute returns string soname 'libudf_examples.so'", @@ -24,16 +22,17 @@ const SETUP: [&str; 4] = [ #[test] fn test_basic() { - let conn = &mut get_db_connection(&SETUP); + let conn = &mut get_db_connection(SETUP); - let res: String = - sql::("select udf_attribute(1, 'string', val, 3.2) from test_attribute") - .get_result(conn) - .expect("bad result"); + let res: String = conn + .query_first("select udf_attribute(1, 'string', val, 3.2) from test_attribute") + .unwrap() + .unwrap(); assert_eq!(res, "1, 'string', val, 3.2"); - let res: String = sql::("select attr(1, 'string', val, 3.2) from test_attribute") - .get_result(conn) - .expect("bad result"); + let res: String = conn + .query_first("select attr(1, 'string', val, 3.2) from test_attribute") + .unwrap() + .unwrap(); assert_eq!(res, "1, 'string', val, 3.2"); } diff --git a/udf-examples/tests/avg2.rs b/udf-examples/tests/avg2.rs new file mode 100644 index 0000000..99adac2 --- /dev/null +++ b/udf-examples/tests/avg2.rs @@ -0,0 +1,45 @@ +#![cfg(feature = "backend")] + +mod backend; + +use backend::{approx_eq, get_db_connection}; +use mysql::prelude::*; + +const SETUP: &[&str] = &[ + "CREATE OR REPLACE AGGREGATE function avg2 + RETURNS real + SONAME 'libudf_examples.so'", + "CREATE OR REPLACE AGGREGATE FUNCTION test_avg2_alias + RETURNS real + SONAME 'libudf_examples.so'", + "CREATE OR REPLACE TABLE test_avg2 ( + id int auto_increment, + val int, + primary key (id) + )", + "INSERT INTO test_avg2 (val) VALUES (2), (1), (3), (4), (-3), (7), (-1)", +]; + +#[test] +fn test_avg2() { + let conn = &mut get_db_connection(SETUP); + + let res: f32 = conn + .query_first("select avg2(val) from test_avg2") + .unwrap() + .unwrap(); + + assert!(approx_eq(res, 1.857)); +} + +#[test] +fn test_avg2_alias() { + let conn = &mut get_db_connection(SETUP); + + let res: f32 = conn + .query_first("select test_avg2_alias(val) from test_avg2") + .unwrap() + .unwrap(); + + assert!(approx_eq(res, 1.857)); +} diff --git a/udf-examples/tests/avgcost.rs b/udf-examples/tests/avgcost.rs new file mode 100644 index 0000000..9ca7749 --- /dev/null +++ b/udf-examples/tests/avgcost.rs @@ -0,0 +1,45 @@ +#![cfg(feature = "backend")] + +mod backend; + +use backend::{approx_eq, get_db_connection}; +use mysql::prelude::*; + +const SETUP: &[&str] = &[ + "CREATE OR REPLACE AGGREGATE FUNCTION avgcost + RETURNS integer + SONAME 'libudf_examples.so'", + "CREATE OR REPLACE TABLE test_avgcost ( + id int auto_increment, + qty int, + cost real, + class varchar(30), + primary key (id) + )", + r#"INSERT INTO test_avgcost (qty, cost, class) values + (10, 50, "a"), + (8, 5.6, "c"), + (5, 20.7, "a"), + (10, 12.78, "b"), + (6, 7.2, "c"), + (2, 10.3, "b"), + (3, 9.1, "c") + "#, +]; + +#[test] +fn test_empty() { + let conn = &mut get_db_connection(SETUP); + + let res: Vec = conn + .query("SELECT avg_cost(qty, cost) FROM test_avgcost GROUP BY class") + .unwrap(); + + println!("{res:?}"); + assert_eq!(res.len(), 3); + + let expected = [40.23, 12.36, 6.78]; + for (a, b) in res.iter().zip(expected.iter()) { + assert!(approx_eq(*a, *b)); + } +} diff --git a/udf-examples/tests/backend/mod.rs b/udf-examples/tests/backend/mod.rs index 83fc3cc..1517a55 100644 --- a/udf-examples/tests/backend/mod.rs +++ b/udf-examples/tests/backend/mod.rs @@ -9,23 +9,16 @@ #![cfg(feature = "backend")] use std::collections::HashSet; use std::env; -use std::sync::{Mutex, Once}; +use std::sync::{Mutex, OnceLock}; -use diesel::dsl::sql; -use diesel::mysql::MysqlConnection; -use diesel::prelude::*; -use diesel::sql_types::Untyped; -use diesel::Connection; -use lazy_static::lazy_static; +use mysql::prelude::*; +use mysql::{Pool, PooledConn}; const URI_ENV: &str = "UDF_TEST_BACKEND_URI"; const DEFAULT_DATABASE_URI: &str = "mysql://root:example@0.0.0.0:12300/udf_tests"; -static INIT: Once = Once::new(); - -lazy_static! { - static ref SETUP_STATE: Mutex> = Mutex::new(HashSet::new()); -} +static POOL: OnceLock = OnceLock::new(); +static SETUP_STATE: OnceLock>> = OnceLock::new(); fn get_database_uri() -> String { match env::var(URI_ENV) { @@ -34,33 +27,54 @@ fn get_database_uri() -> String { } } -/// Ensure the init items have been run -pub fn get_db_connection(init: &[&str]) -> MysqlConnection { +fn build_pool() -> Pool { let db_url = get_database_uri(); - INIT.call_once(|| { - let mut conn = MysqlConnection::establish(db_url.rsplit_once('/').unwrap().0) - .expect("initial connection failed"); + { + // Ensure the database exists then reconnect + let (url, db) = db_url.rsplit_once('/').unwrap(); + let pool = Pool::new(url).expect("pool failed"); + let mut conn = pool.get_conn().expect("initial connection failed"); + + // Create default database + conn.query_drop(format!("CREATE OR REPLACE DATABASE {db}")) + .unwrap(); + } + + Pool::new(db_url.as_str()).expect("pool failed") +} - sql::("create or replace database udf_tests") - .execute(&mut conn) - .expect("could not create databases"); - }); +/// Ensures that init items have been run +pub fn get_db_connection(init: &[&str]) -> PooledConn { + let mut conn = POOL + .get_or_init(build_pool) + .get_conn() + .expect("failed to get conn"); - let hset = &mut *SETUP_STATE.lock().unwrap(); - let mut conn = MysqlConnection::establish(&db_url).expect("initial connection failed"); + let ran_stmts = &mut *SETUP_STATE + .get_or_init(|| Mutex::new(HashSet::new())) + .lock() + .unwrap(); // Store a list of our init calls so we don't repeat them for stmt in init { - if hset.contains(*stmt) { + if ran_stmts.contains(*stmt) { continue; } - sql::(stmt) - .execute(&mut conn) - .expect("could not run setup"); - hset.insert((*stmt).to_owned()); + conn.query_drop(stmt).expect("could not run setup"); + + ran_stmts.insert((*stmt).to_owned()); } conn } + +/// Check if two floats are within a tolerance. Also prints them for debugging. +#[allow(dead_code)] +pub fn approx_eq(a: f32, b: f32) -> bool { + const TOLERANCE: f32 = 0.001; + + println!("a: {a}, b: {b}"); + (a - b).abs() < TOLERANCE +} diff --git a/udf-examples/tests/is_const.rs b/udf-examples/tests/is_const.rs index 30608b8..cf20fd3 100644 --- a/udf-examples/tests/is_const.rs +++ b/udf-examples/tests/is_const.rs @@ -3,12 +3,9 @@ mod backend; use backend::get_db_connection; -use diesel::dsl::sql; -use diesel::prelude::*; -use diesel::result::Error as DieselError; -use diesel::sql_types::Text; +use mysql::prelude::*; -const SETUP: [&str; 3] = [ +const SETUP: &[&str] = &[ "create or replace function is_const returns string soname 'libudf_examples.so'", @@ -22,35 +19,34 @@ const SETUP: [&str; 3] = [ #[test] fn test_true() { - let conn = &mut get_db_connection(&SETUP); + let conn = &mut get_db_connection(SETUP); - let res: String = sql::("select is_const(1)") - .get_result(conn) - .expect("bad result"); + let res: String = conn.query_first("select is_const(1)").unwrap().unwrap(); assert_eq!(res, "const"); } #[test] fn test_false() { - let conn = &mut get_db_connection(&SETUP); + let conn = &mut get_db_connection(SETUP); - let res: String = sql::("select is_const(val) from test_is_const") - .get_result(conn) - .expect("bad result"); + let res: String = conn + .query_first("select is_const(val) from test_is_const") + .unwrap() + .unwrap(); assert_eq!(res, "not const"); } #[test] fn test_too_many_args() { - let conn = &mut get_db_connection(&SETUP); + let conn = &mut get_db_connection(SETUP); - let res = sql::("select is_const(1, 2)").get_result::(conn); + let res = conn.query_first::("select is_const(1, 2)"); - let Err(DieselError::DatabaseError(_, info)) = res else { + let Err(mysql::Error::MySqlError(e)) = res else { panic!("Got unexpected response: {res:?}"); }; - assert!(info.message().contains("only accepts one argument")); + assert!(e.message.contains("only accepts one argument")); } diff --git a/udf-examples/tests/lipsum.rs b/udf-examples/tests/lipsum.rs index 3b6bffa..703608d 100644 --- a/udf-examples/tests/lipsum.rs +++ b/udf-examples/tests/lipsum.rs @@ -3,43 +3,37 @@ mod backend; use backend::get_db_connection; -use diesel::dsl::sql; -use diesel::prelude::*; -use diesel::sql_types::{Nullable, Text}; +use mysql::prelude::*; -const SETUP: [&str; 1] = ["create or replace function lipsum +const SETUP: &[&str] = &["create or replace function lipsum returns string soname 'libudf_examples.so'"]; #[test] fn test_short() { - let conn = &mut get_db_connection(&SETUP); + let conn = &mut get_db_connection(SETUP); - let res: Option = sql::>("select lipsum(10)") - .get_result(conn) - .expect("bad result"); + let res: Option = conn.query_first("select lipsum(10)").unwrap().unwrap(); assert!(res.unwrap().split_whitespace().count() == 10); } #[test] fn test_short_seed() { - let conn = &mut get_db_connection(&SETUP); + let conn = &mut get_db_connection(SETUP); - let res: Option = sql::>("select lipsum(10, 12345)") - .get_result(conn) - .expect("bad result"); + let res: Option = conn + .query_first("select lipsum(10, 12345)") + .unwrap() + .unwrap(); assert!(res.unwrap().split_whitespace().count() == 10); } #[test] fn test_long() { - let conn = &mut get_db_connection(&SETUP); - - let res: Option = sql::>("select lipsum(5000)") - .get_result(conn) - .expect("bad result"); + let conn = &mut get_db_connection(SETUP); + let res: Option = conn.query_first("select lipsum(5000)").unwrap().unwrap(); assert!(res.unwrap().split_whitespace().count() == 5000); } diff --git a/udf-examples/tests/lookup.rs b/udf-examples/tests/lookup.rs index 09927b4..cca88ae 100644 --- a/udf-examples/tests/lookup.rs +++ b/udf-examples/tests/lookup.rs @@ -3,43 +3,44 @@ mod backend; use backend::get_db_connection; -use diesel::dsl::sql; -use diesel::prelude::*; -use diesel::sql_types::{Nullable, Text, Untyped}; +use mysql::prelude::*; -const SETUP: [&str; 1] = ["create or replace function lookup6 +const SETUP: &[&str] = &["create or replace function lookup6 returns string soname 'libudf_examples.so'"]; #[test] fn test_zeros() { - let conn = &mut get_db_connection(&SETUP); + let conn = &mut get_db_connection(SETUP); - let res: Option = sql::>("select lookup6('0.0.0.0')") - .get_result(conn) - .expect("bad result"); + let res: Option = conn + .query_first("select lookup6('0.0.0.0')") + .unwrap() + .unwrap(); assert_eq!(res.unwrap(), "::ffff:0.0.0.0"); } #[test] fn test_localhost() { - let conn = &mut get_db_connection(&SETUP); + let conn = &mut get_db_connection(SETUP); - let res: Option = sql::>("select lookup6('localhost')") - .get_result(conn) - .expect("bad result"); + let res: Option = conn + .query_first("select lookup6('localhost')") + .unwrap() + .unwrap(); assert_eq!(res.unwrap(), "::1"); } #[test] fn test_nonexistant() { - let conn = &mut get_db_connection(&SETUP); + let conn = &mut get_db_connection(SETUP); - let res: Option = sql::>("select lookup6('nonexistant')") - .get_result(conn) - .expect("bad result"); + let res: Option = conn + .query_first("select lookup6('nonexistant')") + .unwrap() + .unwrap(); assert!(res.is_none()); } @@ -49,15 +50,15 @@ fn test_sql_buffer_bug() { // This is intended to catch a buffer problem in mysql/mariadb // See link: https://github.com/pluots/sql-udf/issues/39 - let conn = &mut get_db_connection(&SETUP); + let conn = &mut get_db_connection(SETUP); - sql::("set @testval = (select lookup6('0.0.0.0'))") - .execute(conn) + conn.exec_drop("set @testval = (select lookup6('0.0.0.0'))", ()) .unwrap(); - let res: Option = sql::>("select regexp_replace(@testval,'[:.]','')") - .get_result(conn) - .expect("bad result"); + let res: Option = conn + .query_first("select regexp_replace(@testval,'[:.]','')") + .unwrap() + .unwrap(); assert_eq!(res.unwrap(), "ffff0000"); } diff --git a/udf-examples/tests/lookup.txt b/udf-examples/tests/lookup.txt deleted file mode 100644 index 12929e5..0000000 --- a/udf-examples/tests/lookup.txt +++ /dev/null @@ -1,23 +0,0 @@ -i >> CREATE FUNCTION lookup6 RETURNS string SONAME 'libudf_examples.so'; -i >> select lookup6('0.0.0.0'); -o >> - +--------------------+ - | lookup6('0.0.0.0') | - +--------------------+ - | ::ffff:0.0.0.0 | - +--------------------+ - {{}} -i >> select lookup6('localhost'); -o >> - +----------------------+ - | lookup6('localhost') | - +----------------------+ - | ::1 | - +----------------------+ -i >> select lookup6('fake'); -o >> - +-----------------+ - | lookup6('fake') | - +-----------------+ - | NULL | - +-----------------+ diff --git a/udf-examples/tests/median.rs b/udf-examples/tests/median.rs index 3c397b7..121c500 100644 --- a/udf-examples/tests/median.rs +++ b/udf-examples/tests/median.rs @@ -3,29 +3,28 @@ mod backend; use backend::get_db_connection; -use diesel::dsl::sql; -use diesel::prelude::*; -use diesel::sql_types::Integer; +use mysql::prelude::*; -const SETUP: [&str; 3] = [ - "create or replace aggregate function udf_median - returns integer - soname 'libudf_examples.so'", - "create or replace table test_median ( +const SETUP: &[&str] = &[ + "CREATE OR REPLACE AGGREGATE FUNCTION udf_median + RETURNS integer + SONAME 'libudf_examples.so'", + "CREATE OR REPLACE TABLE test_median ( id int auto_increment, val int, primary key (id) )", - "insert into test_median (val) values (2), (1), (3), (4), (-3), (7), (-1)", + "INSERT INTO test_median (val) VALUES (2), (1), (3), (4), (-3), (7), (-1)", ]; #[test] fn test_empty() { - let conn = &mut get_db_connection(&SETUP); + let conn = &mut get_db_connection(SETUP); - let res: i32 = sql::("select udf_median(val) from test_median") - .get_result(conn) - .expect("bad result"); + let res: i32 = conn + .query_first("select udf_median(val) from test_median") + .unwrap() + .unwrap(); assert_eq!(res, 2); } diff --git a/udf-examples/tests/mishmash.rs b/udf-examples/tests/mishmash.rs index 3631db3..6428b1c 100644 --- a/udf-examples/tests/mishmash.rs +++ b/udf-examples/tests/mishmash.rs @@ -3,44 +3,41 @@ mod backend; use backend::get_db_connection; -use diesel::dsl::sql; -use diesel::prelude::*; -use diesel::sql_types::{Binary, Nullable}; +use mysql::prelude::*; -const SETUP: [&str; 1] = ["create or replace function mishmash +const SETUP: &[&str] = &["create or replace function mishmash returns string soname 'libudf_examples.so'"]; #[test] fn test_empty() { - let conn = &mut get_db_connection(&SETUP); + let conn = &mut get_db_connection(SETUP); - let res: Option> = sql::>("select mishmash()") - .get_result(conn) - .expect("bad result"); + let res: Option> = conn.query_first("select mishmash()").unwrap().unwrap(); assert!(res.is_none()); } #[test] fn test_single() { - let conn = &mut get_db_connection(&SETUP); + let conn = &mut get_db_connection(SETUP); - let res: Option> = sql::>("select mishmash('banana')") - .get_result(conn) - .expect("bad result"); + let res: Option> = conn + .query_first("select mishmash('banana')") + .unwrap() + .unwrap(); assert_eq!(res.unwrap(), b"banana"); } #[test] fn test_many() { - let conn = &mut get_db_connection(&SETUP); + let conn = &mut get_db_connection(SETUP); - let res: Option> = - sql::>("select mishmash('banana', 'is', 'a', 'fruit')") - .get_result(conn) - .expect("bad result"); + let res: Option> = conn + .query_first("select mishmash('banana', 'is', 'a', 'fruit')") + .unwrap() + .unwrap(); assert_eq!(res.unwrap(), b"bananaisafruit"); } diff --git a/udf-examples/tests/sequence.rs b/udf-examples/tests/sequence.rs index 8e83d5b..ef5a63b 100644 --- a/udf-examples/tests/sequence.rs +++ b/udf-examples/tests/sequence.rs @@ -3,66 +3,59 @@ mod backend; use backend::get_db_connection; -use diesel::dsl::sql; -use diesel::prelude::*; -use diesel::sql_types::Integer; - -const SETUP: [&str; 3] = [ - "create or replace function udf_sequence - returns integer - soname 'libudf_examples.so'", - "create or replace table test_seq ( +use mysql::prelude::*; + +const SETUP: &[&str] = &[ + "CREATE OR REPLACE FUNCTION udf_sequence + RETURNS integer + SONAME 'libudf_examples.so'", + "CREATE OR REPLACE TABLE test_seq ( id int )", - "insert into test_seq (id) values (1), (2), (3), (4), (5), (6)", + "INSERT INTO test_seq (id) VALUES (1), (2), (3), (4), (5), (6)", ]; #[test] fn test_single() { - let conn = &mut get_db_connection(&SETUP); + let conn = &mut get_db_connection(SETUP); // First result should be 1 - let res: i32 = sql::("select udf_sequence()") - .get_result(conn) - .expect("bad result"); + let res: i32 = conn.query_first("select udf_sequence()").unwrap().unwrap(); assert_eq!(res, 1); } #[test] fn test_offset() { - let conn = &mut get_db_connection(&SETUP); + let conn = &mut get_db_connection(SETUP); // With argument specified, we should have one more than the // specified value - let res: i32 = sql::("select udf_sequence(4)") - .get_result(conn) - .expect("bad result"); + let res: i32 = conn.query_first("select udf_sequence(4)").unwrap().unwrap(); assert_eq!(res, 5); } #[test] fn test_incrementing() { - let conn = &mut get_db_connection(&SETUP); + let conn = &mut get_db_connection(SETUP); // Test results with multiple rows - let res: Vec<(i32, i32)> = sql::<(Integer, Integer)>("select id, udf_sequence() from test_seq") - .get_results(conn) - .expect("bad result"); + let res: Vec<(i32, i32)> = conn + .query("select id, udf_sequence() from test_seq") + .unwrap(); assert_eq!(res, vec![(1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6)]); } #[test] fn test_incrementing_offset() { - let conn = &mut get_db_connection(&SETUP); + let conn = &mut get_db_connection(SETUP); // Test results with multiple rows - let res: Vec<(i32, i32)> = - sql::<(Integer, Integer)>("select id, udf_sequence(10) from test_seq") - .get_results(conn) - .expect("bad result"); + let res: Vec<(i32, i32)> = conn + .query("select id, udf_sequence(10) from test_seq") + .unwrap(); assert_eq!( res, @@ -72,13 +65,12 @@ fn test_incrementing_offset() { #[test] fn test_incrementing_offset_negative() { - let conn = &mut get_db_connection(&SETUP); + let conn = &mut get_db_connection(SETUP); // Test results with multiple rows - let res: Vec<(i32, i32)> = - sql::<(Integer, Integer)>("select id, udf_sequence(-2) from test_seq") - .get_results(conn) - .expect("bad result"); + let res: Vec<(i32, i32)> = conn + .query("select id, udf_sequence(-2) from test_seq") + .unwrap(); assert_eq!(res, vec![(1, -1), (2, 0), (3, 1), (4, 2), (5, 3), (6, 4)]); } diff --git a/udf-examples/tests/sequence.txt b/udf-examples/tests/sequence.txt deleted file mode 100644 index 1733b22..0000000 --- a/udf-examples/tests/sequence.txt +++ /dev/null @@ -1,68 +0,0 @@ -setup: -create database db0; - -use db0; - -create table t1 ( - id int auto_increment, - primary key (id) -); - -insert into t1 () values (); -insert into t1 () values (); -insert into t1 () values (); -insert into t1 () values (); -insert into t1 () values (); -insert into t1 () values (); - -test -MariaDB [db0]> select udf_sequence(); -+----------------+ -| udf_sequence() | -+----------------+ -| 1 | -+----------------+ - -MariaDB [db0]> select udf_sequence(1); -+-----------------+ -| udf_sequence(1) | -+-----------------+ -| 2 | -+-----------------+ -1 row in set (0.000 sec) - -MariaDB [db0]> select id, udf_sequence() from t1; -+----+----------------+ -| id | udf_sequence() | -+----+----------------+ -| 1 | 1 | -| 2 | 2 | -| 3 | 3 | -| 4 | 4 | -| 5 | 5 | -| 6 | 6 | -+----+----------------+ - -MariaDB [db0]> select id, udf_sequence(10) from t1; -+----+------------------+ -| id | udf_sequence(10) | -+----+------------------+ -| 1 | 11 | -| 2 | 12 | -| 3 | 13 | -| 4 | 14 | -| 5 | 15 | -| 6 | 16 | -+----+------------------+ - -MariaDB [db0]> select id, udf_sequence(-1) from t1; -+----+------------------+ -| id | udf_sequence(-1) | -+----+------------------+ -| 1 | 0 | -| 2 | 1 | -| 3 | 2 | -| 4 | 3 | -| 5 | 4 | -| 6 | 5 | -+----+------------------+ diff --git a/udf-examples/tests/sum_int.rs b/udf-examples/tests/sum_int.rs index 7f74180..c539e23 100644 --- a/udf-examples/tests/sum_int.rs +++ b/udf-examples/tests/sum_int.rs @@ -3,43 +3,41 @@ mod backend; use backend::get_db_connection; -use diesel::dsl::sql; -use diesel::prelude::*; -use diesel::sql_types::Integer; +use mysql::prelude::*; -const SETUP: [&str; 1] = ["create or replace function sum_int +const SETUP: &[&str] = &["create or replace function sum_int returns integer soname 'libudf_examples.so'"]; #[test] fn test_empty() { - let conn = &mut get_db_connection(&SETUP); + let conn = &mut get_db_connection(SETUP); - let res: i32 = sql::("select sum_int()") - .get_result(conn) - .expect("bad result"); + let res: i32 = conn.query_first("select sum_int()").unwrap().unwrap(); assert_eq!(res, 0); } #[test] fn test_basic() { - let conn = &mut get_db_connection(&SETUP); + let conn = &mut get_db_connection(SETUP); - let res: i32 = sql::("select sum_int(1, 2, 3, 4, -6)") - .get_result(conn) - .expect("bad result"); + let res: i32 = conn + .query_first("select sum_int(1, 2, 3, 4, -6)") + .unwrap() + .unwrap(); assert_eq!(res, 4); } #[test] fn test_coercion() { - let conn = &mut get_db_connection(&SETUP); + let conn = &mut get_db_connection(SETUP); - let res: i32 = sql::("select sum_int(1, 2, '-5', '11')") - .get_result(conn) - .expect("bad result"); + let res: i32 = conn + .query_first("select sum_int(1, 2, '-5', '11')") + .unwrap() + .unwrap(); assert_eq!(res, 9); } diff --git a/udf-examples/tests/sum_int.txt b/udf-examples/tests/sum_int.txt deleted file mode 100644 index 641125d..0000000 --- a/udf-examples/tests/sum_int.txt +++ /dev/null @@ -1,16 +0,0 @@ -# Simple file format: inputs start with `I >>`. If you care about the output, -# `O >>` can be specified. These symbols must be at the beginning of a line -# `E >>` for stderr -# {{info}} matches either -! >> lang=sql -! >> - -i >> CREATE FUNCTION sum_int RETURNS integer SONAME 'libudf_examples.so'; -i >> select sum_int(1, 2, 3); -o >> - +------------------+ - | sum_int(1, 2, 3) | - +------------------+ - | 6 | - +------------------+ - {{info}}