diff --git a/Cargo.lock b/Cargo.lock index 62c2361b..905832ee 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10,7 +10,7 @@ checksum = "f728064aca1c318585bf4bb04ffcfac9e75e508ab4e8b1bd9ba5dfe04e2cbed5" dependencies = [ "actix-rt", "actix_derive", - "bitflags", + "bitflags 1.3.2", "bytes", "crossbeam-channel", "futures-core", @@ -19,7 +19,7 @@ dependencies = [ "futures-util", "log", "once_cell", - "parking_lot 0.12.1", + "parking_lot", "pin-project-lite", "smallvec", "tokio", @@ -44,7 +44,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "617a8268e3537fe1d8c9ead925fca49ef6400927ee7bc26750e90ecee14ce4b8" dependencies = [ - "bitflags", + "bitflags 1.3.2", "bytes", "futures-core", "futures-sink", @@ -82,7 +82,7 @@ dependencies = [ "actix-utils", "ahash 0.8.3", "base64 0.21.2", - "bitflags", + "bitflags 1.3.2", "brotli", "bytes", "bytestring", @@ -121,7 +121,7 @@ dependencies = [ "futures-util", "serde", "serde_json", - "time 0.3.22", + "time", ] [[package]] @@ -251,7 +251,7 @@ dependencies = [ "serde_urlencoded", "smallvec", "socket2", - "time 0.3.22", + "time", "url", ] @@ -386,6 +386,12 @@ dependencies = [ "alloc-no-stdlib", ] +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + [[package]] name = "ammonia" version = "3.3.0" @@ -411,7 +417,7 @@ version = "0.2.2" source = "git+https://github.com/realaravinth/argon2-creds?branch=master#9f43fd564448cae609d148a700de91e2aea6474c" dependencies = [ "ammonia", - "derive_builder", + "derive_builder 0.11.1", "derive_more", "lazy_static", "rand", @@ -446,9 +452,9 @@ dependencies = [ [[package]] name = "atoi" -version = "0.4.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "616896e05fc0e2649463a93a15183c6a16bf03413a7af88ef1285ddedfa9cda5" +checksum = "f28d99ec8bfea296261ca1af174f24225171fea9664ba9003cbebee704810528" dependencies = [ "num-traits", ] @@ -519,12 +525,6 @@ dependencies = [ "rustc-demangle", ] -[[package]] -name = "base-x" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" - [[package]] name = "base64" version = "0.13.1" @@ -564,6 +564,15 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +dependencies = [ + "serde", +] + [[package]] name = "blake2b_simd" version = "1.0.1" @@ -638,7 +647,7 @@ version = "0.2.0" source = "git+https://github.com/realaravinth/cache-buster#7ca4545722fb99be30698a5e72c7d982a70fa11f" dependencies = [ "data-encoding", - "derive_builder", + "derive_builder 0.11.1", "mime", "mime_guess", "serde", @@ -707,15 +716,9 @@ dependencies = [ [[package]] name = "const-oid" -version = "0.7.1" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4c78c047431fee22c1a7bb92e00ad095a02a983affe4d8a72e2a2c62c1b94f3" - -[[package]] -name = "const_fn" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbdcdcb6d86f71c5e97409ad45898af11cbc995b4ee8112d59095a28d376c935" +checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" [[package]] name = "constant_time_eq" @@ -749,7 +752,7 @@ dependencies = [ "rand", "sha2", "subtle", - "time 0.3.22", + "time", "version_check", ] @@ -780,18 +783,18 @@ dependencies = [ [[package]] name = "crc" -version = "2.1.0" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49fc9a695bca7f35f5f4c15cddc84415f66a74ea78eef08e90c5024f2b540e23" +checksum = "86ec7a15cbe22e59248fc7eadb1907dab5ba09372595da4d73dd805ed4417dfe" dependencies = [ "crc-catalog", ] [[package]] name = "crc-catalog" -version = "1.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccaeedb56da03b09f598226e25e80088cb4cd25f316e6e4df7d695f0feeb1403" +checksum = "9cace84e55f07e7301bae1c519df89cdad8cc3cd868413d3fdbdeca9ff3db484" [[package]] name = "crc16" @@ -837,16 +840,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "crypto-bigint" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03c6a1d5fa1de37e071642dfa44ec552ca5b299adb128fab16138e24b548fd21" -dependencies = [ - "generic-array", - "subtle", -] - [[package]] name = "crypto-common" version = "0.1.6" @@ -873,8 +866,18 @@ version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f2c43f534ea4b0b049015d00269734195e6d3f0f6635cb692251aca6f9f8b3c" dependencies = [ - "darling_core", - "darling_macro", + "darling_core 0.12.4", + "darling_macro 0.12.4", +] + +[[package]] +name = "darling" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" +dependencies = [ + "darling_core 0.14.4", + "darling_macro 0.14.4", ] [[package]] @@ -891,13 +894,38 @@ dependencies = [ "syn 1.0.94", ] +[[package]] +name = "darling_core" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 1.0.94", +] + [[package]] name = "darling_macro" version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "29b5acf0dea37a7f66f7b25d2c5e93fd46f8f6968b1a5d7a3e02e97768afc95a" dependencies = [ - "darling_core", + "darling_core 0.12.4", + "quote", + "syn 1.0.94", +] + +[[package]] +name = "darling_macro" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" +dependencies = [ + "darling_core 0.14.4", "quote", "syn 1.0.94", ] @@ -948,13 +976,13 @@ dependencies = [ [[package]] name = "der" -version = "0.5.1" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6919815d73839e7ad218de758883aae3a257ba6759ce7a9992501efbb53d705c" +checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" dependencies = [ "const-oid", - "crypto-bigint", "pem-rfc7468", + "zeroize", ] [[package]] @@ -963,7 +991,16 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "11d918e7dabe374a51dae0f29d818fece3b218b8b4eabec3bc4d42c537e7ed8f" dependencies = [ - "derive_builder_macro", + "derive_builder_macro 0.11.1", +] + +[[package]] +name = "derive_builder" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d67778784b508018359cbc8696edb3db78160bab2c2a28ba7f56ef6932997f8" +dependencies = [ + "derive_builder_macro 0.12.0", ] [[package]] @@ -972,7 +1009,19 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f712c2d4e52d5fcae53584e461dcb92fb2202e144ebf83ab0ba4360d18b767c7" dependencies = [ - "darling", + "darling 0.12.4", + "proc-macro2", + "quote", + "syn 1.0.94", +] + +[[package]] +name = "derive_builder_core" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c11bdc11a0c47bc7d37d582b5285da6849c96681023680b906673c5707af7b0f" +dependencies = [ + "darling 0.14.4", "proc-macro2", "quote", "syn 1.0.94", @@ -984,7 +1033,17 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8a2ac71b4a9a590dde6cee3ca4687aca5e7ce06f4ee297c5a959de5f1e42b2e" dependencies = [ - "derive_builder_core", + "derive_builder_core 0.11.1", + "syn 1.0.94", +] + +[[package]] +name = "derive_builder_macro" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebcda35c7a396850a55ffeac740804b40ffec779b98fffbb1738f4033f0ee79e" +dependencies = [ + "derive_builder_core 0.12.0", "syn 1.0.94", ] @@ -997,7 +1056,7 @@ dependencies = [ "convert_case", "proc-macro2", "quote", - "rustc_version 0.4.0", + "rustc_version", "syn 1.0.94", ] @@ -1008,36 +1067,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer", + "const-oid", "crypto-common", "subtle", ] -[[package]] -name = "dirs" -version = "4.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" -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 = "discard" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0" - [[package]] name = "dlv-list" version = "0.3.0" @@ -1045,10 +1079,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0688c2a7f92e427f44895cd63841bff7b29f8d7a1648b9e7e07a4a365b2e1257" [[package]] -name = "dotenv" -version = "0.15.0" +name = "dotenvy" +version = "0.15.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" +checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" [[package]] name = "either" @@ -1124,6 +1158,17 @@ dependencies = [ "libc", ] +[[package]] +name = "etcetera" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "136d1b5283a1ab77bd9257427ffd09d8667ced0570b6f938942bc7568ed5b943" +dependencies = [ + "cfg-if", + "home", + "windows-sys 0.48.0", +] + [[package]] name = "event-listener" version = "2.5.3" @@ -1161,6 +1206,17 @@ dependencies = [ "miniz_oxide", ] +[[package]] +name = "flume" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55ac459de2512911e4b674ce33cf20befaba382d05b62b008afc1c8b57cbf181" +dependencies = [ + "futures-core", + "futures-sink", + "spin 0.9.8", +] + [[package]] name = "fnv" version = "1.0.7" @@ -1245,13 +1301,13 @@ dependencies = [ [[package]] name = "futures-intrusive" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a604f7a68fbf8103337523b1fadc8ade7361ee3f112f7c680ad179651616aed5" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" dependencies = [ "futures-core", "lock_api", - "parking_lot 0.11.2", + "parking_lot", ] [[package]] @@ -1357,15 +1413,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "hashbrown" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" -dependencies = [ - "ahash 0.7.6", -] - [[package]] name = "hashbrown" version = "0.12.3" @@ -1380,14 +1427,18 @@ name = "hashbrown" version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12" +dependencies = [ + "ahash 0.8.3", + "allocator-api2", +] [[package]] name = "hashlink" -version = "0.7.0" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7249a3129cbc1ffccd74857f81464a323a152173cdb134e0fd81bc803b29facf" +checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" dependencies = [ - "hashbrown 0.11.2", + "hashbrown 0.14.1", ] [[package]] @@ -1598,9 +1649,9 @@ dependencies = [ [[package]] name = "itertools" -version = "0.10.5" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" dependencies = [ "either", ] @@ -1658,7 +1709,7 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" dependencies = [ - "spin", + "spin 0.5.2", ] [[package]] @@ -1706,11 +1757,11 @@ source = "git+https://github.com/mCaptcha/libmcaptcha?tag=0.2.3#6bc0d11f8839d18c dependencies = [ "actix", "crossbeam-channel", - "derive_builder", + "derive_builder 0.11.1", "derive_more", "log", "num_cpus", - "pow_sha256 0.3.1 (git+https://github.com/mcaptcha/pow_sha256)", + "pow_sha256", "pretty_env_logger", "rand", "redis", @@ -1719,6 +1770,17 @@ dependencies = [ "tokio", ] +[[package]] +name = "libsqlite3-sys" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afc22eff61b133b115c6e8c74e818c628d6d5e7a502afea6f64dee076dd94326" +dependencies = [ + "cc", + "pkg-config", + "vcpkg", +] + [[package]] name = "linked-hash-map" version = "0.5.6" @@ -1824,18 +1886,18 @@ dependencies = [ "db-core", "db-sqlx-maria", "db-sqlx-postgres", - "derive_builder", + "derive_builder 0.11.1", "derive_more", "futures", "lazy_static", "lettre", "libmcaptcha", "log", + "mcaptcha_pow_sha256", "mime", "mime_guess", "num_cpus", "openssl", - "pow_sha256 0.3.1 (git+https://github.com/mcaptcha/pow_sha256?tag=0.3.1)", "pretty_env_logger", "rand", "rust-embed", @@ -1850,6 +1912,19 @@ dependencies = [ "validator", ] +[[package]] +name = "mcaptcha_pow_sha256" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da77f893cceca2fb8f47064749c8a12013a71a56a1c97adc975bf6b053d4bd51" +dependencies = [ + "bincode", + "derive_builder 0.12.0", + "num", + "serde", + "sha2", +] + [[package]] name = "md-5" version = "0.10.5" @@ -1948,7 +2023,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43db66d1170d347f9a065114077f7dccb00c1b9478c89384490a3425279a4606" dependencies = [ - "num-bigint 0.4.3", + "num-bigint", "num-complex", "num-integer", "num-iter", @@ -1956,17 +2031,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "num-bigint" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f6f7833f2cbf2360a6cfd58cd41a53aa7a90bd4c202f5b1c7dd2ed73c57b2c3" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - [[package]] name = "num-bigint" version = "0.4.3" @@ -2086,7 +2150,7 @@ version = "0.10.55" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "345df152bc43501c5eb9e4654ff05f794effb78d4efe3d53abc158baddc0703d" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cfg-if", "foreign-types", "libc", @@ -2144,17 +2208,6 @@ dependencies = [ "hashbrown 0.12.3", ] -[[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" @@ -2162,21 +2215,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", - "parking_lot_core 0.9.8", -] - -[[package]] -name = "parking_lot_core" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" -dependencies = [ - "cfg-if", - "instant", - "libc", - "redox_syscall 0.2.16", - "smallvec", - "winapi", + "parking_lot_core", ] [[package]] @@ -2206,9 +2245,9 @@ checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" [[package]] name = "pem-rfc7468" -version = "0.3.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01de5d978f34aa4b2296576379fcc416034702fd94117c56ffd8a1a767cefb30" +checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" dependencies = [ "base64ct", ] @@ -2316,24 +2355,23 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkcs1" -version = "0.3.3" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a78f66c04ccc83dd4486fd46c33896f4e17b24a7a3a6400dedc48ed0ddd72320" +checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f" dependencies = [ "der", "pkcs8", - "zeroize", + "spki", ] [[package]] name = "pkcs8" -version = "0.8.0" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cabda3fb821068a9a4fab19a683eac3af12edf0f34b94a8be53c4972b8149d0" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ "der", "spki", - "zeroize", ] [[package]] @@ -2354,25 +2392,13 @@ dependencies = [ "universal-hash", ] -[[package]] -name = "pow_sha256" -version = "0.3.1" -source = "git+https://github.com/mcaptcha/pow_sha256?tag=0.3.1#3b4e28706a8946987ba02f98e1f816d9fa156dad" -dependencies = [ - "bincode", - "derive_builder", - "num", - "serde", - "sha2", -] - [[package]] name = "pow_sha256" version = "0.3.1" source = "git+https://github.com/mcaptcha/pow_sha256#148f1cb70d19114d1340661a77b2b679e95715f6" dependencies = [ "bincode", - "derive_builder", + "derive_builder 0.11.1", "num", "serde", "sha2", @@ -2424,12 +2450,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "proc-macro-hack" -version = "0.5.20+deprecated" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" - [[package]] name = "proc-macro2" version = "1.0.69" @@ -2467,7 +2487,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51de85fb3fb6524929c8a2eb85e6b6d363de4e8c48f9e2c2eac4944abc181c93" dependencies = [ "log", - "parking_lot 0.12.1", + "parking_lot", "scheduled-thread-pool", ] @@ -2532,7 +2552,7 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] @@ -2541,18 +2561,7 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" dependencies = [ - "bitflags", -] - -[[package]] -name = "redox_users" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" -dependencies = [ - "getrandom", - "redox_syscall 0.2.16", - "thiserror", + "bitflags 1.3.2", ] [[package]] @@ -2581,7 +2590,7 @@ dependencies = [ "cc", "libc", "once_cell", - "spin", + "spin 0.5.2", "untrusted", "web-sys", "winapi", @@ -2594,17 +2603,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "88073939a61e5b7680558e6be56b419e208420c2adb92be54921fa6b72283f1a" dependencies = [ "base64 0.13.1", - "bitflags", + "bitflags 1.3.2", "serde", ] [[package]] name = "rsa" -version = "0.6.1" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cf22754c49613d2b3b119f0e5d46e34a2c628a937e3024b8762de4e7d8c710b" +checksum = "6ab43bb47d23c1a631b4b680199a45255dce26fa9ab2fa902581f624ff13e6a8" dependencies = [ "byteorder", + "const-oid", "digest", "num-bigint-dig", "num-integer", @@ -2613,7 +2623,8 @@ dependencies = [ "pkcs1", "pkcs8", "rand_core", - "smallvec", + "signature", + "spki", "subtle", "zeroize", ] @@ -2680,22 +2691,13 @@ version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" -[[package]] -name = "rustc_version" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -dependencies = [ - "semver 0.9.0", -] - [[package]] name = "rustc_version" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.17", + "semver", ] [[package]] @@ -2704,7 +2706,7 @@ version = "0.37.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62f25693a73057a1b4cb56179dd3c7ea21a7c6c5ee7d85781f5749b46f34b79c" dependencies = [ - "bitflags", + "bitflags 1.3.2", "errno", "io-lifetimes", "libc", @@ -2714,15 +2716,32 @@ dependencies = [ [[package]] name = "rustls" -version = "0.19.1" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" +checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" dependencies = [ - "base64 0.13.1", - "log", "ring", + "rustls-webpki", "sct", - "webpki", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" +dependencies = [ + "base64 0.21.2", +] + +[[package]] +name = "rustls-webpki" +version = "0.101.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c7d5dece342910d9ba34d259310cae3e0154b873b35408b787b59bce53d34fe" +dependencies = [ + "ring", + "untrusted", ] [[package]] @@ -2793,7 +2812,7 @@ version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3cbc66816425a074528352f5789333ecff06ca41b36b0b0efdfbb29edc391a19" dependencies = [ - "parking_lot 0.12.1", + "parking_lot", ] [[package]] @@ -2804,9 +2823,9 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "sct" -version = "0.6.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" +checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" dependencies = [ "ring", "untrusted", @@ -2818,7 +2837,7 @@ version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fc758eb7bffce5b308734e9b0c1468893cae9ff70ebf13e7090be8dcbcc83a8" dependencies = [ - "bitflags", + "bitflags 1.3.2", "core-foundation", "core-foundation-sys", "libc", @@ -2835,27 +2854,12 @@ dependencies = [ "libc", ] -[[package]] -name = "semver" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -dependencies = [ - "semver-parser", -] - [[package]] name = "semver" version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" -[[package]] -name = "semver-parser" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" - [[package]] name = "serde" version = "1.0.147" @@ -2908,17 +2912,6 @@ dependencies = [ "serde", ] -[[package]] -name = "sha-1" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5058ada175748e33390e40e872bd0fe59a19f265d0158daa551c5a88a76009c" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - [[package]] name = "sha1" version = "0.6.1" @@ -2965,6 +2958,16 @@ dependencies = [ "libc", ] +[[package]] +name = "signature" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" +dependencies = [ + "digest", + "rand_core", +] + [[package]] name = "siphasher" version = "0.3.10" @@ -3003,10 +3006,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] -name = "spki" -version = "0.5.4" +name = "spin" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d01ac02a6ccf3e07db148d2be087da624fea0221a16152ed01f0496a6b0a27" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] + +[[package]] +name = "spki" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" dependencies = [ "base64ct", "der", @@ -3014,9 +3026,9 @@ dependencies = [ [[package]] name = "sqlformat" -version = "0.1.8" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4b7922be017ee70900be125523f38bdd644f4f06a1b16e8fa5a8ee8c34bffd4" +checksum = "6b7b278788e7be4d0d29c0f39497a0eef3fba6bbc8e70d8bf7fde46edeaa9e85" dependencies = [ "itertools", "nom", @@ -3025,78 +3037,81 @@ dependencies = [ [[package]] name = "sqlx" -version = "0.5.13" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "551873805652ba0d912fec5bbb0f8b4cdd96baf8e2ebf5970e5671092966019b" +checksum = "0e50c216e3624ec8e7ecd14c6a6a6370aad6ee5d8cfc3ab30b5162eeeef2ed33" dependencies = [ "sqlx-core", "sqlx-macros", + "sqlx-mysql", + "sqlx-postgres", + "sqlx-sqlite", ] [[package]] name = "sqlx-core" -version = "0.5.13" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e48c61941ccf5ddcada342cd59e3e5173b007c509e1e8e990dafc830294d9dc5" +checksum = "8d6753e460c998bbd4cd8c6f0ed9a64346fcca0723d6e75e52fdc351c5d2169d" dependencies = [ - "ahash 0.7.6", + "ahash 0.8.3", "atoi", - "base64 0.13.1", - "bitflags", "byteorder", "bytes", "crc", "crossbeam-queue", - "digest", - "dirs", + "dotenvy", "either", "event-listener", "futures-channel", "futures-core", "futures-intrusive", + "futures-io", "futures-util", - "generic-array", "hashlink", "hex", - "hkdf", - "hmac", - "indexmap 1.9.3", - "itoa", - "libc", + "indexmap 2.0.2", "log", - "md-5", "memchr", - "num-bigint 0.3.3", "once_cell", "paste", "percent-encoding", - "rand", - "rsa", "rustls", + "rustls-pemfile", "serde", "serde_json", - "sha-1", "sha2", "smallvec", "sqlformat", - "sqlx-rt", - "stringprep", "thiserror", - "time 0.2.27", + "time", + "tokio", "tokio-stream", + "tracing", "url", - "webpki", "webpki-roots", - "whoami", ] [[package]] name = "sqlx-macros" -version = "0.5.13" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc0fba2b0cae21fc00fe6046f8baa4c7fcb49e379f0f592b04696607f69ed2e1" +checksum = "9a793bb3ba331ec8359c1853bd39eed32cdd7baaf22c35ccf5c92a7e8d1189ec" dependencies = [ - "dotenv", + "proc-macro2", + "quote", + "sqlx-core", + "sqlx-macros-core", + "syn 1.0.94", +] + +[[package]] +name = "sqlx-macros-core" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a4ee1e104e00dedb6aa5ffdd1343107b0a4702e862a84320ee7cc74782d96fc" +dependencies = [ + "dotenvy", "either", "heck", "hex", @@ -3107,80 +3122,120 @@ dependencies = [ "serde_json", "sha2", "sqlx-core", - "sqlx-rt", + "sqlx-mysql", + "sqlx-postgres", + "sqlx-sqlite", "syn 1.0.94", + "tempfile", + "tokio", "url", ] [[package]] -name = "sqlx-rt" -version = "0.5.13" +name = "sqlx-mysql" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4db708cd3e459078f85f39f96a00960bd841f66ee2a669e90bf36907f5a79aae" +checksum = "864b869fdf56263f4c95c45483191ea0af340f9f3e3e7b4d57a61c7c87a970db" dependencies = [ - "actix-rt", + "atoi", + "base64 0.21.2", + "bitflags 2.4.1", + "byteorder", + "bytes", + "crc", + "digest", + "dotenvy", + "either", + "futures-channel", + "futures-core", + "futures-io", + "futures-util", + "generic-array", + "hex", + "hkdf", + "hmac", + "itoa", + "log", + "md-5", + "memchr", "once_cell", - "tokio", - "tokio-rustls", -] - -[[package]] -name = "standback" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e113fb6f3de07a243d434a56ec6f186dfd51cb08448239fe7bcae73f87ff28ff" -dependencies = [ - "version_check", -] - -[[package]] -name = "stdweb" -version = "0.4.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d022496b16281348b52d0e30ae99e01a73d737b2f45d38fed4edf79f9325a1d5" -dependencies = [ - "discard", - "rustc_version 0.2.3", - "stdweb-derive", - "stdweb-internal-macros", - "stdweb-internal-runtime", - "wasm-bindgen", -] - -[[package]] -name = "stdweb-derive" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef" -dependencies = [ - "proc-macro2", - "quote", + "percent-encoding", + "rand", + "rsa", "serde", - "serde_derive", - "syn 1.0.94", + "sha1 0.10.5", + "sha2", + "smallvec", + "sqlx-core", + "stringprep", + "thiserror", + "time", + "tracing", + "whoami", ] [[package]] -name = "stdweb-internal-macros" -version = "0.2.9" +name = "sqlx-postgres" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58fa5ff6ad0d98d1ffa8cb115892b6e69d67799f6763e162a1c9db421dc22e11" +checksum = "eb7ae0e6a97fb3ba33b23ac2671a5ce6e3cabe003f451abd5a56e7951d975624" dependencies = [ - "base-x", - "proc-macro2", - "quote", + "atoi", + "base64 0.21.2", + "bitflags 2.4.1", + "byteorder", + "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_derive", "serde_json", - "sha1 0.6.1", - "syn 1.0.94", + "sha1 0.10.5", + "sha2", + "smallvec", + "sqlx-core", + "stringprep", + "thiserror", + "time", + "tracing", + "whoami", ] [[package]] -name = "stdweb-internal-runtime" -version = "0.1.5" +name = "sqlx-sqlite" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213701ba3370744dcd1a12960caa4843b3d68b4d1c0a5d575e0d65b2ee9d16c0" +checksum = "d59dc83cf45d89c555a577694534fcd1b55c545a816c816ce51f20bbe56a4f3f" +dependencies = [ + "atoi", + "flume", + "futures-channel", + "futures-core", + "futures-executor", + "futures-intrusive", + "futures-util", + "libsqlite3-sys", + "log", + "percent-encoding", + "serde", + "sqlx-core", + "time", + "tracing", + "url", +] [[package]] name = "string_cache" @@ -3190,7 +3245,7 @@ checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b" dependencies = [ "new_debug_unreachable", "once_cell", - "parking_lot 0.12.1", + "parking_lot", "phf_shared", "precomputed-hash", "serde", @@ -3306,21 +3361,6 @@ dependencies = [ "syn 1.0.94", ] -[[package]] -name = "time" -version = "0.2.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4752a97f8eebd6854ff91f1c1824cd6160626ac4bd44287f7f4ea2035a02a242" -dependencies = [ - "const_fn", - "libc", - "standback", - "stdweb", - "time-macros 0.1.1", - "version_check", - "winapi", -] - [[package]] name = "time" version = "0.3.22" @@ -3330,7 +3370,7 @@ dependencies = [ "itoa", "serde", "time-core", - "time-macros 0.2.9", + "time-macros", ] [[package]] @@ -3339,16 +3379,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" -[[package]] -name = "time-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "957e9c6e26f12cb6d0dd7fc776bb67a706312e7299aed74c8dd5b17ebb27e2f1" -dependencies = [ - "proc-macro-hack", - "time-macros-impl", -] - [[package]] name = "time-macros" version = "0.2.9" @@ -3358,19 +3388,6 @@ dependencies = [ "time-core", ] -[[package]] -name = "time-macros-impl" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd3c141a1b43194f3f56a1411225df8646c55781d5f26db825b3d98507eb482f" -dependencies = [ - "proc-macro-hack", - "proc-macro2", - "quote", - "standback", - "syn 1.0.94", -] - [[package]] name = "tinyvec" version = "1.6.0" @@ -3397,8 +3414,7 @@ dependencies = [ "bytes", "libc", "mio", - "num_cpus", - "parking_lot 0.12.1", + "parking_lot", "pin-project-lite", "signal-hook-registry", "socket2", @@ -3415,17 +3431,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-rustls" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc6844de72e57df1980054b38be3a9f4702aba4858be64dd700181a8a6d0e1b6" -dependencies = [ - "rustls", - "tokio", - "webpki", -] - [[package]] name = "tokio-stream" version = "0.1.14" @@ -3503,9 +3508,21 @@ dependencies = [ "cfg-if", "log", "pin-project-lite", + "tracing-attributes", "tracing-core", ] +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", +] + [[package]] name = "tracing-core" version = "0.1.31" @@ -3759,23 +3776,13 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "webpki" -version = "0.21.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" -dependencies = [ - "ring", - "untrusted", -] - [[package]] name = "webpki-roots" -version = "0.21.1" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aabe153544e473b775453675851ecc86863d2a81d786d741f6b76778f2a48940" +checksum = "b291546d5d9d1eab74f069c77749f2cb8504a12caa20f0f2de93ddbf6f411888" dependencies = [ - "webpki", + "rustls-webpki", ] [[package]] @@ -3783,10 +3790,6 @@ name = "whoami" version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22fc3756b8a9133049b26c7f61ab35416c130e8c09b660f5b3958b446f52cc50" -dependencies = [ - "wasm-bindgen", - "web-sys", -] [[package]] name = "winapi" diff --git a/Cargo.toml b/Cargo.toml index 8375b515..1fe2c08f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,7 +38,7 @@ cache-buster = { git = "https://github.com/realaravinth/cache-buster" } futures = "0.3.15" tokio = { version = "1.14", features = ["sync"]} -sqlx = { version = "0.5.13", features = [ "runtime-actix-rustls", "postgres", "time", "offline", "mysql"] } +sqlx = { version = "0.7", features = [ "runtime-tokio-rustls", "postgres", "time", "mysql"] } argon2-creds = { branch = "master", git = "https://github.com/realaravinth/argon2-creds"} #argon2-creds = { version="*", path = "../../argon2-creds/" } config = "0.13" @@ -102,10 +102,10 @@ features = ["actix_identity_backend"] [build-dependencies] serde_json = "1" -sqlx = { version = "0.5.13", features = [ "runtime-actix-rustls", "postgres", "time", "offline", "mysql" ] } +sqlx = { version = "0.7", features = [ "runtime-tokio-rustls", "postgres", "time", "mysql" ] } [dev-dependencies] -pow_sha256 = { version = "0.3.1", git = "https://github.com/mcaptcha/pow_sha256", tag="0.3.1" } +mcaptcha_pow_sha256 = "0.4" awc = "3.0.0" diff --git a/build.rs b/build.rs index 6da61a7b..be1d3bdc 100644 --- a/build.rs +++ b/build.rs @@ -16,6 +16,7 @@ fn main() { let git_hash = String::from_utf8(output.stdout).unwrap(); println!("cargo:rustc-env=GIT_HASH={}", git_hash); - let now = OffsetDateTime::now_utc().format("%y-%m-%d"); + let now = OffsetDateTime::now_utc(); + let now = format!("{}{}{}", now.year(), now.month(), now.date()); println!("cargo:rustc-env=COMPILED_DATE={}", &now); } diff --git a/db/db-migrations/Cargo.toml b/db/db-migrations/Cargo.toml index f21b6879..952a1a4e 100644 --- a/db/db-migrations/Cargo.toml +++ b/db/db-migrations/Cargo.toml @@ -10,4 +10,4 @@ authors = ["realaravinth "] [dependencies] actix-rt = "2" -sqlx = { version = "0.5.13", features = [ "runtime-actix-rustls", "postgres", "time", "offline", "mysql" ] } +sqlx = { version = "0.7", features = [ "runtime-tokio-rustls", "postgres", "time", "mysql" ] } diff --git a/db/db-sqlx-maria/.sqlx/query-1367dceb151a766a901b5dd771d0b75d0bc61d2fef17a94a90c8ffa0065e2c44.json b/db/db-sqlx-maria/.sqlx/query-1367dceb151a766a901b5dd771d0b75d0bc61d2fef17a94a90c8ffa0065e2c44.json new file mode 100644 index 00000000..5b3e4055 --- /dev/null +++ b/db/db-sqlx-maria/.sqlx/query-1367dceb151a766a901b5dd771d0b75d0bc61d2fef17a94a90c8ffa0065e2c44.json @@ -0,0 +1,25 @@ +{ + "db_name": "MySQL", + "query": "SELECT time FROM mcaptcha_pow_confirmed_stats \n WHERE \n config_id = (\n SELECT config_id FROM mcaptcha_config \n WHERE \n captcha_key = ?\n AND\n user_id = (\n SELECT \n ID FROM mcaptcha_users WHERE name = ?))\n ORDER BY time DESC", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "time", + "type_info": { + "type": "Timestamp", + "flags": "NOT_NULL | UNSIGNED | BINARY | TIMESTAMP", + "char_set": 63, + "max_size": 19 + } + } + ], + "parameters": { + "Right": 2 + }, + "nullable": [ + false + ] + }, + "hash": "1367dceb151a766a901b5dd771d0b75d0bc61d2fef17a94a90c8ffa0065e2c44" +} diff --git a/db/db-sqlx-maria/.sqlx/query-14dc89b2988b221fd24e4f319b1d48f5e6c65c760c30d11c9c29087f09cee23a.json b/db/db-sqlx-maria/.sqlx/query-14dc89b2988b221fd24e4f319b1d48f5e6c65c760c30d11c9c29087f09cee23a.json new file mode 100644 index 00000000..081a092d --- /dev/null +++ b/db/db-sqlx-maria/.sqlx/query-14dc89b2988b221fd24e4f319b1d48f5e6c65c760c30d11c9c29087f09cee23a.json @@ -0,0 +1,25 @@ +{ + "db_name": "MySQL", + "query": "SELECT\n captcha_key\n FROM\n mcaptcha_config\n WHERE\n config_id = (\n SELECT\n config_id\n FROM\n mcaptcha_psuedo_campaign_id\n WHERE\n psuedo_id = ?\n );", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "captcha_key", + "type_info": { + "type": "VarString", + "flags": "NOT_NULL | UNIQUE_KEY | NO_DEFAULT_VALUE", + "char_set": 224, + "max_size": 400 + } + } + ], + "parameters": { + "Right": 1 + }, + "nullable": [ + false + ] + }, + "hash": "14dc89b2988b221fd24e4f319b1d48f5e6c65c760c30d11c9c29087f09cee23a" +} diff --git a/db/db-sqlx-maria/.sqlx/query-22e697114c3ed5b0156cdceab11a398f1ef3a804f482e1cd948bc615ef95fc92.json b/db/db-sqlx-maria/.sqlx/query-22e697114c3ed5b0156cdceab11a398f1ef3a804f482e1cd948bc615ef95fc92.json new file mode 100644 index 00000000..9e861664 --- /dev/null +++ b/db/db-sqlx-maria/.sqlx/query-22e697114c3ed5b0156cdceab11a398f1ef3a804f482e1cd948bc615ef95fc92.json @@ -0,0 +1,12 @@ +{ + "db_name": "MySQL", + "query": "INSERT INTO mcaptcha_sitekey_user_provided_avg_traffic (\n config_id,\n avg_traffic,\n peak_sustainable_traffic,\n broke_my_site_traffic\n ) VALUES ( \n (SELECT config_id FROM mcaptcha_config where captcha_key= (?)\n AND user_id = (SELECT ID FROM mcaptcha_users WHERE name = ?)\n ), ?, ?, ?)", + "describe": { + "columns": [], + "parameters": { + "Right": 5 + }, + "nullable": [] + }, + "hash": "22e697114c3ed5b0156cdceab11a398f1ef3a804f482e1cd948bc615ef95fc92" +} diff --git a/db/db-sqlx-maria/.sqlx/query-34b29417f9ff3f4d5987df0ce81023b1985eb84e560602b36182f55de6cd9d83.json b/db/db-sqlx-maria/.sqlx/query-34b29417f9ff3f4d5987df0ce81023b1985eb84e560602b36182f55de6cd9d83.json new file mode 100644 index 00000000..ade0e6ce --- /dev/null +++ b/db/db-sqlx-maria/.sqlx/query-34b29417f9ff3f4d5987df0ce81023b1985eb84e560602b36182f55de6cd9d83.json @@ -0,0 +1,12 @@ +{ + "db_name": "MySQL", + "query": "INSERT INTO mcaptcha_pow_confirmed_stats \n (config_id, time) VALUES ((SELECT config_id FROM mcaptcha_config where captcha_key= ?), ?)", + "describe": { + "columns": [], + "parameters": { + "Right": 2 + }, + "nullable": [] + }, + "hash": "34b29417f9ff3f4d5987df0ce81023b1985eb84e560602b36182f55de6cd9d83" +} diff --git a/db/db-sqlx-maria/.sqlx/query-3812693a9ae4402d900bcbf680981e6194073bd1937af11a77daa3776fb4c873.json b/db/db-sqlx-maria/.sqlx/query-3812693a9ae4402d900bcbf680981e6194073bd1937af11a77daa3776fb4c873.json new file mode 100644 index 00000000..fa80564d --- /dev/null +++ b/db/db-sqlx-maria/.sqlx/query-3812693a9ae4402d900bcbf680981e6194073bd1937af11a77daa3776fb4c873.json @@ -0,0 +1,58 @@ +{ + "db_name": "MySQL", + "query": "SELECT captcha_key, name, config_id, duration FROM mcaptcha_config WHERE\n user_id = (SELECT ID FROM mcaptcha_users WHERE name = ?) ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "captcha_key", + "type_info": { + "type": "VarString", + "flags": "NOT_NULL | UNIQUE_KEY | NO_DEFAULT_VALUE", + "char_set": 224, + "max_size": 400 + } + }, + { + "ordinal": 1, + "name": "name", + "type_info": { + "type": "VarString", + "flags": "NOT_NULL | NO_DEFAULT_VALUE", + "char_set": 224, + "max_size": 400 + } + }, + { + "ordinal": 2, + "name": "config_id", + "type_info": { + "type": "Long", + "flags": "NOT_NULL | PRIMARY_KEY | AUTO_INCREMENT", + "char_set": 63, + "max_size": 11 + } + }, + { + "ordinal": 3, + "name": "duration", + "type_info": { + "type": "Long", + "flags": "NOT_NULL", + "char_set": 63, + "max_size": 11 + } + } + ], + "parameters": { + "Right": 1 + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "3812693a9ae4402d900bcbf680981e6194073bd1937af11a77daa3776fb4c873" +} diff --git a/db/db-sqlx-maria/.sqlx/query-3a8381eb0f0542a492d9dd51368e769e2b313e0576a1873e5c7630011e463daf.json b/db/db-sqlx-maria/.sqlx/query-3a8381eb0f0542a492d9dd51368e769e2b313e0576a1873e5c7630011e463daf.json new file mode 100644 index 00000000..cfa8c9d1 --- /dev/null +++ b/db/db-sqlx-maria/.sqlx/query-3a8381eb0f0542a492d9dd51368e769e2b313e0576a1873e5c7630011e463daf.json @@ -0,0 +1,12 @@ +{ + "db_name": "MySQL", + "query": "UPDATE mcaptcha_config SET name = ?, duration = ?\n WHERE user_id = (SELECT ID FROM mcaptcha_users WHERE name = ?)\n AND captcha_key = ?", + "describe": { + "columns": [], + "parameters": { + "Right": 4 + }, + "nullable": [] + }, + "hash": "3a8381eb0f0542a492d9dd51368e769e2b313e0576a1873e5c7630011e463daf" +} diff --git a/db/db-sqlx-maria/.sqlx/query-413ea53cea8b8f114fc009bad527b054a68a94477dfcc50d860d45bbd864d4f1.json b/db/db-sqlx-maria/.sqlx/query-413ea53cea8b8f114fc009bad527b054a68a94477dfcc50d860d45bbd864d4f1.json new file mode 100644 index 00000000..2fdc6bb0 --- /dev/null +++ b/db/db-sqlx-maria/.sqlx/query-413ea53cea8b8f114fc009bad527b054a68a94477dfcc50d860d45bbd864d4f1.json @@ -0,0 +1,25 @@ +{ + "db_name": "MySQL", + "query": "SELECT email FROM mcaptcha_users WHERE name = ?", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "email", + "type_info": { + "type": "VarString", + "flags": "UNIQUE_KEY", + "char_set": 224, + "max_size": 400 + } + } + ], + "parameters": { + "Right": 1 + }, + "nullable": [ + true + ] + }, + "hash": "413ea53cea8b8f114fc009bad527b054a68a94477dfcc50d860d45bbd864d4f1" +} diff --git a/db/db-sqlx-maria/.sqlx/query-42d967d6e080efd3cff8d4df13ea4d2ff38f3093da5c97000349dfc23c4d4eb3.json b/db/db-sqlx-maria/.sqlx/query-42d967d6e080efd3cff8d4df13ea4d2ff38f3093da5c97000349dfc23c4d4eb3.json new file mode 100644 index 00000000..697aaa1e --- /dev/null +++ b/db/db-sqlx-maria/.sqlx/query-42d967d6e080efd3cff8d4df13ea4d2ff38f3093da5c97000349dfc23c4d4eb3.json @@ -0,0 +1,69 @@ +{ + "db_name": "MySQL", + "query": "-- SPDX-FileCopyrightText: 2023 Aravinth Manivannan \n--\n-- SPDX-License-Identifier: AGPL-3.0-or-later\n\n-- gets all unread notifications a user has\nSELECT \n mcaptcha_notifications.id,\n mcaptcha_notifications.heading,\n mcaptcha_notifications.message,\n mcaptcha_notifications.received,\n mcaptcha_users.name\nFROM\n mcaptcha_notifications \nINNER JOIN \n mcaptcha_users \nON \n mcaptcha_notifications.tx = mcaptcha_users.id\nWHERE \n mcaptcha_notifications.rx = (\n SELECT \n id \n FROM \n mcaptcha_users\n WHERE\n name = ?\n )\nAND \n mcaptcha_notifications.read_notification IS NULL;\n", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": { + "type": "Long", + "flags": "NOT_NULL | PRIMARY_KEY | AUTO_INCREMENT", + "char_set": 63, + "max_size": 11 + } + }, + { + "ordinal": 1, + "name": "heading", + "type_info": { + "type": "VarString", + "flags": "NOT_NULL | NO_DEFAULT_VALUE", + "char_set": 224, + "max_size": 400 + } + }, + { + "ordinal": 2, + "name": "message", + "type_info": { + "type": "VarString", + "flags": "NOT_NULL | NO_DEFAULT_VALUE", + "char_set": 224, + "max_size": 1000 + } + }, + { + "ordinal": 3, + "name": "received", + "type_info": { + "type": "Timestamp", + "flags": "NOT_NULL | UNSIGNED | BINARY | TIMESTAMP", + "char_set": 63, + "max_size": 19 + } + }, + { + "ordinal": 4, + "name": "name", + "type_info": { + "type": "VarString", + "flags": "NOT_NULL | UNIQUE_KEY | NO_DEFAULT_VALUE", + "char_set": 224, + "max_size": 400 + } + } + ], + "parameters": { + "Right": 1 + }, + "nullable": [ + false, + false, + false, + false, + false + ] + }, + "hash": "42d967d6e080efd3cff8d4df13ea4d2ff38f3093da5c97000349dfc23c4d4eb3" +} diff --git a/db/db-sqlx-maria/.sqlx/query-598a8202942771eff460faa6f09bd3fb1fc910d5fab7edb07c49dadbbaeb1cb8.json b/db/db-sqlx-maria/.sqlx/query-598a8202942771eff460faa6f09bd3fb1fc910d5fab7edb07c49dadbbaeb1cb8.json new file mode 100644 index 00000000..dac28855 --- /dev/null +++ b/db/db-sqlx-maria/.sqlx/query-598a8202942771eff460faa6f09bd3fb1fc910d5fab7edb07c49dadbbaeb1cb8.json @@ -0,0 +1,12 @@ +{ + "db_name": "MySQL", + "query": "INSERT INTO mcaptcha_pow_fetched_stats \n (config_id, time) VALUES ((SELECT config_id FROM mcaptcha_config where captcha_key= ?), ?)", + "describe": { + "columns": [], + "parameters": { + "Right": 2 + }, + "nullable": [] + }, + "hash": "598a8202942771eff460faa6f09bd3fb1fc910d5fab7edb07c49dadbbaeb1cb8" +} diff --git a/db/db-sqlx-maria/.sqlx/query-5ad1ef722a961183228d851813b9f50284520bf8cc8118c765b72c108daaf6fb.json b/db/db-sqlx-maria/.sqlx/query-5ad1ef722a961183228d851813b9f50284520bf8cc8118c765b72c108daaf6fb.json new file mode 100644 index 00000000..c02c6cdf --- /dev/null +++ b/db/db-sqlx-maria/.sqlx/query-5ad1ef722a961183228d851813b9f50284520bf8cc8118c765b72c108daaf6fb.json @@ -0,0 +1,25 @@ +{ + "db_name": "MySQL", + "query": "SELECT psuedo_id FROM\n mcaptcha_psuedo_campaign_id\n WHERE\n config_id = (SELECT config_id FROM mcaptcha_config WHERE captcha_key = (?));\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "psuedo_id", + "type_info": { + "type": "VarString", + "flags": "NOT_NULL | UNIQUE_KEY | NO_DEFAULT_VALUE", + "char_set": 224, + "max_size": 400 + } + } + ], + "parameters": { + "Right": 1 + }, + "nullable": [ + false + ] + }, + "hash": "5ad1ef722a961183228d851813b9f50284520bf8cc8118c765b72c108daaf6fb" +} diff --git a/db/db-sqlx-maria/.sqlx/query-5d5a106981345e9f62bc2239c00cdc683d3aaaa820d63da300dc51e3f6f363d3.json b/db/db-sqlx-maria/.sqlx/query-5d5a106981345e9f62bc2239c00cdc683d3aaaa820d63da300dc51e3f6f363d3.json new file mode 100644 index 00000000..7e81e485 --- /dev/null +++ b/db/db-sqlx-maria/.sqlx/query-5d5a106981345e9f62bc2239c00cdc683d3aaaa820d63da300dc51e3f6f363d3.json @@ -0,0 +1,12 @@ +{ + "db_name": "MySQL", + "query": "INSERT INTO mcaptcha_users \n (name , password, secret) VALUES (?, ?, ?)", + "describe": { + "columns": [], + "parameters": { + "Right": 3 + }, + "nullable": [] + }, + "hash": "5d5a106981345e9f62bc2239c00cdc683d3aaaa820d63da300dc51e3f6f363d3" +} diff --git a/db/db-sqlx-maria/.sqlx/query-6094468b7fa20043b0da90e366b7f1fa29a8c748e163b6712725440b25ae9361.json b/db/db-sqlx-maria/.sqlx/query-6094468b7fa20043b0da90e366b7f1fa29a8c748e163b6712725440b25ae9361.json new file mode 100644 index 00000000..8f7bb03d --- /dev/null +++ b/db/db-sqlx-maria/.sqlx/query-6094468b7fa20043b0da90e366b7f1fa29a8c748e163b6712725440b25ae9361.json @@ -0,0 +1,12 @@ +{ + "db_name": "MySQL", + "query": "\n DELETE FROM\n mcaptcha_pow_analytics\n WHERE\n config_id = (\n SELECT config_id FROM mcaptcha_config WHERE captcha_key = ?\n ) ", + "describe": { + "columns": [], + "parameters": { + "Right": 1 + }, + "nullable": [] + }, + "hash": "6094468b7fa20043b0da90e366b7f1fa29a8c748e163b6712725440b25ae9361" +} diff --git a/db/db-sqlx-maria/.sqlx/query-66ec7df10484f8e0206f3c97afc9136021589556c38dbbed341d6574487f79f2.json b/db/db-sqlx-maria/.sqlx/query-66ec7df10484f8e0206f3c97afc9136021589556c38dbbed341d6574487f79f2.json new file mode 100644 index 00000000..ef3a8465 --- /dev/null +++ b/db/db-sqlx-maria/.sqlx/query-66ec7df10484f8e0206f3c97afc9136021589556c38dbbed341d6574487f79f2.json @@ -0,0 +1,25 @@ +{ + "db_name": "MySQL", + "query": "SELECT config_id FROM mcaptcha_config\n WHERE\n captcha_key = ? \n AND user_id = (SELECT ID FROM mcaptcha_users WHERE name = ?)", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "config_id", + "type_info": { + "type": "Long", + "flags": "NOT_NULL | PRIMARY_KEY | AUTO_INCREMENT", + "char_set": 63, + "max_size": 11 + } + } + ], + "parameters": { + "Right": 2 + }, + "nullable": [ + false + ] + }, + "hash": "66ec7df10484f8e0206f3c97afc9136021589556c38dbbed341d6574487f79f2" +} diff --git a/db/db-sqlx-maria/.sqlx/query-676a9f1761c3b63cf16d7d4dd6261507cc7707feb32d458f4b946ed9caa53721.json b/db/db-sqlx-maria/.sqlx/query-676a9f1761c3b63cf16d7d4dd6261507cc7707feb32d458f4b946ed9caa53721.json new file mode 100644 index 00000000..b14a9476 --- /dev/null +++ b/db/db-sqlx-maria/.sqlx/query-676a9f1761c3b63cf16d7d4dd6261507cc7707feb32d458f4b946ed9caa53721.json @@ -0,0 +1,12 @@ +{ + "db_name": "MySQL", + "query": "UPDATE mcaptcha_users set name = ?\n WHERE name = ?", + "describe": { + "columns": [], + "parameters": { + "Right": 2 + }, + "nullable": [] + }, + "hash": "676a9f1761c3b63cf16d7d4dd6261507cc7707feb32d458f4b946ed9caa53721" +} diff --git a/db/db-sqlx-maria/.sqlx/query-6d1b6e5e58ca2ba285cab7b050bbdc43de1f3e46cf7d420bc95c124a1c7c9d1f.json b/db/db-sqlx-maria/.sqlx/query-6d1b6e5e58ca2ba285cab7b050bbdc43de1f3e46cf7d420bc95c124a1c7c9d1f.json new file mode 100644 index 00000000..655ec872 --- /dev/null +++ b/db/db-sqlx-maria/.sqlx/query-6d1b6e5e58ca2ba285cab7b050bbdc43de1f3e46cf7d420bc95c124a1c7c9d1f.json @@ -0,0 +1,12 @@ +{ + "db_name": "MySQL", + "query": "DELETE FROM mcaptcha_users WHERE name = (?)", + "describe": { + "columns": [], + "parameters": { + "Right": 1 + }, + "nullable": [] + }, + "hash": "6d1b6e5e58ca2ba285cab7b050bbdc43de1f3e46cf7d420bc95c124a1c7c9d1f" +} diff --git a/db/db-sqlx-maria/.sqlx/query-6d43e6ceb54a0ff8a803bd96dd9134b15da01d48776ac0cf3d66a2997dadce5e.json b/db/db-sqlx-maria/.sqlx/query-6d43e6ceb54a0ff8a803bd96dd9134b15da01d48776ac0cf3d66a2997dadce5e.json new file mode 100644 index 00000000..eb8c1426 --- /dev/null +++ b/db/db-sqlx-maria/.sqlx/query-6d43e6ceb54a0ff8a803bd96dd9134b15da01d48776ac0cf3d66a2997dadce5e.json @@ -0,0 +1,36 @@ +{ + "db_name": "MySQL", + "query": "SELECT difficulty_factor, visitor_threshold FROM mcaptcha_levels WHERE\n config_id = (\n SELECT config_id FROM mcaptcha_config where captcha_key= (?)\n ) ORDER BY difficulty_factor ASC;", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "difficulty_factor", + "type_info": { + "type": "Long", + "flags": "NOT_NULL | NO_DEFAULT_VALUE", + "char_set": 63, + "max_size": 11 + } + }, + { + "ordinal": 1, + "name": "visitor_threshold", + "type_info": { + "type": "Long", + "flags": "NOT_NULL | NO_DEFAULT_VALUE", + "char_set": 63, + "max_size": 11 + } + } + ], + "parameters": { + "Right": 1 + }, + "nullable": [ + false, + false + ] + }, + "hash": "6d43e6ceb54a0ff8a803bd96dd9134b15da01d48776ac0cf3d66a2997dadce5e" +} diff --git a/db/db-sqlx-maria/.sqlx/query-74d68a86f852d3d85957e94ed04e8acd8e6144744f7b13e383ebcb2bcf3360ae.json b/db/db-sqlx-maria/.sqlx/query-74d68a86f852d3d85957e94ed04e8acd8e6144744f7b13e383ebcb2bcf3360ae.json new file mode 100644 index 00000000..03d7d79f --- /dev/null +++ b/db/db-sqlx-maria/.sqlx/query-74d68a86f852d3d85957e94ed04e8acd8e6144744f7b13e383ebcb2bcf3360ae.json @@ -0,0 +1,12 @@ +{ + "db_name": "MySQL", + "query": "INSERT INTO mcaptcha_levels (\n difficulty_factor, \n visitor_threshold,\n config_id) VALUES (\n ?, ?, (\n SELECT config_id FROM mcaptcha_config WHERE\n captcha_key = (?) AND user_id = (\n SELECT ID FROM mcaptcha_users WHERE name = ?\n )));", + "describe": { + "columns": [], + "parameters": { + "Right": 4 + }, + "nullable": [] + }, + "hash": "74d68a86f852d3d85957e94ed04e8acd8e6144744f7b13e383ebcb2bcf3360ae" +} diff --git a/db/db-sqlx-maria/.sqlx/query-7838ade4a48068e25c6f117ee8e38f088b867b1ab08a7dd0269b76891266ace6.json b/db/db-sqlx-maria/.sqlx/query-7838ade4a48068e25c6f117ee8e38f088b867b1ab08a7dd0269b76891266ace6.json new file mode 100644 index 00000000..24d03f3f --- /dev/null +++ b/db/db-sqlx-maria/.sqlx/query-7838ade4a48068e25c6f117ee8e38f088b867b1ab08a7dd0269b76891266ace6.json @@ -0,0 +1,12 @@ +{ + "db_name": "MySQL", + "query": "UPDATE mcaptcha_users set secret = ?\n WHERE name = ?", + "describe": { + "columns": [], + "parameters": { + "Right": 2 + }, + "nullable": [] + }, + "hash": "7838ade4a48068e25c6f117ee8e38f088b867b1ab08a7dd0269b76891266ace6" +} diff --git a/db/db-sqlx-maria/.sqlx/query-7894dda54cd65559fe3b81bab7df8cc848e21ed5c7f5e88951bf1c98c78ed820.json b/db/db-sqlx-maria/.sqlx/query-7894dda54cd65559fe3b81bab7df8cc848e21ed5c7f5e88951bf1c98c78ed820.json new file mode 100644 index 00000000..d2e09b3b --- /dev/null +++ b/db/db-sqlx-maria/.sqlx/query-7894dda54cd65559fe3b81bab7df8cc848e21ed5c7f5e88951bf1c98c78ed820.json @@ -0,0 +1,12 @@ +{ + "db_name": "MySQL", + "query": "DELETE FROM mcaptcha_levels \n WHERE config_id = (\n SELECT config_id FROM mcaptcha_config where captcha_key= (?) \n AND user_id = (\n SELECT ID from mcaptcha_users WHERE name = ?\n )\n )", + "describe": { + "columns": [], + "parameters": { + "Right": 2 + }, + "nullable": [] + }, + "hash": "7894dda54cd65559fe3b81bab7df8cc848e21ed5c7f5e88951bf1c98c78ed820" +} diff --git a/db/db-sqlx-maria/.sqlx/query-89386c46668a2653a54687e65958af5cf7a8da268339a1f5a379ede47b3c6d2a.json b/db/db-sqlx-maria/.sqlx/query-89386c46668a2653a54687e65958af5cf7a8da268339a1f5a379ede47b3c6d2a.json new file mode 100644 index 00000000..c0af4a0b --- /dev/null +++ b/db/db-sqlx-maria/.sqlx/query-89386c46668a2653a54687e65958af5cf7a8da268339a1f5a379ede47b3c6d2a.json @@ -0,0 +1,12 @@ +{ + "db_name": "MySQL", + "query": "INSERT INTO mcaptcha_notifications (\n heading, message, tx, rx, received)\n VALUES (\n ?, ?,\n (SELECT ID FROM mcaptcha_users WHERE name = ?),\n (SELECT ID FROM mcaptcha_users WHERE name = ?),\n ?\n );", + "describe": { + "columns": [], + "parameters": { + "Right": 5 + }, + "nullable": [] + }, + "hash": "89386c46668a2653a54687e65958af5cf7a8da268339a1f5a379ede47b3c6d2a" +} diff --git a/db/db-sqlx-maria/.sqlx/query-8acbf84d4801e86221d8f6324ae50488a0986182d66b20ad414bce4e2ac18eca.json b/db/db-sqlx-maria/.sqlx/query-8acbf84d4801e86221d8f6324ae50488a0986182d66b20ad414bce4e2ac18eca.json new file mode 100644 index 00000000..bf554ffb --- /dev/null +++ b/db/db-sqlx-maria/.sqlx/query-8acbf84d4801e86221d8f6324ae50488a0986182d66b20ad414bce4e2ac18eca.json @@ -0,0 +1,25 @@ +{ + "db_name": "MySQL", + "query": "SELECT duration FROM mcaptcha_config \n where captcha_key= ?", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "duration", + "type_info": { + "type": "Long", + "flags": "NOT_NULL", + "char_set": 63, + "max_size": 11 + } + } + ], + "parameters": { + "Right": 1 + }, + "nullable": [ + false + ] + }, + "hash": "8acbf84d4801e86221d8f6324ae50488a0986182d66b20ad414bce4e2ac18eca" +} diff --git a/db/db-sqlx-maria/.sqlx/query-8e6026abf7c0e8ab90ee8eb7ada9f66962ab6999d3127944b058d6f96346e72f.json b/db/db-sqlx-maria/.sqlx/query-8e6026abf7c0e8ab90ee8eb7ada9f66962ab6999d3127944b058d6f96346e72f.json new file mode 100644 index 00000000..0107c301 --- /dev/null +++ b/db/db-sqlx-maria/.sqlx/query-8e6026abf7c0e8ab90ee8eb7ada9f66962ab6999d3127944b058d6f96346e72f.json @@ -0,0 +1,12 @@ +{ + "db_name": "MySQL", + "query": "UPDATE mcaptcha_config SET captcha_key = ? \n WHERE captcha_key = ? AND user_id = (SELECT ID FROM mcaptcha_users WHERE name = ?)", + "describe": { + "columns": [], + "parameters": { + "Right": 3 + }, + "nullable": [] + }, + "hash": "8e6026abf7c0e8ab90ee8eb7ada9f66962ab6999d3127944b058d6f96346e72f" +} diff --git a/db/db-sqlx-maria/.sqlx/query-8ec8bbde0c02a99f74d12e6778f123a973283e6d56b6861b30f559768617848a.json b/db/db-sqlx-maria/.sqlx/query-8ec8bbde0c02a99f74d12e6778f123a973283e6d56b6861b30f559768617848a.json new file mode 100644 index 00000000..6a1ca2ff --- /dev/null +++ b/db/db-sqlx-maria/.sqlx/query-8ec8bbde0c02a99f74d12e6778f123a973283e6d56b6861b30f559768617848a.json @@ -0,0 +1,12 @@ +{ + "db_name": "MySQL", + "query": "insert into mcaptcha_users \n (name , password, email, secret) values (?, ?, ?, ?)", + "describe": { + "columns": [], + "parameters": { + "Right": 4 + }, + "nullable": [] + }, + "hash": "8ec8bbde0c02a99f74d12e6778f123a973283e6d56b6861b30f559768617848a" +} diff --git a/db/db-sqlx-maria/.sqlx/query-9c435148ed5655e79dd1e73e3566ce23b7c6d38edcedbb988c95813c5da893ed.json b/db/db-sqlx-maria/.sqlx/query-9c435148ed5655e79dd1e73e3566ce23b7c6d38edcedbb988c95813c5da893ed.json new file mode 100644 index 00000000..dca3e39f --- /dev/null +++ b/db/db-sqlx-maria/.sqlx/query-9c435148ed5655e79dd1e73e3566ce23b7c6d38edcedbb988c95813c5da893ed.json @@ -0,0 +1,58 @@ +{ + "db_name": "MySQL", + "query": "SELECT `config_id`, `duration`, `name`, `captcha_key` from mcaptcha_config WHERE\n `captcha_key` = ? AND\n user_id = (SELECT ID FROM mcaptcha_users WHERE name = ?) ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "config_id", + "type_info": { + "type": "Long", + "flags": "NOT_NULL | PRIMARY_KEY | AUTO_INCREMENT", + "char_set": 63, + "max_size": 11 + } + }, + { + "ordinal": 1, + "name": "duration", + "type_info": { + "type": "Long", + "flags": "NOT_NULL", + "char_set": 63, + "max_size": 11 + } + }, + { + "ordinal": 2, + "name": "name", + "type_info": { + "type": "VarString", + "flags": "NOT_NULL | NO_DEFAULT_VALUE", + "char_set": 224, + "max_size": 400 + } + }, + { + "ordinal": 3, + "name": "captcha_key", + "type_info": { + "type": "VarString", + "flags": "NOT_NULL | UNIQUE_KEY | NO_DEFAULT_VALUE", + "char_set": 224, + "max_size": 400 + } + } + ], + "parameters": { + "Right": 2 + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "9c435148ed5655e79dd1e73e3566ce23b7c6d38edcedbb988c95813c5da893ed" +} diff --git a/db/db-sqlx-maria/.sqlx/query-9cb416de904872d66af90baa0024f382ce6f8344464c607fe6e6c2572816dfc2.json b/db/db-sqlx-maria/.sqlx/query-9cb416de904872d66af90baa0024f382ce6f8344464c607fe6e6c2572816dfc2.json new file mode 100644 index 00000000..393838c6 --- /dev/null +++ b/db/db-sqlx-maria/.sqlx/query-9cb416de904872d66af90baa0024f382ce6f8344464c607fe6e6c2572816dfc2.json @@ -0,0 +1,12 @@ +{ + "db_name": "MySQL", + "query": "UPDATE mcaptcha_users set email = ?\n WHERE name = ?", + "describe": { + "columns": [], + "parameters": { + "Right": 2 + }, + "nullable": [] + }, + "hash": "9cb416de904872d66af90baa0024f382ce6f8344464c607fe6e6c2572816dfc2" +} diff --git a/db/db-sqlx-maria/.sqlx/query-9e45969a0f79eab8caba41b0d91e5e3b85a1a68a49136f89fc90793c38f00041.json b/db/db-sqlx-maria/.sqlx/query-9e45969a0f79eab8caba41b0d91e5e3b85a1a68a49136f89fc90793c38f00041.json new file mode 100644 index 00000000..1d619425 --- /dev/null +++ b/db/db-sqlx-maria/.sqlx/query-9e45969a0f79eab8caba41b0d91e5e3b85a1a68a49136f89fc90793c38f00041.json @@ -0,0 +1,12 @@ +{ + "db_name": "MySQL", + "query": "\n INSERT INTO\n mcaptcha_psuedo_campaign_id (config_id, psuedo_id)\n VALUES (\n (SELECT config_id FROM mcaptcha_config WHERE captcha_key = (?)),\n ?\n );", + "describe": { + "columns": [], + "parameters": { + "Right": 2 + }, + "nullable": [] + }, + "hash": "9e45969a0f79eab8caba41b0d91e5e3b85a1a68a49136f89fc90793c38f00041" +} diff --git a/db/db-sqlx-maria/.sqlx/query-9f10afb0f242f11c58389803c5e85e244cc59102b8929a21e3fcaa852d57a52c.json b/db/db-sqlx-maria/.sqlx/query-9f10afb0f242f11c58389803c5e85e244cc59102b8929a21e3fcaa852d57a52c.json new file mode 100644 index 00000000..e51905c7 --- /dev/null +++ b/db/db-sqlx-maria/.sqlx/query-9f10afb0f242f11c58389803c5e85e244cc59102b8929a21e3fcaa852d57a52c.json @@ -0,0 +1,58 @@ +{ + "db_name": "MySQL", + "query": "SELECT\n id, time, difficulty_factor, worker_type\n FROM\n mcaptcha_pow_analytics\n WHERE\n config_id = (\n SELECT config_id FROM mcaptcha_config WHERE captcha_key = ?\n ) \n ORDER BY ID\n LIMIT ? OFFSET ?", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": { + "type": "Long", + "flags": "NOT_NULL | PRIMARY_KEY | AUTO_INCREMENT", + "char_set": 63, + "max_size": 11 + } + }, + { + "ordinal": 1, + "name": "time", + "type_info": { + "type": "Long", + "flags": "NOT_NULL | NO_DEFAULT_VALUE", + "char_set": 63, + "max_size": 11 + } + }, + { + "ordinal": 2, + "name": "difficulty_factor", + "type_info": { + "type": "Long", + "flags": "NOT_NULL | NO_DEFAULT_VALUE", + "char_set": 63, + "max_size": 11 + } + }, + { + "ordinal": 3, + "name": "worker_type", + "type_info": { + "type": "VarString", + "flags": "NOT_NULL | NO_DEFAULT_VALUE", + "char_set": 224, + "max_size": 400 + } + } + ], + "parameters": { + "Right": 3 + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "9f10afb0f242f11c58389803c5e85e244cc59102b8929a21e3fcaa852d57a52c" +} diff --git a/db/db-sqlx-maria/.sqlx/query-a89c066db044cddfdebee6a0fd0d80a5a26dcb7ecc00a9899f5634b72ea0a952.json b/db/db-sqlx-maria/.sqlx/query-a89c066db044cddfdebee6a0fd0d80a5a26dcb7ecc00a9899f5634b72ea0a952.json new file mode 100644 index 00000000..f5f765da --- /dev/null +++ b/db/db-sqlx-maria/.sqlx/query-a89c066db044cddfdebee6a0fd0d80a5a26dcb7ecc00a9899f5634b72ea0a952.json @@ -0,0 +1,25 @@ +{ + "db_name": "MySQL", + "query": "SELECT config_id from mcaptcha_config WHERE captcha_key = ?", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "config_id", + "type_info": { + "type": "Long", + "flags": "NOT_NULL | PRIMARY_KEY | AUTO_INCREMENT", + "char_set": 63, + "max_size": 11 + } + } + ], + "parameters": { + "Right": 1 + }, + "nullable": [ + false + ] + }, + "hash": "a89c066db044cddfdebee6a0fd0d80a5a26dcb7ecc00a9899f5634b72ea0a952" +} diff --git a/db/db-sqlx-maria/.sqlx/query-b9258c2494d95701d19703cf5cd05a222057a0ccad943192138b1a4a94bf823b.json b/db/db-sqlx-maria/.sqlx/query-b9258c2494d95701d19703cf5cd05a222057a0ccad943192138b1a4a94bf823b.json new file mode 100644 index 00000000..62a84422 --- /dev/null +++ b/db/db-sqlx-maria/.sqlx/query-b9258c2494d95701d19703cf5cd05a222057a0ccad943192138b1a4a94bf823b.json @@ -0,0 +1,25 @@ +{ + "db_name": "MySQL", + "query": "SELECT secret FROM mcaptcha_users WHERE ID = (\n SELECT user_id FROM mcaptcha_config WHERE captcha_key = ?\n )", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "secret", + "type_info": { + "type": "VarString", + "flags": "NOT_NULL | UNIQUE_KEY | NO_DEFAULT_VALUE", + "char_set": 224, + "max_size": 200 + } + } + ], + "parameters": { + "Right": 1 + }, + "nullable": [ + false + ] + }, + "hash": "b9258c2494d95701d19703cf5cd05a222057a0ccad943192138b1a4a94bf823b" +} diff --git a/db/db-sqlx-maria/.sqlx/query-b95e5a60a202cb646d5e76df8c7395e4bf881a6dd14e28e6f2e8b93e0536b331.json b/db/db-sqlx-maria/.sqlx/query-b95e5a60a202cb646d5e76df8c7395e4bf881a6dd14e28e6f2e8b93e0536b331.json new file mode 100644 index 00000000..8d918880 --- /dev/null +++ b/db/db-sqlx-maria/.sqlx/query-b95e5a60a202cb646d5e76df8c7395e4bf881a6dd14e28e6f2e8b93e0536b331.json @@ -0,0 +1,12 @@ +{ + "db_name": "MySQL", + "query": "DELETE FROM mcaptcha_config where captcha_key= (?)\n AND\n user_id = (SELECT ID FROM mcaptcha_users WHERE name = ?)", + "describe": { + "columns": [], + "parameters": { + "Right": 2 + }, + "nullable": [] + }, + "hash": "b95e5a60a202cb646d5e76df8c7395e4bf881a6dd14e28e6f2e8b93e0536b331" +} diff --git a/db/db-sqlx-maria/.sqlx/query-caa1638ee510ef62b86817e5d2baeaca8dfa432c23d7630c0e70737211a4680b.json b/db/db-sqlx-maria/.sqlx/query-caa1638ee510ef62b86817e5d2baeaca8dfa432c23d7630c0e70737211a4680b.json new file mode 100644 index 00000000..ac3347b7 --- /dev/null +++ b/db/db-sqlx-maria/.sqlx/query-caa1638ee510ef62b86817e5d2baeaca8dfa432c23d7630c0e70737211a4680b.json @@ -0,0 +1,25 @@ +{ + "db_name": "MySQL", + "query": "SELECT name from mcaptcha_users WHERE email = ?", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "name", + "type_info": { + "type": "VarString", + "flags": "NOT_NULL | UNIQUE_KEY | NO_DEFAULT_VALUE", + "char_set": 224, + "max_size": 400 + } + } + ], + "parameters": { + "Right": 1 + }, + "nullable": [ + false + ] + }, + "hash": "caa1638ee510ef62b86817e5d2baeaca8dfa432c23d7630c0e70737211a4680b" +} diff --git a/db/db-sqlx-maria/.sqlx/query-cad5b403470f26c565e74a1dca19b7dee066141dec0f708070067e34d5bf72cc.json b/db/db-sqlx-maria/.sqlx/query-cad5b403470f26c565e74a1dca19b7dee066141dec0f708070067e34d5bf72cc.json new file mode 100644 index 00000000..dffc0d92 --- /dev/null +++ b/db/db-sqlx-maria/.sqlx/query-cad5b403470f26c565e74a1dca19b7dee066141dec0f708070067e34d5bf72cc.json @@ -0,0 +1,12 @@ +{ + "db_name": "MySQL", + "query": "UPDATE mcaptcha_users set password = ?\n WHERE name = ?", + "describe": { + "columns": [], + "parameters": { + "Right": 2 + }, + "nullable": [] + }, + "hash": "cad5b403470f26c565e74a1dca19b7dee066141dec0f708070067e34d5bf72cc" +} diff --git a/db/db-sqlx-maria/.sqlx/query-d05b84966f4e70c53789221f961bf3637f404f3ba45e880115e97ed1ba5a2809.json b/db/db-sqlx-maria/.sqlx/query-d05b84966f4e70c53789221f961bf3637f404f3ba45e880115e97ed1ba5a2809.json new file mode 100644 index 00000000..441e9e21 --- /dev/null +++ b/db/db-sqlx-maria/.sqlx/query-d05b84966f4e70c53789221f961bf3637f404f3ba45e880115e97ed1ba5a2809.json @@ -0,0 +1,12 @@ +{ + "db_name": "MySQL", + "query": "INSERT INTO mcaptcha_config\n (`captcha_key`, `user_id`, `duration`, `name`)\n VALUES (?, (SELECT ID FROM mcaptcha_users WHERE name = ?), ?, ?)", + "describe": { + "columns": [], + "parameters": { + "Right": 4 + }, + "nullable": [] + }, + "hash": "d05b84966f4e70c53789221f961bf3637f404f3ba45e880115e97ed1ba5a2809" +} diff --git a/db/db-sqlx-maria/.sqlx/query-d4b92e8099cd29cfdb99aadeeada739bb6858667fc65f528ec484e98a9da21bc.json b/db/db-sqlx-maria/.sqlx/query-d4b92e8099cd29cfdb99aadeeada739bb6858667fc65f528ec484e98a9da21bc.json new file mode 100644 index 00000000..50784b9a --- /dev/null +++ b/db/db-sqlx-maria/.sqlx/query-d4b92e8099cd29cfdb99aadeeada739bb6858667fc65f528ec484e98a9da21bc.json @@ -0,0 +1,25 @@ +{ + "db_name": "MySQL", + "query": "SELECT time FROM mcaptcha_pow_solved_stats \n WHERE config_id = (\n SELECT config_id FROM mcaptcha_config \n WHERE \n captcha_key = ?\n AND\n user_id = (\n SELECT \n ID FROM mcaptcha_users WHERE name = ?)) \n ORDER BY time DESC", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "time", + "type_info": { + "type": "Timestamp", + "flags": "NOT_NULL | UNSIGNED | BINARY | TIMESTAMP", + "char_set": 63, + "max_size": 19 + } + } + ], + "parameters": { + "Right": 2 + }, + "nullable": [ + false + ] + }, + "hash": "d4b92e8099cd29cfdb99aadeeada739bb6858667fc65f528ec484e98a9da21bc" +} diff --git a/db/db-sqlx-maria/.sqlx/query-daac5e937aeac2f106eb89154b431fa8bd1bd7baa95e51704fdcdf50bd970a1d.json b/db/db-sqlx-maria/.sqlx/query-daac5e937aeac2f106eb89154b431fa8bd1bd7baa95e51704fdcdf50bd970a1d.json new file mode 100644 index 00000000..dcbbd651 --- /dev/null +++ b/db/db-sqlx-maria/.sqlx/query-daac5e937aeac2f106eb89154b431fa8bd1bd7baa95e51704fdcdf50bd970a1d.json @@ -0,0 +1,25 @@ +{ + "db_name": "MySQL", + "query": "SELECT time FROM mcaptcha_pow_fetched_stats\n WHERE \n config_id = (\n SELECT \n config_id FROM mcaptcha_config \n WHERE \n captcha_key = ?\n AND\n user_id = (\n SELECT \n ID FROM mcaptcha_users WHERE name = ?))\n ORDER BY time DESC", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "time", + "type_info": { + "type": "Timestamp", + "flags": "NOT_NULL | UNSIGNED | BINARY | TIMESTAMP", + "char_set": 63, + "max_size": 19 + } + } + ], + "parameters": { + "Right": 2 + }, + "nullable": [ + false + ] + }, + "hash": "daac5e937aeac2f106eb89154b431fa8bd1bd7baa95e51704fdcdf50bd970a1d" +} diff --git a/db/db-sqlx-maria/.sqlx/query-dd5ff10b88fa6f374e105b6bed9e34e0870ac8dd7ce36dfb09d13a1b7005b2eb.json b/db/db-sqlx-maria/.sqlx/query-dd5ff10b88fa6f374e105b6bed9e34e0870ac8dd7ce36dfb09d13a1b7005b2eb.json new file mode 100644 index 00000000..121209df --- /dev/null +++ b/db/db-sqlx-maria/.sqlx/query-dd5ff10b88fa6f374e105b6bed9e34e0870ac8dd7ce36dfb09d13a1b7005b2eb.json @@ -0,0 +1,36 @@ +{ + "db_name": "MySQL", + "query": "SELECT name, password FROM mcaptcha_users WHERE name = ?", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "name", + "type_info": { + "type": "VarString", + "flags": "NOT_NULL | UNIQUE_KEY | NO_DEFAULT_VALUE", + "char_set": 224, + "max_size": 400 + } + }, + { + "ordinal": 1, + "name": "password", + "type_info": { + "type": "Blob", + "flags": "NOT_NULL | BLOB | NO_DEFAULT_VALUE", + "char_set": 224, + "max_size": 262140 + } + } + ], + "parameters": { + "Right": 1 + }, + "nullable": [ + false, + false + ] + }, + "hash": "dd5ff10b88fa6f374e105b6bed9e34e0870ac8dd7ce36dfb09d13a1b7005b2eb" +} diff --git a/db/db-sqlx-maria/.sqlx/query-dd9b4dec39405ff19af21faabb6a7c3bb3207e7e785fe15357146b88c6c27f01.json b/db/db-sqlx-maria/.sqlx/query-dd9b4dec39405ff19af21faabb6a7c3bb3207e7e785fe15357146b88c6c27f01.json new file mode 100644 index 00000000..dfd28f92 --- /dev/null +++ b/db/db-sqlx-maria/.sqlx/query-dd9b4dec39405ff19af21faabb6a7c3bb3207e7e785fe15357146b88c6c27f01.json @@ -0,0 +1,25 @@ +{ + "db_name": "MySQL", + "query": "SELECT secret FROM mcaptcha_users WHERE name = ?", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "secret", + "type_info": { + "type": "VarString", + "flags": "NOT_NULL | UNIQUE_KEY | NO_DEFAULT_VALUE", + "char_set": 224, + "max_size": 200 + } + } + ], + "parameters": { + "Right": 1 + }, + "nullable": [ + false + ] + }, + "hash": "dd9b4dec39405ff19af21faabb6a7c3bb3207e7e785fe15357146b88c6c27f01" +} diff --git a/db/db-sqlx-maria/.sqlx/query-df6de3b96afcfb7f364f98954995e506b19e80e7f88204405d970c360ad5e1a0.json b/db/db-sqlx-maria/.sqlx/query-df6de3b96afcfb7f364f98954995e506b19e80e7f88204405d970c360ad5e1a0.json new file mode 100644 index 00000000..eda79139 --- /dev/null +++ b/db/db-sqlx-maria/.sqlx/query-df6de3b96afcfb7f364f98954995e506b19e80e7f88204405d970c360ad5e1a0.json @@ -0,0 +1,36 @@ +{ + "db_name": "MySQL", + "query": "SELECT difficulty_factor, visitor_threshold FROM mcaptcha_levels WHERE\n config_id = (\n SELECT config_id FROM mcaptcha_config where captcha_key= (?)\n AND user_id = (SELECT ID from mcaptcha_users WHERE name = ?)\n )\n ORDER BY difficulty_factor ASC;", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "difficulty_factor", + "type_info": { + "type": "Long", + "flags": "NOT_NULL | NO_DEFAULT_VALUE", + "char_set": 63, + "max_size": 11 + } + }, + { + "ordinal": 1, + "name": "visitor_threshold", + "type_info": { + "type": "Long", + "flags": "NOT_NULL | NO_DEFAULT_VALUE", + "char_set": 63, + "max_size": 11 + } + } + ], + "parameters": { + "Right": 2 + }, + "nullable": [ + false, + false + ] + }, + "hash": "df6de3b96afcfb7f364f98954995e506b19e80e7f88204405d970c360ad5e1a0" +} diff --git a/db/db-sqlx-maria/.sqlx/query-e2b0b85f2afac1cbca43ce684641bf75ef070e44ce3d00404fc6151d2f4d7bcf.json b/db/db-sqlx-maria/.sqlx/query-e2b0b85f2afac1cbca43ce684641bf75ef070e44ce3d00404fc6151d2f4d7bcf.json new file mode 100644 index 00000000..9fe6d052 --- /dev/null +++ b/db/db-sqlx-maria/.sqlx/query-e2b0b85f2afac1cbca43ce684641bf75ef070e44ce3d00404fc6151d2f4d7bcf.json @@ -0,0 +1,12 @@ +{ + "db_name": "MySQL", + "query": "INSERT INTO mcaptcha_pow_solved_stats \n (config_id, time) VALUES ((SELECT config_id FROM mcaptcha_config where captcha_key= ?), ?)", + "describe": { + "columns": [], + "parameters": { + "Right": 2 + }, + "nullable": [] + }, + "hash": "e2b0b85f2afac1cbca43ce684641bf75ef070e44ce3d00404fc6151d2f4d7bcf" +} diff --git a/db/db-sqlx-maria/.sqlx/query-e4d9bf156a368dcee1433dd5ced9f1991aa15f84e0ade916433aada40f68f0aa.json b/db/db-sqlx-maria/.sqlx/query-e4d9bf156a368dcee1433dd5ced9f1991aa15f84e0ade916433aada40f68f0aa.json new file mode 100644 index 00000000..b88a380d --- /dev/null +++ b/db/db-sqlx-maria/.sqlx/query-e4d9bf156a368dcee1433dd5ced9f1991aa15f84e0ade916433aada40f68f0aa.json @@ -0,0 +1,12 @@ +{ + "db_name": "MySQL", + "query": "\n DELETE FROM\n mcaptcha_psuedo_campaign_id\n WHERE config_id = (\n SELECT config_id FROM mcaptcha_config WHERE captcha_key = ?\n );", + "describe": { + "columns": [], + "parameters": { + "Right": 1 + }, + "nullable": [] + }, + "hash": "e4d9bf156a368dcee1433dd5ced9f1991aa15f84e0ade916433aada40f68f0aa" +} diff --git a/db/db-sqlx-maria/.sqlx/query-e6569a6064d0e07abea4c0bd4686cdfdaac64f0109ac40efaed06a744a2eaf5e.json b/db/db-sqlx-maria/.sqlx/query-e6569a6064d0e07abea4c0bd4686cdfdaac64f0109ac40efaed06a744a2eaf5e.json new file mode 100644 index 00000000..d6518345 --- /dev/null +++ b/db/db-sqlx-maria/.sqlx/query-e6569a6064d0e07abea4c0bd4686cdfdaac64f0109ac40efaed06a744a2eaf5e.json @@ -0,0 +1,25 @@ +{ + "db_name": "MySQL", + "query": "SELECT name from mcaptcha_users WHERE name = ?", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "name", + "type_info": { + "type": "VarString", + "flags": "NOT_NULL | UNIQUE_KEY | NO_DEFAULT_VALUE", + "char_set": 224, + "max_size": 400 + } + } + ], + "parameters": { + "Right": 1 + }, + "nullable": [ + false + ] + }, + "hash": "e6569a6064d0e07abea4c0bd4686cdfdaac64f0109ac40efaed06a744a2eaf5e" +} diff --git a/db/db-sqlx-maria/.sqlx/query-e91116ebce127833488130cf1060e0817e5677f39588632452b8d621688c405a.json b/db/db-sqlx-maria/.sqlx/query-e91116ebce127833488130cf1060e0817e5677f39588632452b8d621688c405a.json new file mode 100644 index 00000000..32f009da --- /dev/null +++ b/db/db-sqlx-maria/.sqlx/query-e91116ebce127833488130cf1060e0817e5677f39588632452b8d621688c405a.json @@ -0,0 +1,47 @@ +{ + "db_name": "MySQL", + "query": "SELECT \n avg_traffic, \n peak_sustainable_traffic, \n broke_my_site_traffic \n FROM \n mcaptcha_sitekey_user_provided_avg_traffic \n WHERE \n config_id = (\n SELECT \n config_id \n FROM \n mcaptcha_config \n WHERE \n captcha_key = ? \n AND user_id = (\n SELECT \n id \n FROM \n mcaptcha_users \n WHERE \n NAME = ?\n )\n )\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "avg_traffic", + "type_info": { + "type": "Long", + "flags": "NOT_NULL | NO_DEFAULT_VALUE", + "char_set": 63, + "max_size": 11 + } + }, + { + "ordinal": 1, + "name": "peak_sustainable_traffic", + "type_info": { + "type": "Long", + "flags": "NOT_NULL | NO_DEFAULT_VALUE", + "char_set": 63, + "max_size": 11 + } + }, + { + "ordinal": 2, + "name": "broke_my_site_traffic", + "type_info": { + "type": "Long", + "flags": "", + "char_set": 63, + "max_size": 11 + } + } + ], + "parameters": { + "Right": 2 + }, + "nullable": [ + false, + false, + true + ] + }, + "hash": "e91116ebce127833488130cf1060e0817e5677f39588632452b8d621688c405a" +} diff --git a/db/db-sqlx-maria/.sqlx/query-ed943cbf7e16536d81010255ce2f5beb207b2b9d44cb859fa9f2233405b80ae0.json b/db/db-sqlx-maria/.sqlx/query-ed943cbf7e16536d81010255ce2f5beb207b2b9d44cb859fa9f2233405b80ae0.json new file mode 100644 index 00000000..2d136905 --- /dev/null +++ b/db/db-sqlx-maria/.sqlx/query-ed943cbf7e16536d81010255ce2f5beb207b2b9d44cb859fa9f2233405b80ae0.json @@ -0,0 +1,36 @@ +{ + "db_name": "MySQL", + "query": "SELECT name, password FROM mcaptcha_users WHERE email = ?", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "name", + "type_info": { + "type": "VarString", + "flags": "NOT_NULL | UNIQUE_KEY | NO_DEFAULT_VALUE", + "char_set": 224, + "max_size": 400 + } + }, + { + "ordinal": 1, + "name": "password", + "type_info": { + "type": "Blob", + "flags": "NOT_NULL | BLOB | NO_DEFAULT_VALUE", + "char_set": 224, + "max_size": 262140 + } + } + ], + "parameters": { + "Right": 1 + }, + "nullable": [ + false, + false + ] + }, + "hash": "ed943cbf7e16536d81010255ce2f5beb207b2b9d44cb859fa9f2233405b80ae0" +} diff --git a/db/db-sqlx-maria/.sqlx/query-f987c4568ab28271d87af47f473b18cf41130a483333e81d5f50199758cbb98b.json b/db/db-sqlx-maria/.sqlx/query-f987c4568ab28271d87af47f473b18cf41130a483333e81d5f50199758cbb98b.json new file mode 100644 index 00000000..9f124cf8 --- /dev/null +++ b/db/db-sqlx-maria/.sqlx/query-f987c4568ab28271d87af47f473b18cf41130a483333e81d5f50199758cbb98b.json @@ -0,0 +1,12 @@ +{ + "db_name": "MySQL", + "query": "INSERT INTO mcaptcha_pow_analytics \n (config_id, time, difficulty_factor, worker_type)\n VALUES ((SELECT config_id FROM mcaptcha_config where captcha_key= ?), ?, ?, ?)", + "describe": { + "columns": [], + "parameters": { + "Right": 4 + }, + "nullable": [] + }, + "hash": "f987c4568ab28271d87af47f473b18cf41130a483333e81d5f50199758cbb98b" +} diff --git a/db/db-sqlx-maria/.sqlx/query-f9f2ed1b2f47828d5d976d2e470e106d54b8a2357f9d525ef0cdb1f7965aa61c.json b/db/db-sqlx-maria/.sqlx/query-f9f2ed1b2f47828d5d976d2e470e106d54b8a2357f9d525ef0cdb1f7965aa61c.json new file mode 100644 index 00000000..2916120b --- /dev/null +++ b/db/db-sqlx-maria/.sqlx/query-f9f2ed1b2f47828d5d976d2e470e106d54b8a2357f9d525ef0cdb1f7965aa61c.json @@ -0,0 +1,12 @@ +{ + "db_name": "MySQL", + "query": "-- SPDX-FileCopyrightText: 2023 Aravinth Manivannan \n--\n-- SPDX-License-Identifier: AGPL-3.0-or-later\n\n-- mark a notification as read\nUPDATE mcaptcha_notifications\n SET read_notification = TRUE\nWHERE \n mcaptcha_notifications.id = ?\nAND\n mcaptcha_notifications.rx = (\n SELECT\n id\n FROM\n mcaptcha_users\n WHERE\n name = ?\n );\n", + "describe": { + "columns": [], + "parameters": { + "Right": 2 + }, + "nullable": [] + }, + "hash": "f9f2ed1b2f47828d5d976d2e470e106d54b8a2357f9d525ef0cdb1f7965aa61c" +} diff --git a/db/db-sqlx-maria/.sqlx/query-fc717ff0827ccfaa1cc61a71cc7f71c348ebb03d35895c54b011c03121ad2385.json b/db/db-sqlx-maria/.sqlx/query-fc717ff0827ccfaa1cc61a71cc7f71c348ebb03d35895c54b011c03121ad2385.json new file mode 100644 index 00000000..17145d61 --- /dev/null +++ b/db/db-sqlx-maria/.sqlx/query-fc717ff0827ccfaa1cc61a71cc7f71c348ebb03d35895c54b011c03121ad2385.json @@ -0,0 +1,12 @@ +{ + "db_name": "MySQL", + "query": "DELETE FROM mcaptcha_sitekey_user_provided_avg_traffic\n WHERE config_id = (\n SELECT config_id \n FROM \n mcaptcha_config \n WHERE\n captcha_key = ?\n AND \n user_id = (SELECT ID FROM mcaptcha_users WHERE name = ?)\n );", + "describe": { + "columns": [], + "parameters": { + "Right": 2 + }, + "nullable": [] + }, + "hash": "fc717ff0827ccfaa1cc61a71cc7f71c348ebb03d35895c54b011c03121ad2385" +} diff --git a/db/db-sqlx-maria/Cargo.toml b/db/db-sqlx-maria/Cargo.toml index ab1aa8a7..b5e8e59a 100644 --- a/db/db-sqlx-maria/Cargo.toml +++ b/db/db-sqlx-maria/Cargo.toml @@ -12,11 +12,11 @@ authors = ["realaravinth "] async-trait = "0.1.51" db-core = {path = "../db-core"} futures = "0.3.15" -sqlx = { version = "0.5.13", features = [ "runtime-actix-rustls", "mysql", "time", "offline" ] } +sqlx = { version = "0.7", features = [ "runtime-tokio-rustls", "mysql", "time"] } uuid = { version = "1.4.0", features = ["v4", "serde"] } [dev-dependencies] actix-rt = "2" -sqlx = { version = "0.5.13", features = [ "runtime-actix-rustls", "mysql", "time", "offline" ] } +sqlx = { version = "0.7", features = [ "runtime-tokio-rustls", "mysql", "time" ] } db-core = {path = "../db-core", features = ["test"]} url = { version = "2.2.2", features = ["serde"] } diff --git a/db/db-sqlx-maria/src/lib.rs b/db/db-sqlx-maria/src/lib.rs index f3b0f7a8..7fe6ee67 100644 --- a/db/db-sqlx-maria/src/lib.rs +++ b/db/db-sqlx-maria/src/lib.rs @@ -61,7 +61,7 @@ impl Connect for ConnectionOptions { let mut connect_options = sqlx::mysql::MySqlConnectOptions::from_str(&fresh.url).unwrap(); if fresh.disable_logging { - connect_options.disable_statement_logging(); + connect_options = connect_options.disable_statement_logging(); } fresh .pool_options diff --git a/db/db-sqlx-postgres/.sqlx/query-017576128f1c63aee062799a33f872457fe19f5d6429d0af312dc00c244b31cb.json b/db/db-sqlx-postgres/.sqlx/query-017576128f1c63aee062799a33f872457fe19f5d6429d0af312dc00c244b31cb.json new file mode 100644 index 00000000..050aa6f9 --- /dev/null +++ b/db/db-sqlx-postgres/.sqlx/query-017576128f1c63aee062799a33f872457fe19f5d6429d0af312dc00c244b31cb.json @@ -0,0 +1,42 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT id, time, difficulty_factor, worker_type FROM mcaptcha_pow_analytics\n WHERE \n config_id = (\n SELECT \n config_id FROM mcaptcha_config \n WHERE \n key = $1\n )\n ORDER BY ID\n OFFSET $2 LIMIT $3\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "time", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "difficulty_factor", + "type_info": "Int4" + }, + { + "ordinal": 3, + "name": "worker_type", + "type_info": "Varchar" + } + ], + "parameters": { + "Left": [ + "Text", + "Int8", + "Int8" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "017576128f1c63aee062799a33f872457fe19f5d6429d0af312dc00c244b31cb" +} diff --git a/db/db-sqlx-postgres/.sqlx/query-02deb524bb12632af9b7883975f75fdc30d6775d836aff647add1dffd1a4bc00.json b/db/db-sqlx-postgres/.sqlx/query-02deb524bb12632af9b7883975f75fdc30d6775d836aff647add1dffd1a4bc00.json new file mode 100644 index 00000000..6f56b076 --- /dev/null +++ b/db/db-sqlx-postgres/.sqlx/query-02deb524bb12632af9b7883975f75fdc30d6775d836aff647add1dffd1a4bc00.json @@ -0,0 +1,41 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT config_id, duration, name, key from mcaptcha_config WHERE\n key = $1 AND\n user_id = (SELECT ID FROM mcaptcha_users WHERE name = $2) ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "config_id", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "duration", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "name", + "type_info": "Varchar" + }, + { + "ordinal": 3, + "name": "key", + "type_info": "Varchar" + } + ], + "parameters": { + "Left": [ + "Text", + "Text" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "02deb524bb12632af9b7883975f75fdc30d6775d836aff647add1dffd1a4bc00" +} diff --git a/db/db-sqlx-postgres/.sqlx/query-044e2036a518de2ccac9318ccba07f7ce10e4a1c1d51d0128ea5e8cb94358ac5.json b/db/db-sqlx-postgres/.sqlx/query-044e2036a518de2ccac9318ccba07f7ce10e4a1c1d51d0128ea5e8cb94358ac5.json new file mode 100644 index 00000000..68524f15 --- /dev/null +++ b/db/db-sqlx-postgres/.sqlx/query-044e2036a518de2ccac9318ccba07f7ce10e4a1c1d51d0128ea5e8cb94358ac5.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO mcaptcha_pow_confirmed_stats \n (config_id, time) VALUES ((SELECT config_id FROM mcaptcha_config WHERE key = $1), $2)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text", + "Timestamptz" + ] + }, + "nullable": [] + }, + "hash": "044e2036a518de2ccac9318ccba07f7ce10e4a1c1d51d0128ea5e8cb94358ac5" +} diff --git a/db/db-sqlx-postgres/.sqlx/query-0840af95cc17c8ea6fc994e53696d4dec39ef9b4b6dd6c58c21cc44ccbb4bd09.json b/db/db-sqlx-postgres/.sqlx/query-0840af95cc17c8ea6fc994e53696d4dec39ef9b4b6dd6c58c21cc44ccbb4bd09.json new file mode 100644 index 00000000..ab2bb228 --- /dev/null +++ b/db/db-sqlx-postgres/.sqlx/query-0840af95cc17c8ea6fc994e53696d4dec39ef9b4b6dd6c58c21cc44ccbb4bd09.json @@ -0,0 +1,18 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO mcaptcha_sitekey_user_provided_avg_traffic (\n config_id,\n avg_traffic,\n peak_sustainable_traffic,\n broke_my_site_traffic\n ) VALUES ( \n (SELECT config_id FROM mcaptcha_config WHERE key = ($1)\n AND user_id = (SELECT ID FROM mcaptcha_users WHERE name = $2)\n ), $3, $4, $5)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text", + "Text", + "Int4", + "Int4", + "Int4" + ] + }, + "nullable": [] + }, + "hash": "0840af95cc17c8ea6fc994e53696d4dec39ef9b4b6dd6c58c21cc44ccbb4bd09" +} diff --git a/db/db-sqlx-postgres/.sqlx/query-0e7a1a38019c5e88ebd096fc5f6031aaa7f337fe735aa44c4e31bd6e51163749.json b/db/db-sqlx-postgres/.sqlx/query-0e7a1a38019c5e88ebd096fc5f6031aaa7f337fe735aa44c4e31bd6e51163749.json new file mode 100644 index 00000000..36994fc2 --- /dev/null +++ b/db/db-sqlx-postgres/.sqlx/query-0e7a1a38019c5e88ebd096fc5f6031aaa7f337fe735aa44c4e31bd6e51163749.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM mcaptcha_sitekey_user_provided_avg_traffic\n WHERE config_id = (\n SELECT config_id \n FROM \n mcaptcha_config \n WHERE\n key = ($1) \n AND \n user_id = (SELECT ID FROM mcaptcha_users WHERE name = $2)\n );", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text", + "Text" + ] + }, + "nullable": [] + }, + "hash": "0e7a1a38019c5e88ebd096fc5f6031aaa7f337fe735aa44c4e31bd6e51163749" +} diff --git a/db/db-sqlx-postgres/.sqlx/query-16864df9cf9a69c299d9ab68bac559c48f4fc433541a10f7c1b60717df2b820e.json b/db/db-sqlx-postgres/.sqlx/query-16864df9cf9a69c299d9ab68bac559c48f4fc433541a10f7c1b60717df2b820e.json new file mode 100644 index 00000000..f4299db6 --- /dev/null +++ b/db/db-sqlx-postgres/.sqlx/query-16864df9cf9a69c299d9ab68bac559c48f4fc433541a10f7c1b60717df2b820e.json @@ -0,0 +1,40 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT key, name, config_id, duration FROM mcaptcha_config WHERE\n user_id = (SELECT ID FROM mcaptcha_users WHERE name = $1) ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "key", + "type_info": "Varchar" + }, + { + "ordinal": 1, + "name": "name", + "type_info": "Varchar" + }, + { + "ordinal": 2, + "name": "config_id", + "type_info": "Int4" + }, + { + "ordinal": 3, + "name": "duration", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "16864df9cf9a69c299d9ab68bac559c48f4fc433541a10f7c1b60717df2b820e" +} diff --git a/db/db-sqlx-postgres/.sqlx/query-1e9fe69b23e4bfa7bb369455753100307e334e8dbaf02ff37cda08992fe95910.json b/db/db-sqlx-postgres/.sqlx/query-1e9fe69b23e4bfa7bb369455753100307e334e8dbaf02ff37cda08992fe95910.json new file mode 100644 index 00000000..5a567f56 --- /dev/null +++ b/db/db-sqlx-postgres/.sqlx/query-1e9fe69b23e4bfa7bb369455753100307e334e8dbaf02ff37cda08992fe95910.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE mcaptcha_users set name = $1\n WHERE name = $2", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Varchar", + "Text" + ] + }, + "nullable": [] + }, + "hash": "1e9fe69b23e4bfa7bb369455753100307e334e8dbaf02ff37cda08992fe95910" +} diff --git a/db/db-sqlx-postgres/.sqlx/query-213ac909efb60f7f5e095fe2d3d1ec4f98fde7d84de011272c788aaf825b6ae2.json b/db/db-sqlx-postgres/.sqlx/query-213ac909efb60f7f5e095fe2d3d1ec4f98fde7d84de011272c788aaf825b6ae2.json new file mode 100644 index 00000000..15f92119 --- /dev/null +++ b/db/db-sqlx-postgres/.sqlx/query-213ac909efb60f7f5e095fe2d3d1ec4f98fde7d84de011272c788aaf825b6ae2.json @@ -0,0 +1,46 @@ +{ + "db_name": "PostgreSQL", + "query": "-- SPDX-FileCopyrightText: 2023 Aravinth Manivannan \n--\n-- SPDX-License-Identifier: AGPL-3.0-or-later\n\n-- gets all unread notifications a user has\nSELECT \n mcaptcha_notifications.id,\n mcaptcha_notifications.heading,\n mcaptcha_notifications.message,\n mcaptcha_notifications.received,\n mcaptcha_users.name\nFROM\n mcaptcha_notifications \nINNER JOIN \n mcaptcha_users \nON \n mcaptcha_notifications.tx = mcaptcha_users.id\nWHERE \n mcaptcha_notifications.rx = (\n SELECT \n id \n FROM \n mcaptcha_users\n WHERE\n name = $1\n )\nAND \n mcaptcha_notifications.read IS NULL;\n", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "id", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "heading", + "type_info": "Varchar" + }, + { + "ordinal": 2, + "name": "message", + "type_info": "Varchar" + }, + { + "ordinal": 3, + "name": "received", + "type_info": "Timestamptz" + }, + { + "ordinal": 4, + "name": "name", + "type_info": "Varchar" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false, + false, + false, + false, + false + ] + }, + "hash": "213ac909efb60f7f5e095fe2d3d1ec4f98fde7d84de011272c788aaf825b6ae2" +} diff --git a/db/db-sqlx-postgres/.sqlx/query-21cdf28d8962389d22c8ddefdad82780f5316737e3d833623512aa12a54a026a.json b/db/db-sqlx-postgres/.sqlx/query-21cdf28d8962389d22c8ddefdad82780f5316737e3d833623512aa12a54a026a.json new file mode 100644 index 00000000..a3ec27bc --- /dev/null +++ b/db/db-sqlx-postgres/.sqlx/query-21cdf28d8962389d22c8ddefdad82780f5316737e3d833623512aa12a54a026a.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT\n key\n FROM\n mcaptcha_config\n WHERE\n config_id = (\n SELECT\n config_id\n FROM\n mcaptcha_psuedo_campaign_id\n WHERE\n psuedo_id = $1\n );", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "key", + "type_info": "Varchar" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false + ] + }, + "hash": "21cdf28d8962389d22c8ddefdad82780f5316737e3d833623512aa12a54a026a" +} diff --git a/db/db-sqlx-postgres/.sqlx/query-307245aaf5b0d692448b80358d6916aa50c507b35e724d66c9b16a16b60e1b38.json b/db/db-sqlx-postgres/.sqlx/query-307245aaf5b0d692448b80358d6916aa50c507b35e724d66c9b16a16b60e1b38.json new file mode 100644 index 00000000..ce4c13f6 --- /dev/null +++ b/db/db-sqlx-postgres/.sqlx/query-307245aaf5b0d692448b80358d6916aa50c507b35e724d66c9b16a16b60e1b38.json @@ -0,0 +1,17 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO mcaptcha_config\n (key, user_id, duration, name)\n VALUES ($1, (SELECT ID FROM mcaptcha_users WHERE name = $2), $3, $4)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Varchar", + "Text", + "Int4", + "Varchar" + ] + }, + "nullable": [] + }, + "hash": "307245aaf5b0d692448b80358d6916aa50c507b35e724d66c9b16a16b60e1b38" +} diff --git a/db/db-sqlx-postgres/.sqlx/query-30ba202b601dd07f41798775c7c59fde7deeae759ec959df46734a66ffd78df7.json b/db/db-sqlx-postgres/.sqlx/query-30ba202b601dd07f41798775c7c59fde7deeae759ec959df46734a66ffd78df7.json new file mode 100644 index 00000000..876a834d --- /dev/null +++ b/db/db-sqlx-postgres/.sqlx/query-30ba202b601dd07f41798775c7c59fde7deeae759ec959df46734a66ffd78df7.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT email FROM mcaptcha_users WHERE name = $1", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "email", + "type_info": "Varchar" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + true + ] + }, + "hash": "30ba202b601dd07f41798775c7c59fde7deeae759ec959df46734a66ffd78df7" +} diff --git a/db/db-sqlx-postgres/.sqlx/query-30d8945806b4c68b6da800395f61c1e480839093bfcda9c693bf1972a65c7d79.json b/db/db-sqlx-postgres/.sqlx/query-30d8945806b4c68b6da800395f61c1e480839093bfcda9c693bf1972a65c7d79.json new file mode 100644 index 00000000..ff652cfc --- /dev/null +++ b/db/db-sqlx-postgres/.sqlx/query-30d8945806b4c68b6da800395f61c1e480839093bfcda9c693bf1972a65c7d79.json @@ -0,0 +1,14 @@ +{ + "db_name": "PostgreSQL", + "query": "\n DELETE FROM\n mcaptcha_psuedo_campaign_id\n WHERE config_id = (\n SELECT config_id FROM mcaptcha_config WHERE key = ($1)\n );", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [] + }, + "hash": "30d8945806b4c68b6da800395f61c1e480839093bfcda9c693bf1972a65c7d79" +} diff --git a/db/db-sqlx-postgres/.sqlx/query-3b1c8128fc48b16d8e8ea6957dd4fbc0eb19ae64748fd7824e9f5e1901dd1726.json b/db/db-sqlx-postgres/.sqlx/query-3b1c8128fc48b16d8e8ea6957dd4fbc0eb19ae64748fd7824e9f5e1901dd1726.json new file mode 100644 index 00000000..fe3ff288 --- /dev/null +++ b/db/db-sqlx-postgres/.sqlx/query-3b1c8128fc48b16d8e8ea6957dd4fbc0eb19ae64748fd7824e9f5e1901dd1726.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE mcaptcha_users set secret = $1\n WHERE name = $2", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Varchar", + "Text" + ] + }, + "nullable": [] + }, + "hash": "3b1c8128fc48b16d8e8ea6957dd4fbc0eb19ae64748fd7824e9f5e1901dd1726" +} diff --git a/db/db-sqlx-postgres/.sqlx/query-3eb1c43ffd2378c4dd59975568c3a180b72d13008f294a91f3e76b785dba295b.json b/db/db-sqlx-postgres/.sqlx/query-3eb1c43ffd2378c4dd59975568c3a180b72d13008f294a91f3e76b785dba295b.json new file mode 100644 index 00000000..391360eb --- /dev/null +++ b/db/db-sqlx-postgres/.sqlx/query-3eb1c43ffd2378c4dd59975568c3a180b72d13008f294a91f3e76b785dba295b.json @@ -0,0 +1,23 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT EXISTS (\n SELECT 1 from mcaptcha_config WHERE key = $1 \n AND user_id = (SELECT ID FROM mcaptcha_users WHERE name = $2)\n )", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "exists", + "type_info": "Bool" + } + ], + "parameters": { + "Left": [ + "Text", + "Text" + ] + }, + "nullable": [ + null + ] + }, + "hash": "3eb1c43ffd2378c4dd59975568c3a180b72d13008f294a91f3e76b785dba295b" +} diff --git a/db/db-sqlx-postgres/.sqlx/query-4303f5c6ef98e0de9d8d3c2d781d3ffaa3dee5f7d27db831d327b26f03ba9d68.json b/db/db-sqlx-postgres/.sqlx/query-4303f5c6ef98e0de9d8d3c2d781d3ffaa3dee5f7d27db831d327b26f03ba9d68.json new file mode 100644 index 00000000..ac538f32 --- /dev/null +++ b/db/db-sqlx-postgres/.sqlx/query-4303f5c6ef98e0de9d8d3c2d781d3ffaa3dee5f7d27db831d327b26f03ba9d68.json @@ -0,0 +1,23 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT time FROM mcaptcha_pow_confirmed_stats \n WHERE \n config_id = (\n SELECT config_id FROM mcaptcha_config \n WHERE \n key = $1\n AND\n user_id = (\n SELECT \n ID FROM mcaptcha_users WHERE name = $2))\n ORDER BY time DESC", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "time", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Text", + "Text" + ] + }, + "nullable": [ + false + ] + }, + "hash": "4303f5c6ef98e0de9d8d3c2d781d3ffaa3dee5f7d27db831d327b26f03ba9d68" +} diff --git a/db/db-sqlx-postgres/.sqlx/query-45d9e9fb6344fe3a18c2529d50c935d3837bfe25c96595beb6970d6067720578.json b/db/db-sqlx-postgres/.sqlx/query-45d9e9fb6344fe3a18c2529d50c935d3837bfe25c96595beb6970d6067720578.json new file mode 100644 index 00000000..0f20e3ad --- /dev/null +++ b/db/db-sqlx-postgres/.sqlx/query-45d9e9fb6344fe3a18c2529d50c935d3837bfe25c96595beb6970d6067720578.json @@ -0,0 +1,17 @@ +{ + "db_name": "PostgreSQL", + "query": "insert into mcaptcha_users \n (name , password, email, secret) values ($1, $2, $3, $4)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Varchar", + "Text", + "Varchar", + "Varchar" + ] + }, + "nullable": [] + }, + "hash": "45d9e9fb6344fe3a18c2529d50c935d3837bfe25c96595beb6970d6067720578" +} diff --git a/db/db-sqlx-postgres/.sqlx/query-47fa50aecfb1499b0a18fa9299643017a1a8d69d4e9980032e0d8f745465d14f.json b/db/db-sqlx-postgres/.sqlx/query-47fa50aecfb1499b0a18fa9299643017a1a8d69d4e9980032e0d8f745465d14f.json new file mode 100644 index 00000000..a0a241ce --- /dev/null +++ b/db/db-sqlx-postgres/.sqlx/query-47fa50aecfb1499b0a18fa9299643017a1a8d69d4e9980032e0d8f745465d14f.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT EXISTS (SELECT 1 from mcaptcha_users WHERE email = $1)", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "exists", + "type_info": "Bool" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + null + ] + }, + "hash": "47fa50aecfb1499b0a18fa9299643017a1a8d69d4e9980032e0d8f745465d14f" +} diff --git a/db/db-sqlx-postgres/.sqlx/query-494d2aed281e1408aeda3606b0814db75aea2878783a2e2f11a4feb6fc48e938.json b/db/db-sqlx-postgres/.sqlx/query-494d2aed281e1408aeda3606b0814db75aea2878783a2e2f11a4feb6fc48e938.json new file mode 100644 index 00000000..c98893a7 --- /dev/null +++ b/db/db-sqlx-postgres/.sqlx/query-494d2aed281e1408aeda3606b0814db75aea2878783a2e2f11a4feb6fc48e938.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT secret FROM mcaptcha_users WHERE ID = (\n SELECT user_id FROM mcaptcha_config WHERE key = $1\n )", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "secret", + "type_info": "Varchar" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false + ] + }, + "hash": "494d2aed281e1408aeda3606b0814db75aea2878783a2e2f11a4feb6fc48e938" +} diff --git a/db/db-sqlx-postgres/.sqlx/query-4a5dfbc5aeb2bab290a09640cc25223d484fbc7549e5bc54f33bab8616725031.json b/db/db-sqlx-postgres/.sqlx/query-4a5dfbc5aeb2bab290a09640cc25223d484fbc7549e5bc54f33bab8616725031.json new file mode 100644 index 00000000..3ddd34e6 --- /dev/null +++ b/db/db-sqlx-postgres/.sqlx/query-4a5dfbc5aeb2bab290a09640cc25223d484fbc7549e5bc54f33bab8616725031.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT EXISTS (SELECT 1 from mcaptcha_config WHERE key = $1)", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "exists", + "type_info": "Bool" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + null + ] + }, + "hash": "4a5dfbc5aeb2bab290a09640cc25223d484fbc7549e5bc54f33bab8616725031" +} diff --git a/db/db-sqlx-postgres/.sqlx/query-507bea10c7f8417c5b1430211d0137299cd561333bf47f7b4887d0ef801d1ea4.json b/db/db-sqlx-postgres/.sqlx/query-507bea10c7f8417c5b1430211d0137299cd561333bf47f7b4887d0ef801d1ea4.json new file mode 100644 index 00000000..97cf3ee2 --- /dev/null +++ b/db/db-sqlx-postgres/.sqlx/query-507bea10c7f8417c5b1430211d0137299cd561333bf47f7b4887d0ef801d1ea4.json @@ -0,0 +1,16 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE mcaptcha_config SET key = $1 \n WHERE key = $2 AND user_id = (SELECT ID FROM mcaptcha_users WHERE name = $3)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Varchar", + "Text", + "Text" + ] + }, + "nullable": [] + }, + "hash": "507bea10c7f8417c5b1430211d0137299cd561333bf47f7b4887d0ef801d1ea4" +} diff --git a/db/db-sqlx-postgres/.sqlx/query-570c22f19fe0b97d78086038c8ef82509dce0bae704d80f9f031c1c47e6a6572.json b/db/db-sqlx-postgres/.sqlx/query-570c22f19fe0b97d78086038c8ef82509dce0bae704d80f9f031c1c47e6a6572.json new file mode 100644 index 00000000..a5533c87 --- /dev/null +++ b/db/db-sqlx-postgres/.sqlx/query-570c22f19fe0b97d78086038c8ef82509dce0bae704d80f9f031c1c47e6a6572.json @@ -0,0 +1,17 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE mcaptcha_config SET name = $1, duration = $2\n WHERE user_id = (SELECT ID FROM mcaptcha_users WHERE name = $3)\n AND key = $4", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Varchar", + "Int4", + "Text", + "Text" + ] + }, + "nullable": [] + }, + "hash": "570c22f19fe0b97d78086038c8ef82509dce0bae704d80f9f031c1c47e6a6572" +} diff --git a/db/db-sqlx-postgres/.sqlx/query-717771c42737feb3f4ca13f2ab11361073ea17b55562a103f660149bf049c5c6.json b/db/db-sqlx-postgres/.sqlx/query-717771c42737feb3f4ca13f2ab11361073ea17b55562a103f660149bf049c5c6.json new file mode 100644 index 00000000..31e38215 --- /dev/null +++ b/db/db-sqlx-postgres/.sqlx/query-717771c42737feb3f4ca13f2ab11361073ea17b55562a103f660149bf049c5c6.json @@ -0,0 +1,29 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT difficulty_factor, visitor_threshold FROM mcaptcha_levels WHERE\n config_id = (\n SELECT config_id FROM mcaptcha_config WHERE key = ($1)\n AND user_id = (SELECT ID from mcaptcha_users WHERE name = $2)\n )\n ORDER BY difficulty_factor ASC;", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "difficulty_factor", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "visitor_threshold", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Text", + "Text" + ] + }, + "nullable": [ + false, + false + ] + }, + "hash": "717771c42737feb3f4ca13f2ab11361073ea17b55562a103f660149bf049c5c6" +} diff --git a/db/db-sqlx-postgres/.sqlx/query-726a794f7599b78ab749d9f887f5c28db38f072b41f691bde35d23ba0dd72409.json b/db/db-sqlx-postgres/.sqlx/query-726a794f7599b78ab749d9f887f5c28db38f072b41f691bde35d23ba0dd72409.json new file mode 100644 index 00000000..2b299324 --- /dev/null +++ b/db/db-sqlx-postgres/.sqlx/query-726a794f7599b78ab749d9f887f5c28db38f072b41f691bde35d23ba0dd72409.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO mcaptcha_pow_fetched_stats \n (config_id, time) VALUES ((SELECT config_id FROM mcaptcha_config WHERE key = $1), $2)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text", + "Timestamptz" + ] + }, + "nullable": [] + }, + "hash": "726a794f7599b78ab749d9f887f5c28db38f072b41f691bde35d23ba0dd72409" +} diff --git a/db/db-sqlx-postgres/.sqlx/query-7c96ae73dd73c1b0e073e3ac78f87f4cba23fdb2cdbed9ba9b0d55f33655582e.json b/db/db-sqlx-postgres/.sqlx/query-7c96ae73dd73c1b0e073e3ac78f87f4cba23fdb2cdbed9ba9b0d55f33655582e.json new file mode 100644 index 00000000..ec64cfbf --- /dev/null +++ b/db/db-sqlx-postgres/.sqlx/query-7c96ae73dd73c1b0e073e3ac78f87f4cba23fdb2cdbed9ba9b0d55f33655582e.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM mcaptcha_levels \n WHERE config_id = (\n SELECT config_id FROM mcaptcha_config where key = ($1) \n AND user_id = (\n SELECT ID from mcaptcha_users WHERE name = $2\n )\n )", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text", + "Text" + ] + }, + "nullable": [] + }, + "hash": "7c96ae73dd73c1b0e073e3ac78f87f4cba23fdb2cdbed9ba9b0d55f33655582e" +} diff --git a/db/db-sqlx-postgres/.sqlx/query-81c779ed4bb59f8b94dea730cbda31f7733ef16d509a3ed607388b5ddef74638.json b/db/db-sqlx-postgres/.sqlx/query-81c779ed4bb59f8b94dea730cbda31f7733ef16d509a3ed607388b5ddef74638.json new file mode 100644 index 00000000..57ed4ac9 --- /dev/null +++ b/db/db-sqlx-postgres/.sqlx/query-81c779ed4bb59f8b94dea730cbda31f7733ef16d509a3ed607388b5ddef74638.json @@ -0,0 +1,16 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO mcaptcha_users \n (name , password, secret) VALUES ($1, $2, $3)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Varchar", + "Text", + "Varchar" + ] + }, + "nullable": [] + }, + "hash": "81c779ed4bb59f8b94dea730cbda31f7733ef16d509a3ed607388b5ddef74638" +} diff --git a/db/db-sqlx-postgres/.sqlx/query-839dfdfc3543b12128cb2b44bf356cd81f3da380963e5684ec3624a0ea4f9547.json b/db/db-sqlx-postgres/.sqlx/query-839dfdfc3543b12128cb2b44bf356cd81f3da380963e5684ec3624a0ea4f9547.json new file mode 100644 index 00000000..26108301 --- /dev/null +++ b/db/db-sqlx-postgres/.sqlx/query-839dfdfc3543b12128cb2b44bf356cd81f3da380963e5684ec3624a0ea4f9547.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT psuedo_id FROM\n mcaptcha_psuedo_campaign_id\n WHERE\n config_id = (SELECT config_id FROM mcaptcha_config WHERE key = ($1));\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "psuedo_id", + "type_info": "Varchar" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false + ] + }, + "hash": "839dfdfc3543b12128cb2b44bf356cd81f3da380963e5684ec3624a0ea4f9547" +} diff --git a/db/db-sqlx-postgres/.sqlx/query-84484cb6892db29121816bc5bff5702b9e857e20aa14e79d080d78ae7593153b.json b/db/db-sqlx-postgres/.sqlx/query-84484cb6892db29121816bc5bff5702b9e857e20aa14e79d080d78ae7593153b.json new file mode 100644 index 00000000..19912a95 --- /dev/null +++ b/db/db-sqlx-postgres/.sqlx/query-84484cb6892db29121816bc5bff5702b9e857e20aa14e79d080d78ae7593153b.json @@ -0,0 +1,23 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT time FROM mcaptcha_pow_solved_stats \n WHERE config_id = (\n SELECT config_id FROM mcaptcha_config \n WHERE \n key = $1\n AND\n user_id = (\n SELECT \n ID FROM mcaptcha_users WHERE name = $2)) \n ORDER BY time DESC", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "time", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Text", + "Text" + ] + }, + "nullable": [ + false + ] + }, + "hash": "84484cb6892db29121816bc5bff5702b9e857e20aa14e79d080d78ae7593153b" +} diff --git a/db/db-sqlx-postgres/.sqlx/query-9753721856a47438c5e72f28fd9d149db10c48e677b4613bf3f1e8487908aac8.json b/db/db-sqlx-postgres/.sqlx/query-9753721856a47438c5e72f28fd9d149db10c48e677b4613bf3f1e8487908aac8.json new file mode 100644 index 00000000..f2f38114 --- /dev/null +++ b/db/db-sqlx-postgres/.sqlx/query-9753721856a47438c5e72f28fd9d149db10c48e677b4613bf3f1e8487908aac8.json @@ -0,0 +1,28 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT difficulty_factor, visitor_threshold FROM mcaptcha_levels WHERE\n config_id = (\n SELECT config_id FROM mcaptcha_config WHERE key = ($1)\n ) ORDER BY difficulty_factor ASC;", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "difficulty_factor", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "visitor_threshold", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false, + false + ] + }, + "hash": "9753721856a47438c5e72f28fd9d149db10c48e677b4613bf3f1e8487908aac8" +} diff --git a/db/db-sqlx-postgres/.sqlx/query-ad196ab3ef9dc32f6de2313577ccd6c26eae9ab19df5f71ce182651983efb99a.json b/db/db-sqlx-postgres/.sqlx/query-ad196ab3ef9dc32f6de2313577ccd6c26eae9ab19df5f71ce182651983efb99a.json new file mode 100644 index 00000000..d6f8b18d --- /dev/null +++ b/db/db-sqlx-postgres/.sqlx/query-ad196ab3ef9dc32f6de2313577ccd6c26eae9ab19df5f71ce182651983efb99a.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT duration FROM mcaptcha_config \n WHERE key = $1", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "duration", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false + ] + }, + "hash": "ad196ab3ef9dc32f6de2313577ccd6c26eae9ab19df5f71ce182651983efb99a" +} diff --git a/db/db-sqlx-postgres/.sqlx/query-ad23588ee4bcbb13e208460ce21e2fa9f1373893934b530b339fea10360b34a8.json b/db/db-sqlx-postgres/.sqlx/query-ad23588ee4bcbb13e208460ce21e2fa9f1373893934b530b339fea10360b34a8.json new file mode 100644 index 00000000..82676020 --- /dev/null +++ b/db/db-sqlx-postgres/.sqlx/query-ad23588ee4bcbb13e208460ce21e2fa9f1373893934b530b339fea10360b34a8.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT EXISTS (SELECT 1 from mcaptcha_users WHERE name = $1)", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "exists", + "type_info": "Bool" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + null + ] + }, + "hash": "ad23588ee4bcbb13e208460ce21e2fa9f1373893934b530b339fea10360b34a8" +} diff --git a/db/db-sqlx-postgres/.sqlx/query-af47990880a92c63d1cf5192203899c72621479dc6bb47859fb4498264b78033.json b/db/db-sqlx-postgres/.sqlx/query-af47990880a92c63d1cf5192203899c72621479dc6bb47859fb4498264b78033.json new file mode 100644 index 00000000..b46ae4f7 --- /dev/null +++ b/db/db-sqlx-postgres/.sqlx/query-af47990880a92c63d1cf5192203899c72621479dc6bb47859fb4498264b78033.json @@ -0,0 +1,17 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO mcaptcha_pow_analytics \n (config_id, time, difficulty_factor, worker_type)\n VALUES ((SELECT config_id FROM mcaptcha_config WHERE key = $1), $2, $3, $4)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text", + "Int4", + "Int4", + "Varchar" + ] + }, + "nullable": [] + }, + "hash": "af47990880a92c63d1cf5192203899c72621479dc6bb47859fb4498264b78033" +} diff --git a/db/db-sqlx-postgres/.sqlx/query-b465e974155aeaaa128896d4261505a32845dbe52dac07908c1d16810bfde4dc.json b/db/db-sqlx-postgres/.sqlx/query-b465e974155aeaaa128896d4261505a32845dbe52dac07908c1d16810bfde4dc.json new file mode 100644 index 00000000..fc656a6a --- /dev/null +++ b/db/db-sqlx-postgres/.sqlx/query-b465e974155aeaaa128896d4261505a32845dbe52dac07908c1d16810bfde4dc.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "-- SPDX-FileCopyrightText: 2023 Aravinth Manivannan \n--\n-- SPDX-License-Identifier: AGPL-3.0-or-later\n\n-- mark a notification as read\nUPDATE mcaptcha_notifications\n SET read = TRUE\nWHERE \n mcaptcha_notifications.id = $1\nAND\n mcaptcha_notifications.rx = (\n SELECT\n id\n FROM\n mcaptcha_users\n WHERE\n name = $2\n );\n", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4", + "Text" + ] + }, + "nullable": [] + }, + "hash": "b465e974155aeaaa128896d4261505a32845dbe52dac07908c1d16810bfde4dc" +} diff --git a/db/db-sqlx-postgres/.sqlx/query-b67da576ff30a1bc8b1c0a79eff07f0622bd9ea035d3de15b91f5e1e8a5fda9b.json b/db/db-sqlx-postgres/.sqlx/query-b67da576ff30a1bc8b1c0a79eff07f0622bd9ea035d3de15b91f5e1e8a5fda9b.json new file mode 100644 index 00000000..8a49c095 --- /dev/null +++ b/db/db-sqlx-postgres/.sqlx/query-b67da576ff30a1bc8b1c0a79eff07f0622bd9ea035d3de15b91f5e1e8a5fda9b.json @@ -0,0 +1,14 @@ +{ + "db_name": "PostgreSQL", + "query": "\n DELETE FROM\n mcaptcha_pow_analytics\n WHERE\n config_id = (\n SELECT config_id FROM mcaptcha_config WHERE key = $1\n )\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [] + }, + "hash": "b67da576ff30a1bc8b1c0a79eff07f0622bd9ea035d3de15b91f5e1e8a5fda9b" +} diff --git a/db/db-sqlx-postgres/.sqlx/query-b97d810814fbeb2df19f47bcfa381bc6fb7ac6832d040b377cf4fca2ca896cfb.json b/db/db-sqlx-postgres/.sqlx/query-b97d810814fbeb2df19f47bcfa381bc6fb7ac6832d040b377cf4fca2ca896cfb.json new file mode 100644 index 00000000..a89812c1 --- /dev/null +++ b/db/db-sqlx-postgres/.sqlx/query-b97d810814fbeb2df19f47bcfa381bc6fb7ac6832d040b377cf4fca2ca896cfb.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE mcaptcha_users set email = $1\n WHERE name = $2", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Varchar", + "Text" + ] + }, + "nullable": [] + }, + "hash": "b97d810814fbeb2df19f47bcfa381bc6fb7ac6832d040b377cf4fca2ca896cfb" +} diff --git a/db/db-sqlx-postgres/.sqlx/query-bb6443e1df704294abbbdb563f1bf46660d0f3462c0c35c10a533446fc7c53e8.json b/db/db-sqlx-postgres/.sqlx/query-bb6443e1df704294abbbdb563f1bf46660d0f3462c0c35c10a533446fc7c53e8.json new file mode 100644 index 00000000..a0812b72 --- /dev/null +++ b/db/db-sqlx-postgres/.sqlx/query-bb6443e1df704294abbbdb563f1bf46660d0f3462c0c35c10a533446fc7c53e8.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM mcaptcha_config WHERE key = ($1)\n AND\n user_id = (SELECT ID FROM mcaptcha_users WHERE name = $2)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text", + "Text" + ] + }, + "nullable": [] + }, + "hash": "bb6443e1df704294abbbdb563f1bf46660d0f3462c0c35c10a533446fc7c53e8" +} diff --git a/db/db-sqlx-postgres/.sqlx/query-bdf2e2781bfa2e9c81c18ef8df7230809d3b20274685a35b1c544804f2a58241.json b/db/db-sqlx-postgres/.sqlx/query-bdf2e2781bfa2e9c81c18ef8df7230809d3b20274685a35b1c544804f2a58241.json new file mode 100644 index 00000000..8af267af --- /dev/null +++ b/db/db-sqlx-postgres/.sqlx/query-bdf2e2781bfa2e9c81c18ef8df7230809d3b20274685a35b1c544804f2a58241.json @@ -0,0 +1,28 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT name, password FROM mcaptcha_users WHERE email = ($1)", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "name", + "type_info": "Varchar" + }, + { + "ordinal": 1, + "name": "password", + "type_info": "Text" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false, + false + ] + }, + "hash": "bdf2e2781bfa2e9c81c18ef8df7230809d3b20274685a35b1c544804f2a58241" +} diff --git a/db/db-sqlx-postgres/.sqlx/query-c1bb8e02d1f9dc28322309d055de3c40ed4e1a1b9453a7e5a93a70e5186d762d.json b/db/db-sqlx-postgres/.sqlx/query-c1bb8e02d1f9dc28322309d055de3c40ed4e1a1b9453a7e5a93a70e5186d762d.json new file mode 100644 index 00000000..7359697a --- /dev/null +++ b/db/db-sqlx-postgres/.sqlx/query-c1bb8e02d1f9dc28322309d055de3c40ed4e1a1b9453a7e5a93a70e5186d762d.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO\n mcaptcha_psuedo_campaign_id (config_id, psuedo_id)\n VALUES (\n (SELECT config_id FROM mcaptcha_config WHERE key = ($1)),\n $2\n );", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text", + "Varchar" + ] + }, + "nullable": [] + }, + "hash": "c1bb8e02d1f9dc28322309d055de3c40ed4e1a1b9453a7e5a93a70e5186d762d" +} diff --git a/db/db-sqlx-postgres/.sqlx/query-c2e167e56242de7e0a835e25004b15ca8340545fa0ca7ac8f3293157d2d03d98.json b/db/db-sqlx-postgres/.sqlx/query-c2e167e56242de7e0a835e25004b15ca8340545fa0ca7ac8f3293157d2d03d98.json new file mode 100644 index 00000000..69079452 --- /dev/null +++ b/db/db-sqlx-postgres/.sqlx/query-c2e167e56242de7e0a835e25004b15ca8340545fa0ca7ac8f3293157d2d03d98.json @@ -0,0 +1,35 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT \n avg_traffic, \n peak_sustainable_traffic, \n broke_my_site_traffic \n FROM \n mcaptcha_sitekey_user_provided_avg_traffic \n WHERE \n config_id = (\n SELECT \n config_id \n FROM \n mcaptcha_config \n WHERE \n KEY = $1 \n AND user_id = (\n SELECT \n id \n FROM \n mcaptcha_users \n WHERE \n NAME = $2\n )\n )\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "avg_traffic", + "type_info": "Int4" + }, + { + "ordinal": 1, + "name": "peak_sustainable_traffic", + "type_info": "Int4" + }, + { + "ordinal": 2, + "name": "broke_my_site_traffic", + "type_info": "Int4" + } + ], + "parameters": { + "Left": [ + "Text", + "Text" + ] + }, + "nullable": [ + false, + false, + true + ] + }, + "hash": "c2e167e56242de7e0a835e25004b15ca8340545fa0ca7ac8f3293157d2d03d98" +} diff --git a/db/db-sqlx-postgres/.sqlx/query-c399efd5db1284dcb470c40f9b076851f77498c75a63a3b151d4a111bd3e2957.json b/db/db-sqlx-postgres/.sqlx/query-c399efd5db1284dcb470c40f9b076851f77498c75a63a3b151d4a111bd3e2957.json new file mode 100644 index 00000000..adc57cba --- /dev/null +++ b/db/db-sqlx-postgres/.sqlx/query-c399efd5db1284dcb470c40f9b076851f77498c75a63a3b151d4a111bd3e2957.json @@ -0,0 +1,23 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT time FROM mcaptcha_pow_fetched_stats\n WHERE \n config_id = (\n SELECT \n config_id FROM mcaptcha_config \n WHERE \n key = $1\n AND\n user_id = (\n SELECT \n ID FROM mcaptcha_users WHERE name = $2))\n ORDER BY time DESC", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "time", + "type_info": "Timestamptz" + } + ], + "parameters": { + "Left": [ + "Text", + "Text" + ] + }, + "nullable": [ + false + ] + }, + "hash": "c399efd5db1284dcb470c40f9b076851f77498c75a63a3b151d4a111bd3e2957" +} diff --git a/db/db-sqlx-postgres/.sqlx/query-ca9d5241f1234d1825f7ead391ebe9099fca776e7101ac6e1761881606def5fa.json b/db/db-sqlx-postgres/.sqlx/query-ca9d5241f1234d1825f7ead391ebe9099fca776e7101ac6e1761881606def5fa.json new file mode 100644 index 00000000..7a35eccf --- /dev/null +++ b/db/db-sqlx-postgres/.sqlx/query-ca9d5241f1234d1825f7ead391ebe9099fca776e7101ac6e1761881606def5fa.json @@ -0,0 +1,14 @@ +{ + "db_name": "PostgreSQL", + "query": "DELETE FROM mcaptcha_users WHERE name = ($1)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [] + }, + "hash": "ca9d5241f1234d1825f7ead391ebe9099fca776e7101ac6e1761881606def5fa" +} diff --git a/db/db-sqlx-postgres/.sqlx/query-d7dd6cd6a7626e79c62377b2d59115067c5851ec044911ff8833779a08bbb8f7.json b/db/db-sqlx-postgres/.sqlx/query-d7dd6cd6a7626e79c62377b2d59115067c5851ec044911ff8833779a08bbb8f7.json new file mode 100644 index 00000000..ab4d62bb --- /dev/null +++ b/db/db-sqlx-postgres/.sqlx/query-d7dd6cd6a7626e79c62377b2d59115067c5851ec044911ff8833779a08bbb8f7.json @@ -0,0 +1,18 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO mcaptcha_notifications (\n heading, message, tx, rx, received)\n VALUES (\n $1, $2,\n (SELECT ID FROM mcaptcha_users WHERE name = $3),\n (SELECT ID FROM mcaptcha_users WHERE name = $4),\n $5\n );", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Varchar", + "Varchar", + "Text", + "Text", + "Timestamptz" + ] + }, + "nullable": [] + }, + "hash": "d7dd6cd6a7626e79c62377b2d59115067c5851ec044911ff8833779a08bbb8f7" +} diff --git a/db/db-sqlx-postgres/.sqlx/query-dbe4307651d94bc6db4f1d8b2c6d076fde6280983d59593216d7765cbbdd669c.json b/db/db-sqlx-postgres/.sqlx/query-dbe4307651d94bc6db4f1d8b2c6d076fde6280983d59593216d7765cbbdd669c.json new file mode 100644 index 00000000..d88db237 --- /dev/null +++ b/db/db-sqlx-postgres/.sqlx/query-dbe4307651d94bc6db4f1d8b2c6d076fde6280983d59593216d7765cbbdd669c.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO mcaptcha_pow_solved_stats \n (config_id, time) VALUES ((SELECT config_id FROM mcaptcha_config WHERE key = $1), $2)", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text", + "Timestamptz" + ] + }, + "nullable": [] + }, + "hash": "dbe4307651d94bc6db4f1d8b2c6d076fde6280983d59593216d7765cbbdd669c" +} diff --git a/db/db-sqlx-postgres/.sqlx/query-e4c710d33b709aee262fa0704372ac216d98851447ef4fbe221740b7ae4ea422.json b/db/db-sqlx-postgres/.sqlx/query-e4c710d33b709aee262fa0704372ac216d98851447ef4fbe221740b7ae4ea422.json new file mode 100644 index 00000000..9c8247ca --- /dev/null +++ b/db/db-sqlx-postgres/.sqlx/query-e4c710d33b709aee262fa0704372ac216d98851447ef4fbe221740b7ae4ea422.json @@ -0,0 +1,22 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT secret FROM mcaptcha_users WHERE name = ($1)", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "secret", + "type_info": "Varchar" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false + ] + }, + "hash": "e4c710d33b709aee262fa0704372ac216d98851447ef4fbe221740b7ae4ea422" +} diff --git a/db/db-sqlx-postgres/.sqlx/query-e9ed973dfd2bfef36d5a4724aef4993328e1d8d3ca397fe6d5408a780efc775a.json b/db/db-sqlx-postgres/.sqlx/query-e9ed973dfd2bfef36d5a4724aef4993328e1d8d3ca397fe6d5408a780efc775a.json new file mode 100644 index 00000000..0889a5a7 --- /dev/null +++ b/db/db-sqlx-postgres/.sqlx/query-e9ed973dfd2bfef36d5a4724aef4993328e1d8d3ca397fe6d5408a780efc775a.json @@ -0,0 +1,15 @@ +{ + "db_name": "PostgreSQL", + "query": "UPDATE mcaptcha_users set password = $1\n WHERE name = $2", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Text", + "Text" + ] + }, + "nullable": [] + }, + "hash": "e9ed973dfd2bfef36d5a4724aef4993328e1d8d3ca397fe6d5408a780efc775a" +} diff --git a/db/db-sqlx-postgres/.sqlx/query-f330cb94c53d33495df94aacec7e4e91d8a920742b89a63d1c59a8ea8937c5c8.json b/db/db-sqlx-postgres/.sqlx/query-f330cb94c53d33495df94aacec7e4e91d8a920742b89a63d1c59a8ea8937c5c8.json new file mode 100644 index 00000000..d45fe92a --- /dev/null +++ b/db/db-sqlx-postgres/.sqlx/query-f330cb94c53d33495df94aacec7e4e91d8a920742b89a63d1c59a8ea8937c5c8.json @@ -0,0 +1,17 @@ +{ + "db_name": "PostgreSQL", + "query": "INSERT INTO mcaptcha_levels (\n difficulty_factor, \n visitor_threshold,\n config_id) VALUES (\n $1, $2, (\n SELECT config_id FROM mcaptcha_config WHERE\n key = ($3) AND user_id = (\n SELECT ID FROM mcaptcha_users WHERE name = $4\n )));", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4", + "Int4", + "Text", + "Text" + ] + }, + "nullable": [] + }, + "hash": "f330cb94c53d33495df94aacec7e4e91d8a920742b89a63d1c59a8ea8937c5c8" +} diff --git a/db/db-sqlx-postgres/.sqlx/query-f3dee60b85be2ae861b6695286e387529dabf3d11202fb2eeb7e75a7bb3bd0a4.json b/db/db-sqlx-postgres/.sqlx/query-f3dee60b85be2ae861b6695286e387529dabf3d11202fb2eeb7e75a7bb3bd0a4.json new file mode 100644 index 00000000..e6c73bf1 --- /dev/null +++ b/db/db-sqlx-postgres/.sqlx/query-f3dee60b85be2ae861b6695286e387529dabf3d11202fb2eeb7e75a7bb3bd0a4.json @@ -0,0 +1,28 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT name, password FROM mcaptcha_users WHERE name = ($1)", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "name", + "type_info": "Varchar" + }, + { + "ordinal": 1, + "name": "password", + "type_info": "Text" + } + ], + "parameters": { + "Left": [ + "Text" + ] + }, + "nullable": [ + false, + false + ] + }, + "hash": "f3dee60b85be2ae861b6695286e387529dabf3d11202fb2eeb7e75a7bb3bd0a4" +} diff --git a/db/db-sqlx-postgres/Cargo.toml b/db/db-sqlx-postgres/Cargo.toml index 27461e7d..aeaf5dd4 100644 --- a/db/db-sqlx-postgres/Cargo.toml +++ b/db/db-sqlx-postgres/Cargo.toml @@ -12,11 +12,11 @@ authors = ["realaravinth "] async-trait = "0.1.51" db-core = {path = "../db-core"} futures = "0.3.15" -sqlx = { version = "0.5.13", features = [ "runtime-actix-rustls", "postgres", "time", "offline" ] } +sqlx = { version = "0.7", features = [ "runtime-tokio-rustls", "postgres", "time" ] } uuid = { version = "1.4.0", features = ["v4", "serde"] } [dev-dependencies] actix-rt = "2" -sqlx = { version = "0.5.13", features = [ "runtime-actix-rustls", "postgres", "time", "offline" ] } +sqlx = { version = "0.7", features = [ "runtime-tokio-rustls", "postgres", "time"] } db-core = {path = "../db-core", features = ["test"]} url = { version = "2.2.2", features = ["serde"] } diff --git a/db/db-sqlx-postgres/src/lib.rs b/db/db-sqlx-postgres/src/lib.rs index dd6d0c9d..5ccde1b4 100644 --- a/db/db-sqlx-postgres/src/lib.rs +++ b/db/db-sqlx-postgres/src/lib.rs @@ -61,7 +61,7 @@ impl Connect for ConnectionOptions { let mut connect_options = sqlx::postgres::PgConnectOptions::from_str(&fresh.url).unwrap(); if fresh.disable_logging { - connect_options.disable_statement_logging(); + connect_options = connect_options.disable_statement_logging(); } fresh .pool_options diff --git a/sqlx-data.json b/sqlx-data.json deleted file mode 100644 index 3b4cb791..00000000 --- a/sqlx-data.json +++ /dev/null @@ -1,761 +0,0 @@ -{ - "db": "PostgreSQL", - "02deb524bb12632af9b7883975f75fdc30d6775d836aff647add1dffd1a4bc00": { - "describe": { - "columns": [ - { - "name": "config_id", - "ordinal": 0, - "type_info": "Int4" - }, - { - "name": "duration", - "ordinal": 1, - "type_info": "Int4" - }, - { - "name": "name", - "ordinal": 2, - "type_info": "Varchar" - }, - { - "name": "key", - "ordinal": 3, - "type_info": "Varchar" - } - ], - "nullable": [ - false, - false, - false, - false - ], - "parameters": { - "Left": [ - "Text", - "Text" - ] - } - }, - "query": "SELECT config_id, duration, name, key from mcaptcha_config WHERE\n key = $1 AND\n user_id = (SELECT ID FROM mcaptcha_users WHERE name = $2) " - }, - "044e2036a518de2ccac9318ccba07f7ce10e4a1c1d51d0128ea5e8cb94358ac5": { - "describe": { - "columns": [], - "nullable": [], - "parameters": { - "Left": [ - "Text", - "Timestamptz" - ] - } - }, - "query": "INSERT INTO mcaptcha_pow_confirmed_stats \n (config_id, time) VALUES ((SELECT config_id FROM mcaptcha_config WHERE key = $1), $2)" - }, - "0840af95cc17c8ea6fc994e53696d4dec39ef9b4b6dd6c58c21cc44ccbb4bd09": { - "describe": { - "columns": [], - "nullable": [], - "parameters": { - "Left": [ - "Text", - "Text", - "Int4", - "Int4", - "Int4" - ] - } - }, - "query": "INSERT INTO mcaptcha_sitekey_user_provided_avg_traffic (\n config_id,\n avg_traffic,\n peak_sustainable_traffic,\n broke_my_site_traffic\n ) VALUES ( \n (SELECT config_id FROM mcaptcha_config WHERE key = ($1)\n AND user_id = (SELECT ID FROM mcaptcha_users WHERE name = $2)\n ), $3, $4, $5)" - }, - "0e7a1a38019c5e88ebd096fc5f6031aaa7f337fe735aa44c4e31bd6e51163749": { - "describe": { - "columns": [], - "nullable": [], - "parameters": { - "Left": [ - "Text", - "Text" - ] - } - }, - "query": "DELETE FROM mcaptcha_sitekey_user_provided_avg_traffic\n WHERE config_id = (\n SELECT config_id \n FROM \n mcaptcha_config \n WHERE\n key = ($1) \n AND \n user_id = (SELECT ID FROM mcaptcha_users WHERE name = $2)\n );" - }, - "16864df9cf9a69c299d9ab68bac559c48f4fc433541a10f7c1b60717df2b820e": { - "describe": { - "columns": [ - { - "name": "key", - "ordinal": 0, - "type_info": "Varchar" - }, - { - "name": "name", - "ordinal": 1, - "type_info": "Varchar" - }, - { - "name": "config_id", - "ordinal": 2, - "type_info": "Int4" - }, - { - "name": "duration", - "ordinal": 3, - "type_info": "Int4" - } - ], - "nullable": [ - false, - false, - false, - false - ], - "parameters": { - "Left": [ - "Text" - ] - } - }, - "query": "SELECT key, name, config_id, duration FROM mcaptcha_config WHERE\n user_id = (SELECT ID FROM mcaptcha_users WHERE name = $1) " - }, - "1e9fe69b23e4bfa7bb369455753100307e334e8dbaf02ff37cda08992fe95910": { - "describe": { - "columns": [], - "nullable": [], - "parameters": { - "Left": [ - "Varchar", - "Text" - ] - } - }, - "query": "UPDATE mcaptcha_users set name = $1\n WHERE name = $2" - }, - "2b319a202bb983d5f28979d1e371f399125da1122fbda36a5a55b75b9c743451": { - "describe": { - "columns": [], - "nullable": [], - "parameters": { - "Left": [ - "Int4", - "Text" - ] - } - }, - "query": "-- mark a notification as read\nUPDATE mcaptcha_notifications\n SET read = TRUE\nWHERE \n mcaptcha_notifications.id = $1\nAND\n mcaptcha_notifications.rx = (\n SELECT\n id\n FROM\n mcaptcha_users\n WHERE\n name = $2\n );\n" - }, - "307245aaf5b0d692448b80358d6916aa50c507b35e724d66c9b16a16b60e1b38": { - "describe": { - "columns": [], - "nullable": [], - "parameters": { - "Left": [ - "Varchar", - "Text", - "Int4", - "Varchar" - ] - } - }, - "query": "INSERT INTO mcaptcha_config\n (key, user_id, duration, name)\n VALUES ($1, (SELECT ID FROM mcaptcha_users WHERE name = $2), $3, $4)" - }, - "30ba202b601dd07f41798775c7c59fde7deeae759ec959df46734a66ffd78df7": { - "describe": { - "columns": [ - { - "name": "email", - "ordinal": 0, - "type_info": "Varchar" - } - ], - "nullable": [ - true - ], - "parameters": { - "Left": [ - "Text" - ] - } - }, - "query": "SELECT email FROM mcaptcha_users WHERE name = $1" - }, - "3b1c8128fc48b16d8e8ea6957dd4fbc0eb19ae64748fd7824e9f5e1901dd1726": { - "describe": { - "columns": [], - "nullable": [], - "parameters": { - "Left": [ - "Varchar", - "Text" - ] - } - }, - "query": "UPDATE mcaptcha_users set secret = $1\n WHERE name = $2" - }, - "3eb1c43ffd2378c4dd59975568c3a180b72d13008f294a91f3e76b785dba295b": { - "describe": { - "columns": [ - { - "name": "exists", - "ordinal": 0, - "type_info": "Bool" - } - ], - "nullable": [ - null - ], - "parameters": { - "Left": [ - "Text", - "Text" - ] - } - }, - "query": "SELECT EXISTS (\n SELECT 1 from mcaptcha_config WHERE key = $1 \n AND user_id = (SELECT ID FROM mcaptcha_users WHERE name = $2)\n )" - }, - "4303f5c6ef98e0de9d8d3c2d781d3ffaa3dee5f7d27db831d327b26f03ba9d68": { - "describe": { - "columns": [ - { - "name": "time", - "ordinal": 0, - "type_info": "Timestamptz" - } - ], - "nullable": [ - false - ], - "parameters": { - "Left": [ - "Text", - "Text" - ] - } - }, - "query": "SELECT time FROM mcaptcha_pow_confirmed_stats \n WHERE \n config_id = (\n SELECT config_id FROM mcaptcha_config \n WHERE \n key = $1\n AND\n user_id = (\n SELECT \n ID FROM mcaptcha_users WHERE name = $2))\n ORDER BY time DESC" - }, - "45d9e9fb6344fe3a18c2529d50c935d3837bfe25c96595beb6970d6067720578": { - "describe": { - "columns": [], - "nullable": [], - "parameters": { - "Left": [ - "Varchar", - "Text", - "Varchar", - "Varchar" - ] - } - }, - "query": "insert into mcaptcha_users \n (name , password, email, secret) values ($1, $2, $3, $4)" - }, - "47fa50aecfb1499b0a18fa9299643017a1a8d69d4e9980032e0d8f745465d14f": { - "describe": { - "columns": [ - { - "name": "exists", - "ordinal": 0, - "type_info": "Bool" - } - ], - "nullable": [ - null - ], - "parameters": { - "Left": [ - "Text" - ] - } - }, - "query": "SELECT EXISTS (SELECT 1 from mcaptcha_users WHERE email = $1)" - }, - "494d2aed281e1408aeda3606b0814db75aea2878783a2e2f11a4feb6fc48e938": { - "describe": { - "columns": [ - { - "name": "secret", - "ordinal": 0, - "type_info": "Varchar" - } - ], - "nullable": [ - false - ], - "parameters": { - "Left": [ - "Text" - ] - } - }, - "query": "SELECT secret FROM mcaptcha_users WHERE ID = (\n SELECT user_id FROM mcaptcha_config WHERE key = $1\n )" - }, - "4a5dfbc5aeb2bab290a09640cc25223d484fbc7549e5bc54f33bab8616725031": { - "describe": { - "columns": [ - { - "name": "exists", - "ordinal": 0, - "type_info": "Bool" - } - ], - "nullable": [ - null - ], - "parameters": { - "Left": [ - "Text" - ] - } - }, - "query": "SELECT EXISTS (SELECT 1 from mcaptcha_config WHERE key = $1)" - }, - "507bea10c7f8417c5b1430211d0137299cd561333bf47f7b4887d0ef801d1ea4": { - "describe": { - "columns": [], - "nullable": [], - "parameters": { - "Left": [ - "Varchar", - "Text", - "Text" - ] - } - }, - "query": "UPDATE mcaptcha_config SET key = $1 \n WHERE key = $2 AND user_id = (SELECT ID FROM mcaptcha_users WHERE name = $3)" - }, - "570c22f19fe0b97d78086038c8ef82509dce0bae704d80f9f031c1c47e6a6572": { - "describe": { - "columns": [], - "nullable": [], - "parameters": { - "Left": [ - "Varchar", - "Int4", - "Text", - "Text" - ] - } - }, - "query": "UPDATE mcaptcha_config SET name = $1, duration = $2\n WHERE user_id = (SELECT ID FROM mcaptcha_users WHERE name = $3)\n AND key = $4" - }, - "717771c42737feb3f4ca13f2ab11361073ea17b55562a103f660149bf049c5c6": { - "describe": { - "columns": [ - { - "name": "difficulty_factor", - "ordinal": 0, - "type_info": "Int4" - }, - { - "name": "visitor_threshold", - "ordinal": 1, - "type_info": "Int4" - } - ], - "nullable": [ - false, - false - ], - "parameters": { - "Left": [ - "Text", - "Text" - ] - } - }, - "query": "SELECT difficulty_factor, visitor_threshold FROM mcaptcha_levels WHERE\n config_id = (\n SELECT config_id FROM mcaptcha_config WHERE key = ($1)\n AND user_id = (SELECT ID from mcaptcha_users WHERE name = $2)\n )\n ORDER BY difficulty_factor ASC;" - }, - "726a794f7599b78ab749d9f887f5c28db38f072b41f691bde35d23ba0dd72409": { - "describe": { - "columns": [], - "nullable": [], - "parameters": { - "Left": [ - "Text", - "Timestamptz" - ] - } - }, - "query": "INSERT INTO mcaptcha_pow_fetched_stats \n (config_id, time) VALUES ((SELECT config_id FROM mcaptcha_config WHERE key = $1), $2)" - }, - "7c96ae73dd73c1b0e073e3ac78f87f4cba23fdb2cdbed9ba9b0d55f33655582e": { - "describe": { - "columns": [], - "nullable": [], - "parameters": { - "Left": [ - "Text", - "Text" - ] - } - }, - "query": "DELETE FROM mcaptcha_levels \n WHERE config_id = (\n SELECT config_id FROM mcaptcha_config where key = ($1) \n AND user_id = (\n SELECT ID from mcaptcha_users WHERE name = $2\n )\n )" - }, - "81c779ed4bb59f8b94dea730cbda31f7733ef16d509a3ed607388b5ddef74638": { - "describe": { - "columns": [], - "nullable": [], - "parameters": { - "Left": [ - "Varchar", - "Text", - "Varchar" - ] - } - }, - "query": "INSERT INTO mcaptcha_users \n (name , password, secret) VALUES ($1, $2, $3)" - }, - "84484cb6892db29121816bc5bff5702b9e857e20aa14e79d080d78ae7593153b": { - "describe": { - "columns": [ - { - "name": "time", - "ordinal": 0, - "type_info": "Timestamptz" - } - ], - "nullable": [ - false - ], - "parameters": { - "Left": [ - "Text", - "Text" - ] - } - }, - "query": "SELECT time FROM mcaptcha_pow_solved_stats \n WHERE config_id = (\n SELECT config_id FROM mcaptcha_config \n WHERE \n key = $1\n AND\n user_id = (\n SELECT \n ID FROM mcaptcha_users WHERE name = $2)) \n ORDER BY time DESC" - }, - "9753721856a47438c5e72f28fd9d149db10c48e677b4613bf3f1e8487908aac8": { - "describe": { - "columns": [ - { - "name": "difficulty_factor", - "ordinal": 0, - "type_info": "Int4" - }, - { - "name": "visitor_threshold", - "ordinal": 1, - "type_info": "Int4" - } - ], - "nullable": [ - false, - false - ], - "parameters": { - "Left": [ - "Text" - ] - } - }, - "query": "SELECT difficulty_factor, visitor_threshold FROM mcaptcha_levels WHERE\n config_id = (\n SELECT config_id FROM mcaptcha_config WHERE key = ($1)\n ) ORDER BY difficulty_factor ASC;" - }, - "ad196ab3ef9dc32f6de2313577ccd6c26eae9ab19df5f71ce182651983efb99a": { - "describe": { - "columns": [ - { - "name": "duration", - "ordinal": 0, - "type_info": "Int4" - } - ], - "nullable": [ - false - ], - "parameters": { - "Left": [ - "Text" - ] - } - }, - "query": "SELECT duration FROM mcaptcha_config \n WHERE key = $1" - }, - "ad23588ee4bcbb13e208460ce21e2fa9f1373893934b530b339fea10360b34a8": { - "describe": { - "columns": [ - { - "name": "exists", - "ordinal": 0, - "type_info": "Bool" - } - ], - "nullable": [ - null - ], - "parameters": { - "Left": [ - "Text" - ] - } - }, - "query": "SELECT EXISTS (SELECT 1 from mcaptcha_users WHERE name = $1)" - }, - "b97d810814fbeb2df19f47bcfa381bc6fb7ac6832d040b377cf4fca2ca896cfb": { - "describe": { - "columns": [], - "nullable": [], - "parameters": { - "Left": [ - "Varchar", - "Text" - ] - } - }, - "query": "UPDATE mcaptcha_users set email = $1\n WHERE name = $2" - }, - "bb6443e1df704294abbbdb563f1bf46660d0f3462c0c35c10a533446fc7c53e8": { - "describe": { - "columns": [], - "nullable": [], - "parameters": { - "Left": [ - "Text", - "Text" - ] - } - }, - "query": "DELETE FROM mcaptcha_config WHERE key = ($1)\n AND\n user_id = (SELECT ID FROM mcaptcha_users WHERE name = $2)" - }, - "bdf2e2781bfa2e9c81c18ef8df7230809d3b20274685a35b1c544804f2a58241": { - "describe": { - "columns": [ - { - "name": "name", - "ordinal": 0, - "type_info": "Varchar" - }, - { - "name": "password", - "ordinal": 1, - "type_info": "Text" - } - ], - "nullable": [ - false, - false - ], - "parameters": { - "Left": [ - "Text" - ] - } - }, - "query": "SELECT name, password FROM mcaptcha_users WHERE email = ($1)" - }, - "c2e167e56242de7e0a835e25004b15ca8340545fa0ca7ac8f3293157d2d03d98": { - "describe": { - "columns": [ - { - "name": "avg_traffic", - "ordinal": 0, - "type_info": "Int4" - }, - { - "name": "peak_sustainable_traffic", - "ordinal": 1, - "type_info": "Int4" - }, - { - "name": "broke_my_site_traffic", - "ordinal": 2, - "type_info": "Int4" - } - ], - "nullable": [ - false, - false, - true - ], - "parameters": { - "Left": [ - "Text", - "Text" - ] - } - }, - "query": "SELECT \n avg_traffic, \n peak_sustainable_traffic, \n broke_my_site_traffic \n FROM \n mcaptcha_sitekey_user_provided_avg_traffic \n WHERE \n config_id = (\n SELECT \n config_id \n FROM \n mcaptcha_config \n WHERE \n KEY = $1 \n AND user_id = (\n SELECT \n id \n FROM \n mcaptcha_users \n WHERE \n NAME = $2\n )\n )\n " - }, - "c399efd5db1284dcb470c40f9b076851f77498c75a63a3b151d4a111bd3e2957": { - "describe": { - "columns": [ - { - "name": "time", - "ordinal": 0, - "type_info": "Timestamptz" - } - ], - "nullable": [ - false - ], - "parameters": { - "Left": [ - "Text", - "Text" - ] - } - }, - "query": "SELECT time FROM mcaptcha_pow_fetched_stats\n WHERE \n config_id = (\n SELECT \n config_id FROM mcaptcha_config \n WHERE \n key = $1\n AND\n user_id = (\n SELECT \n ID FROM mcaptcha_users WHERE name = $2))\n ORDER BY time DESC" - }, - "ca9d5241f1234d1825f7ead391ebe9099fca776e7101ac6e1761881606def5fa": { - "describe": { - "columns": [], - "nullable": [], - "parameters": { - "Left": [ - "Text" - ] - } - }, - "query": "DELETE FROM mcaptcha_users WHERE name = ($1)" - }, - "d7dd6cd6a7626e79c62377b2d59115067c5851ec044911ff8833779a08bbb8f7": { - "describe": { - "columns": [], - "nullable": [], - "parameters": { - "Left": [ - "Varchar", - "Varchar", - "Text", - "Text", - "Timestamptz" - ] - } - }, - "query": "INSERT INTO mcaptcha_notifications (\n heading, message, tx, rx, received)\n VALUES (\n $1, $2,\n (SELECT ID FROM mcaptcha_users WHERE name = $3),\n (SELECT ID FROM mcaptcha_users WHERE name = $4),\n $5\n );" - }, - "dbe4307651d94bc6db4f1d8b2c6d076fde6280983d59593216d7765cbbdd669c": { - "describe": { - "columns": [], - "nullable": [], - "parameters": { - "Left": [ - "Text", - "Timestamptz" - ] - } - }, - "query": "INSERT INTO mcaptcha_pow_solved_stats \n (config_id, time) VALUES ((SELECT config_id FROM mcaptcha_config WHERE key = $1), $2)" - }, - "dcf0d4f9d803dcb1d6f775899f79595f9c78d46633e0ec822303284430df7a3d": { - "describe": { - "columns": [ - { - "name": "id", - "ordinal": 0, - "type_info": "Int4" - }, - { - "name": "heading", - "ordinal": 1, - "type_info": "Varchar" - }, - { - "name": "message", - "ordinal": 2, - "type_info": "Varchar" - }, - { - "name": "received", - "ordinal": 3, - "type_info": "Timestamptz" - }, - { - "name": "name", - "ordinal": 4, - "type_info": "Varchar" - } - ], - "nullable": [ - true, - true, - true, - true, - true - ], - "parameters": { - "Left": [ - "Text" - ] - } - }, - "query": "-- gets all unread notifications a user has\nSELECT \n mcaptcha_notifications.id,\n mcaptcha_notifications.heading,\n mcaptcha_notifications.message,\n mcaptcha_notifications.received,\n mcaptcha_users.name\nFROM\n mcaptcha_notifications \nINNER JOIN \n mcaptcha_users \nON \n mcaptcha_notifications.tx = mcaptcha_users.id\nWHERE \n mcaptcha_notifications.rx = (\n SELECT \n id \n FROM \n mcaptcha_users\n WHERE\n name = $1\n )\nAND \n mcaptcha_notifications.read IS NULL;\n" - }, - "e4c710d33b709aee262fa0704372ac216d98851447ef4fbe221740b7ae4ea422": { - "describe": { - "columns": [ - { - "name": "secret", - "ordinal": 0, - "type_info": "Varchar" - } - ], - "nullable": [ - false - ], - "parameters": { - "Left": [ - "Text" - ] - } - }, - "query": "SELECT secret FROM mcaptcha_users WHERE name = ($1)" - }, - "e9ed973dfd2bfef36d5a4724aef4993328e1d8d3ca397fe6d5408a780efc775a": { - "describe": { - "columns": [], - "nullable": [], - "parameters": { - "Left": [ - "Text", - "Text" - ] - } - }, - "query": "UPDATE mcaptcha_users set password = $1\n WHERE name = $2" - }, - "f330cb94c53d33495df94aacec7e4e91d8a920742b89a63d1c59a8ea8937c5c8": { - "describe": { - "columns": [], - "nullable": [], - "parameters": { - "Left": [ - "Int4", - "Int4", - "Text", - "Text" - ] - } - }, - "query": "INSERT INTO mcaptcha_levels (\n difficulty_factor, \n visitor_threshold,\n config_id) VALUES (\n $1, $2, (\n SELECT config_id FROM mcaptcha_config WHERE\n key = ($3) AND user_id = (\n SELECT ID FROM mcaptcha_users WHERE name = $4\n )));" - }, - "f3dee60b85be2ae861b6695286e387529dabf3d11202fb2eeb7e75a7bb3bd0a4": { - "describe": { - "columns": [ - { - "name": "name", - "ordinal": 0, - "type_info": "Varchar" - }, - { - "name": "password", - "ordinal": 1, - "type_info": "Text" - } - ], - "nullable": [ - false, - false - ], - "parameters": { - "Left": [ - "Text" - ] - } - }, - "query": "SELECT name, password FROM mcaptcha_users WHERE name = ($1)" - } -} \ No newline at end of file diff --git a/src/api/v1/pow/verify_pow.rs b/src/api/v1/pow/verify_pow.rs index 78751cd9..e8c9e8f6 100644 --- a/src/api/v1/pow/verify_pow.rs +++ b/src/api/v1/pow/verify_pow.rs @@ -141,7 +141,7 @@ pub mod tests { assert_eq!(get_config_resp.status(), StatusCode::OK); let config: PoWConfig = test::read_body_json(get_config_resp).await; - let pow = pow_sha256::ConfigBuilder::default() + let pow = mcaptcha_pow_sha256::ConfigBuilder::default() .salt(config.salt) .build() .unwrap(); @@ -204,7 +204,7 @@ pub mod tests { assert_eq!(get_config_resp.status(), StatusCode::OK); let config: PoWConfig = test::read_body_json(get_config_resp).await; - let pow = pow_sha256::ConfigBuilder::default() + let pow = mcaptcha_pow_sha256::ConfigBuilder::default() .salt(config.salt) .build() .unwrap(); diff --git a/src/api/v1/pow/verify_token.rs b/src/api/v1/pow/verify_token.rs index 4a8910f3..ea143baf 100644 --- a/src/api/v1/pow/verify_token.rs +++ b/src/api/v1/pow/verify_token.rs @@ -123,7 +123,7 @@ pub mod tests { assert_eq!(get_config_resp.status(), StatusCode::OK); let config: PoWConfig = test::read_body_json(get_config_resp).await; - let pow = pow_sha256::ConfigBuilder::default() + let pow = mcaptcha_pow_sha256::ConfigBuilder::default() .salt(config.salt) .build() .unwrap(); diff --git a/src/date.rs b/src/date.rs index e73c8e7a..ce6ef55c 100644 --- a/src/date.rs +++ b/src/date.rs @@ -33,7 +33,7 @@ impl Date { let difference = now - timestamp; if difference >= 3 * WEEK { - date.format("%d-%m-%y") + format!("{}{}{}", date.year(), date.month(), date.date()) } else if (DAY..(3 * WEEK)).contains(&difference) { format!("{} days ago", date.hour()) } else if (HOUR..DAY).contains(&difference) { @@ -52,12 +52,12 @@ impl Date { /// print date pub fn date(&self) -> String { - self.time.format("%F %r %z") + format!("{}{}{}", self.time.year(), self.time.month(), self.time.date()) } pub fn new(unix: i64) -> Self { Self { - time: OffsetDateTime::from_unix_timestamp(unix), + time: OffsetDateTime::from_unix_timestamp(unix).unwrap(), } } } @@ -77,28 +77,28 @@ mod tests { // seconds test assert!(n.print_date().contains("seconds ago")); - n.time = OffsetDateTime::from_unix_timestamp(timestamp - 5); + n.time = OffsetDateTime::from_unix_timestamp(timestamp - 5).unwrap(); assert!(n.print_date().contains("seconds ago")); // minutes test - n.time = OffsetDateTime::from_unix_timestamp(timestamp - MINUTE * 2); + n.time = OffsetDateTime::from_unix_timestamp(timestamp - MINUTE * 2).unwrap(); assert!(n.print_date().contains("minutes ago")); - n.time = OffsetDateTime::from_unix_timestamp(timestamp - MINUTE * 56); + n.time = OffsetDateTime::from_unix_timestamp(timestamp - MINUTE * 56).unwrap(); assert!(n.print_date().contains("minutes ago")); // hours test - n.time = OffsetDateTime::from_unix_timestamp(timestamp - HOUR); + n.time = OffsetDateTime::from_unix_timestamp(timestamp - HOUR).unwrap(); assert!(n.print_date().contains("hours ago")); - n.time = OffsetDateTime::from_unix_timestamp(timestamp - HOUR * 23); + n.time = OffsetDateTime::from_unix_timestamp(timestamp - HOUR * 23).unwrap(); assert!(n.print_date().contains("hours ago")); // days test - n.time = OffsetDateTime::from_unix_timestamp(timestamp - 2 * WEEK); + n.time = OffsetDateTime::from_unix_timestamp(timestamp - 2 * WEEK).unwrap(); assert!(n.print_date().contains("days ago")); // date test - n.time = OffsetDateTime::from_unix_timestamp(timestamp - 6 * WEEK); - let date = n.time.format("%d-%m-%y"); + n.time = OffsetDateTime::from_unix_timestamp(timestamp - 6 * WEEK).unwrap(); + let date = format!("{}{}{}", n.time.year(), n.time.month(), n.time.date()); assert!(n.print_date().contains(&date)) } } diff --git a/src/pages/panel/notifications.rs b/src/pages/panel/notifications.rs index dff4dd28..0c118dc3 100644 --- a/src/pages/panel/notifications.rs +++ b/src/pages/panel/notifications.rs @@ -38,7 +38,7 @@ impl From for Notification { Notification { name: n.name.unwrap(), heading: n.heading.unwrap(), - received: OffsetDateTime::from_unix_timestamp(n.received.unwrap()), + received: OffsetDateTime::from_unix_timestamp(n.received.unwrap()).unwrap(), id: n.id.unwrap(), message: n.message.unwrap(), } @@ -91,28 +91,28 @@ mod tests { // seconds test assert!(n.print_date().contains("seconds ago")); - n.received = OffsetDateTime::from_unix_timestamp(timestamp - 5); + n.received = OffsetDateTime::from_unix_timestamp(timestamp - 5).unwrap(); assert!(n.print_date().contains("seconds ago")); // minutes test - n.received = OffsetDateTime::from_unix_timestamp(timestamp - MINUTE * 2); + n.received = OffsetDateTime::from_unix_timestamp(timestamp - MINUTE * 2).unwrap(); assert!(n.print_date().contains("minutes ago")); - n.received = OffsetDateTime::from_unix_timestamp(timestamp - MINUTE * 56); + n.received = OffsetDateTime::from_unix_timestamp(timestamp - MINUTE * 56).unwrap(); assert!(n.print_date().contains("minutes ago")); // hours test - n.received = OffsetDateTime::from_unix_timestamp(timestamp - HOUR); + n.received = OffsetDateTime::from_unix_timestamp(timestamp - HOUR).unwrap(); assert!(n.print_date().contains("hours ago")); - n.received = OffsetDateTime::from_unix_timestamp(timestamp - HOUR * 23); + n.received = OffsetDateTime::from_unix_timestamp(timestamp - HOUR * 23).unwrap(); assert!(n.print_date().contains("hours ago")); // days test - n.received = OffsetDateTime::from_unix_timestamp(timestamp - 2 * WEEK); + n.received = OffsetDateTime::from_unix_timestamp(timestamp - 2 * WEEK).unwrap(); assert!(n.print_date().contains("days ago")); // date test - n.received = OffsetDateTime::from_unix_timestamp(timestamp - 6 * WEEK); - let date = n.received.format("%d-%m-%y"); + n.received = OffsetDateTime::from_unix_timestamp(timestamp - 6 * WEEK).unwrap(); + let date = format!("{}{}{}", n.received.year(), n.received.month(), n.received.date()); assert!(n.print_date().contains(&date)) } }