diff --git a/Cargo.lock b/Cargo.lock index 580b83e..a6e24ed 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -40,24 +40,15 @@ dependencies = [ [[package]] name = "ahash" -version = "0.7.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" dependencies = [ + "cfg-if", "getrandom", "once_cell", "version_check", -] - -[[package]] -name = "ahash" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", + "zerocopy", ] [[package]] @@ -125,13 +116,23 @@ dependencies = [ [[package]] name = "atoi" -version = "1.0.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7c57d12312ff59c811c0643f4d80830505833c9ffaebd193d819392b265be8e" +checksum = "f28d99ec8bfea296261ca1af174f24225171fea9664ba9003cbebee704810528" dependencies = [ "num-traits", ] +[[package]] +name = "atomic-write-file" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edcdbedc2236483ab103a53415653d6b4442ea6141baf1ffa85df29635e88436" +dependencies = [ + "nix", + "rand", +] + [[package]] name = "atty" version = "0.2.14" @@ -202,6 +203,9 @@ name = "bitflags" version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" +dependencies = [ + "serde", +] [[package]] name = "block-buffer" @@ -279,7 +283,7 @@ dependencies = [ "num-traits", "serde", "wasm-bindgen", - "windows-targets", + "windows-targets 0.48.5", ] [[package]] @@ -298,7 +302,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60420ae982a8deea9949048d59c94fe154574c9f238eafef08e692da62421354" dependencies = [ - "flume", + "flume 0.10.14", "futures-util", "reqwest", "serde", @@ -317,6 +321,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + [[package]] name = "constant_time_eq" version = "0.1.5" @@ -411,10 +421,21 @@ dependencies = [ "hashbrown 0.14.1", "lock_api", "once_cell", - "parking_lot_core 0.9.8", + "parking_lot_core", "serde", ] +[[package]] +name = "der" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" +dependencies = [ + "const-oid", + "pem-rfc7468", + "zeroize", +] + [[package]] name = "deranged" version = "0.3.8" @@ -431,6 +452,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer", + "const-oid", "crypto-common", "subtle", ] @@ -478,6 +500,12 @@ dependencies = [ "termcolor", ] +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + [[package]] name = "errno" version = "0.3.3" @@ -486,7 +514,7 @@ checksum = "136526188508e25c6fef639d7927dfb3e0e3084488bf202267829cf7fc23dbdd" dependencies = [ "errno-dragonfly", "libc", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -499,6 +527,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" @@ -540,6 +579,17 @@ dependencies = [ "spin 0.9.8", ] +[[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" @@ -613,13 +663,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]] @@ -710,7 +760,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap", + "indexmap 1.9.3", "slab", "tokio", "tokio-util", @@ -729,7 +779,7 @@ version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12" dependencies = [ - "ahash 0.8.3", + "ahash", "allocator-api2", ] @@ -772,6 +822,15 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +[[package]] +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + [[package]] name = "hmac" version = "0.12.1" @@ -781,6 +840,15 @@ dependencies = [ "digest", ] +[[package]] +name = "home" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +dependencies = [ + "windows-sys 0.52.0", +] + [[package]] name = "http" version = "0.2.9" @@ -915,6 +983,16 @@ dependencies = [ "hashbrown 0.12.3", ] +[[package]] +name = "indexmap" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "824b2ae422412366ba479e8111fd301f7b5faece8149317bb81925979a53f520" +dependencies = [ + "equivalent", + "hashbrown 0.14.1", +] + [[package]] name = "inout" version = "0.1.3" @@ -924,15 +1002,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if", -] - [[package]] name = "ipnet" version = "2.8.0" @@ -977,6 +1046,9 @@ name = "lazy_static" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +dependencies = [ + "spin 0.5.2", +] [[package]] name = "levenshtein" @@ -991,10 +1063,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b" [[package]] -name = "libsqlite3-sys" -version = "0.24.2" +name = "libm" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "898745e570c7d0453cc1fbc4a701eb6c662ed54e8fec8b7d14be137ebeeb9d14" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" + +[[package]] +name = "libsqlite3-sys" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4e226dcd58b4be396f7bd3c20da8fdee2911400705297ba7d2d7cc2c30f716" dependencies = [ "cc", "pkg-config", @@ -1029,6 +1107,16 @@ version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +[[package]] +name = "md-5" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" +dependencies = [ + "cfg-if", + "digest", +] + [[package]] name = "memchr" version = "2.6.3" @@ -1074,7 +1162,7 @@ checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" dependencies = [ "libc", "wasi", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -1104,6 +1192,17 @@ dependencies = [ "tempfile", ] +[[package]] +name = "nix" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" +dependencies = [ + "bitflags 2.4.0", + "cfg-if", + "libc", +] + [[package]] name = "nom" version = "7.1.3" @@ -1114,6 +1213,44 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "num-bigint-dig" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" +dependencies = [ + "byteorder", + "lazy_static", + "libm", + "num-integer", + "num-iter", + "num-traits", + "rand", + "smallvec", + "zeroize", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + [[package]] name = "num-traits" version = "0.2.16" @@ -1121,6 +1258,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" dependencies = [ "autocfg", + "libm", ] [[package]] @@ -1209,17 +1347,6 @@ dependencies = [ "unicase", ] -[[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" @@ -1227,21 +1354,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]] @@ -1252,9 +1365,9 @@ checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.3.5", + "redox_syscall", "smallvec", - "windows-targets", + "windows-targets 0.48.5", ] [[package]] @@ -1286,6 +1399,15 @@ dependencies = [ "sha2", ] +[[package]] +name = "pem-rfc7468" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" +dependencies = [ + "base64ct", +] + [[package]] name = "percent-encoding" version = "2.3.0" @@ -1324,6 +1446,27 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "pkcs1" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f" +dependencies = [ + "der", + "pkcs8", + "spki", +] + +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + [[package]] name = "pkg-config" version = "0.3.27" @@ -1384,15 +1527,6 @@ dependencies = [ "getrandom", ] -[[package]] -name = "redox_syscall" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "redox_syscall" version = "0.3.5" @@ -1497,6 +1631,26 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be9e281b71d3797817a1e6615dd8fb081dd61359b4c41d08792cc7c3c1c13b4e" +[[package]] +name = "rsa" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d0e5124fcb30e76a7e79bfee683a2746db83784b86289f6251b54b7950a0dfc" +dependencies = [ + "const-oid", + "digest", + "num-bigint-dig", + "num-integer", + "num-traits", + "pkcs1", + "pkcs8", + "rand_core", + "signature", + "spki", + "subtle", + "zeroize", +] + [[package]] name = "rustbreak" version = "2.0.0" @@ -1525,7 +1679,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -1589,7 +1743,7 @@ version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" dependencies = [ - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -1690,7 +1844,7 @@ version = "0.8.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "578a7433b776b56a35785ed5ce9a7e777ac0598aac5a6dd1b4b18a307c7fc71b" dependencies = [ - "indexmap", + "indexmap 1.9.3", "ryu", "serde", "yaml-rust", @@ -1716,7 +1870,7 @@ dependencies = [ "levenshtein", "mime", "mime_guess", - "parking_lot 0.12.1", + "parking_lot", "percent-encoding", "reqwest", "rustversion", @@ -1765,6 +1919,16 @@ dependencies = [ "digest", ] +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest", + "rand_core", +] + [[package]] name = "slab" version = "0.4.9" @@ -1797,7 +1961,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4031e820eb552adee9295814c0ced9e5cf38ddf1e8b7d566d6de8e2538ea989e" dependencies = [ "libc", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -1815,6 +1979,16 @@ dependencies = [ "lock_api", ] +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] + [[package]] name = "sqlformat" version = "0.2.2" @@ -1828,23 +2002,25 @@ dependencies = [ [[package]] name = "sqlx" -version = "0.6.3" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8de3b03a925878ed54a954f621e64bf55a3c1bd29652d0d1a17830405350188" +checksum = "dba03c279da73694ef99763320dea58b51095dfe87d001b1d4b5fe78ba8763cf" dependencies = [ "sqlx-core", "sqlx-macros", + "sqlx-mysql", + "sqlx-postgres", + "sqlx-sqlite", ] [[package]] name = "sqlx-core" -version = "0.6.3" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa8241483a83a3f33aa5fff7e7d9def398ff9990b2752b6c6112b83c6d246029" +checksum = "d84b0a3c3739e220d94b3239fd69fb1f74bc36e16643423bd99de3b43c21bfbd" dependencies = [ - "ahash 0.7.6", + "ahash", "atoi", - "bitflags 1.3.2", "byteorder", "bytes", "chrono", @@ -1853,43 +2029,51 @@ dependencies = [ "dotenvy", "either", "event-listener", - "flume", "futures-channel", "futures-core", - "futures-executor", "futures-intrusive", + "futures-io", "futures-util", "hashlink", "hex", - "indexmap", - "itoa", - "libc", - "libsqlite3-sys", + "indexmap 2.2.2", "log", "memchr", "once_cell", "paste", "percent-encoding", - "rustls 0.20.9", - "rustls-pemfile", "serde", + "serde_json", "sha2", "smallvec", "sqlformat", - "sqlx-rt", - "stringprep", "thiserror", + "tokio", "tokio-stream", + "tracing", "url", - "webpki-roots 0.22.6", ] [[package]] name = "sqlx-macros" -version = "0.6.3" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9966e64ae989e7e575b19d7265cb79d7fc3cbbdf179835cb0d716f294c2049c9" +checksum = "89961c00dc4d7dffb7aee214964b065072bff69e36ddb9e2c107541f75e4f2a5" dependencies = [ + "proc-macro2", + "quote", + "sqlx-core", + "sqlx-macros-core", + "syn 1.0.109", +] + +[[package]] +name = "sqlx-macros-core" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0bd4519486723648186a08785143599760f7cc81c52334a55d6a83ea1e20841" +dependencies = [ + "atomic-write-file", "dotenvy", "either", "heck", @@ -1901,20 +2085,120 @@ dependencies = [ "serde_json", "sha2", "sqlx-core", - "sqlx-rt", + "sqlx-mysql", + "sqlx-postgres", + "sqlx-sqlite", "syn 1.0.109", + "tempfile", + "tokio", "url", ] [[package]] -name = "sqlx-rt" -version = "0.6.3" +name = "sqlx-mysql" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "804d3f245f894e61b1e6263c84b23ca675d96753b5abfd5cc8597d86806e8024" +checksum = "e37195395df71fd068f6e2082247891bc11e3289624bbc776a0cdfa1ca7f1ea4" dependencies = [ + "atoi", + "base64 0.21.4", + "bitflags 2.4.0", + "byteorder", + "bytes", + "chrono", + "crc", + "digest", + "dotenvy", + "either", + "futures-channel", + "futures-core", + "futures-io", + "futures-util", + "generic-array", + "hex", + "hkdf", + "hmac", + "itoa", + "log", + "md-5", + "memchr", "once_cell", - "tokio", - "tokio-rustls 0.23.4", + "percent-encoding", + "rand", + "rsa", + "serde", + "sha1", + "sha2", + "smallvec", + "sqlx-core", + "stringprep", + "thiserror", + "tracing", + "whoami", +] + +[[package]] +name = "sqlx-postgres" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6ac0ac3b7ccd10cc96c7ab29791a7dd236bd94021f31eec7ba3d46a74aa1c24" +dependencies = [ + "atoi", + "base64 0.21.4", + "bitflags 2.4.0", + "byteorder", + "chrono", + "crc", + "dotenvy", + "etcetera", + "futures-channel", + "futures-core", + "futures-io", + "futures-util", + "hex", + "hkdf", + "hmac", + "home", + "itoa", + "log", + "md-5", + "memchr", + "once_cell", + "rand", + "serde", + "serde_json", + "sha1", + "sha2", + "smallvec", + "sqlx-core", + "stringprep", + "thiserror", + "tracing", + "whoami", +] + +[[package]] +name = "sqlx-sqlite" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "210976b7d948c7ba9fced8ca835b11cbb2d677c59c79de41ac0d397e14547490" +dependencies = [ + "atoi", + "chrono", + "flume 0.11.0", + "futures-channel", + "futures-core", + "futures-executor", + "futures-intrusive", + "futures-util", + "libsqlite3-sys", + "log", + "percent-encoding", + "serde", + "sqlx-core", + "tracing", + "url", + "urlencoding", ] [[package]] @@ -1970,9 +2254,9 @@ checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" dependencies = [ "cfg-if", "fastrand", - "redox_syscall 0.3.5", + "redox_syscall", "rustix", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -2061,7 +2345,7 @@ dependencies = [ "pin-project-lite", "socket2 0.5.4", "tokio-macros", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -2269,6 +2553,12 @@ dependencies = [ "serde", ] +[[package]] +name = "urlencoding" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" + [[package]] name = "utf-8" version = "0.7.6" @@ -2422,6 +2712,12 @@ version = "0.25.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" +[[package]] +name = "whoami" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22fc3756b8a9133049b26c7f61ab35416c130e8c09b660f5b3958b446f52cc50" + [[package]] name = "winapi" version = "0.3.9" @@ -2459,7 +2755,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ - "windows-targets", + "windows-targets 0.48.5", ] [[package]] @@ -2468,7 +2764,16 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets", + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.0", ] [[package]] @@ -2477,13 +2782,28 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +dependencies = [ + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", ] [[package]] @@ -2492,42 +2812,84 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" + [[package]] name = "windows_aarch64_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" + [[package]] name = "windows_i686_gnu" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" +[[package]] +name = "windows_i686_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" + [[package]] name = "windows_i686_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" +[[package]] +name = "windows_i686_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" + [[package]] name = "windows_x86_64_gnu" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" + [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" + [[package]] name = "windows_x86_64_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" + [[package]] name = "winreg" version = "0.50.0" @@ -2535,7 +2897,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ "cfg-if", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -2587,7 +2949,7 @@ version = "0.1.0" dependencies = [ "chrono", "dashmap", - "flume", + "flume 0.10.14", "futures-util", "rand", "serde", @@ -2650,7 +3012,7 @@ dependencies = [ "async-trait", "chrono", "dashmap", - "flume", + "flume 0.10.14", "futures-util", "reqwest", "serenity", @@ -2659,6 +3021,32 @@ dependencies = [ "youmubot-db-sql", ] +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.37", +] + +[[package]] +name = "zeroize" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" + [[package]] name = "zip" version = "0.6.6" diff --git a/Cargo.toml b/Cargo.toml index 578a71d..ce10887 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,7 @@ [workspace] +resolver = "2" + members = [ "youmubot-prelude", "youmubot-db", diff --git a/flake.nix b/flake.nix index a6dfed6..3d4776a 100644 --- a/flake.nix +++ b/flake.nix @@ -34,7 +34,7 @@ { inputsFrom = [ packages.youmubot ]; - buildInputs = with pkgs; [ rustc rustfmt clippy ]; + buildInputs = with pkgs; [ rustc rustfmt clippy sqlx-cli ]; nativeBuildInputs = nixpkgs.lib.optionals pkgs.stdenv.isLinux (with pkgs; [ pkg-config diff --git a/youmubot-db-sql/.sqlx/query-08f2568a69a14ae240a24264238d4abc7aea5eee67d6062d049f0d37031e4d7a.json b/youmubot-db-sql/.sqlx/query-08f2568a69a14ae240a24264238d4abc7aea5eee67d6062d049f0d37031e4d7a.json new file mode 100644 index 0000000..36adbd6 --- /dev/null +++ b/youmubot-db-sql/.sqlx/query-08f2568a69a14ae240a24264238d4abc7aea5eee67d6062d049f0d37031e4d7a.json @@ -0,0 +1,68 @@ +{ + "db_name": "SQLite", + "query": "SELECT\n user_id as \"user_id: i64\",\n username,\n id as \"id: i64\",\n last_update as \"last_update: DateTime\",\n pp_std, pp_taiko, pp_mania, pp_catch,\n failures as \"failures: u8\"\n FROM osu_users WHERE id = ?", + "describe": { + "columns": [ + { + "name": "user_id: i64", + "ordinal": 0, + "type_info": "Int64" + }, + { + "name": "username", + "ordinal": 1, + "type_info": "Text" + }, + { + "name": "id: i64", + "ordinal": 2, + "type_info": "Int64" + }, + { + "name": "last_update: DateTime", + "ordinal": 3, + "type_info": "Datetime" + }, + { + "name": "pp_std", + "ordinal": 4, + "type_info": "Float" + }, + { + "name": "pp_taiko", + "ordinal": 5, + "type_info": "Float" + }, + { + "name": "pp_mania", + "ordinal": 6, + "type_info": "Float" + }, + { + "name": "pp_catch", + "ordinal": 7, + "type_info": "Float" + }, + { + "name": "failures: u8", + "ordinal": 8, + "type_info": "Int64" + } + ], + "parameters": { + "Right": 1 + }, + "nullable": [ + false, + true, + false, + false, + true, + true, + true, + true, + false + ] + }, + "hash": "08f2568a69a14ae240a24264238d4abc7aea5eee67d6062d049f0d37031e4d7a" +} diff --git a/youmubot-db-sql/.sqlx/query-1bf34dddbe994d6124c9382c75e70e1347329e945de2eefad4bfcab5f81b73ce.json b/youmubot-db-sql/.sqlx/query-1bf34dddbe994d6124c9382c75e70e1347329e945de2eefad4bfcab5f81b73ce.json new file mode 100644 index 0000000..9c36779 --- /dev/null +++ b/youmubot-db-sql/.sqlx/query-1bf34dddbe994d6124c9382c75e70e1347329e945de2eefad4bfcab5f81b73ce.json @@ -0,0 +1,32 @@ +{ + "db_name": "SQLite", + "query": "SELECT\n channel_id as \"channel_id: i64\",\n beatmap,\n mode as \"mode: u8\"\n FROM osu_last_beatmaps\n WHERE channel_id = ?", + "describe": { + "columns": [ + { + "name": "channel_id: i64", + "ordinal": 0, + "type_info": "Int64" + }, + { + "name": "beatmap", + "ordinal": 1, + "type_info": "Blob" + }, + { + "name": "mode: u8", + "ordinal": 2, + "type_info": "Int64" + } + ], + "parameters": { + "Right": 1 + }, + "nullable": [ + false, + false, + false + ] + }, + "hash": "1bf34dddbe994d6124c9382c75e70e1347329e945de2eefad4bfcab5f81b73ce" +} diff --git a/youmubot-db-sql/.sqlx/query-235312a1aad1a58c2f7f2d817945bbac57c38ad2c51c1924683d13d045f21ad9.json b/youmubot-db-sql/.sqlx/query-235312a1aad1a58c2f7f2d817945bbac57c38ad2c51c1924683d13d045f21ad9.json new file mode 100644 index 0000000..344ffdd --- /dev/null +++ b/youmubot-db-sql/.sqlx/query-235312a1aad1a58c2f7f2d817945bbac57c38ad2c51c1924683d13d045f21ad9.json @@ -0,0 +1,50 @@ +{ + "db_name": "SQLite", + "query": "SELECT\n beatmap_id as \"beatmap_id: i64\",\n mode as \"mode: u8\",\n user_id as \"user_id: i64\",\n mods as \"mods: i64\",\n cached_at as \"cached_at: DateTime\",\n score as \"score: Vec\"\n FROM osu_user_best_scores\n WHERE\n beatmap_id = ?\n AND mode = ?\n AND user_id = ?", + "describe": { + "columns": [ + { + "name": "beatmap_id: i64", + "ordinal": 0, + "type_info": "Int64" + }, + { + "name": "mode: u8", + "ordinal": 1, + "type_info": "Int64" + }, + { + "name": "user_id: i64", + "ordinal": 2, + "type_info": "Int64" + }, + { + "name": "mods: i64", + "ordinal": 3, + "type_info": "Int64" + }, + { + "name": "cached_at: DateTime", + "ordinal": 4, + "type_info": "Datetime" + }, + { + "name": "score: Vec", + "ordinal": 5, + "type_info": "Blob" + } + ], + "parameters": { + "Right": 3 + }, + "nullable": [ + false, + false, + false, + false, + false, + false + ] + }, + "hash": "235312a1aad1a58c2f7f2d817945bbac57c38ad2c51c1924683d13d045f21ad9" +} diff --git a/youmubot-db-sql/.sqlx/query-25077e7b2657eb918fa49acc16ceba14a004ed503c174073a1db184d902ee393.json b/youmubot-db-sql/.sqlx/query-25077e7b2657eb918fa49acc16ceba14a004ed503c174073a1db184d902ee393.json new file mode 100644 index 0000000..4a1bf91 --- /dev/null +++ b/youmubot-db-sql/.sqlx/query-25077e7b2657eb918fa49acc16ceba14a004ed503c174073a1db184d902ee393.json @@ -0,0 +1,12 @@ +{ + "db_name": "SQLite", + "query": "\n INSERT INTO\n osu_user_best_scores (beatmap_id, mode, user_id, mods, cached_at, score)\n VALUES\n (?, ?, ?, ?, ?, ?)\n ON CONFLICT (beatmap_id, mode, user_id, mods)\n DO UPDATE\n SET\n cached_at = excluded.cached_at,\n score = excluded.score\n ", + "describe": { + "columns": [], + "parameters": { + "Right": 6 + }, + "nullable": [] + }, + "hash": "25077e7b2657eb918fa49acc16ceba14a004ed503c174073a1db184d902ee393" +} diff --git a/youmubot-db-sql/.sqlx/query-296c95c7ead4d747a4da007b4b6e28d3c6c1c4bb654c82cc40bf61390c3dad4b.json b/youmubot-db-sql/.sqlx/query-296c95c7ead4d747a4da007b4b6e28d3c6c1c4bb654c82cc40bf61390c3dad4b.json new file mode 100644 index 0000000..2e8b15f --- /dev/null +++ b/youmubot-db-sql/.sqlx/query-296c95c7ead4d747a4da007b4b6e28d3c6c1c4bb654c82cc40bf61390c3dad4b.json @@ -0,0 +1,32 @@ +{ + "db_name": "SQLite", + "query": "SELECT\n beatmap_id as \"beatmap_id: i64\",\n cached_at as \"cached_at: DateTime\",\n content as \"content: Vec\"\n FROM osu_cached_beatmap_contents\n WHERE\n beatmap_id = ? ", + "describe": { + "columns": [ + { + "name": "beatmap_id: i64", + "ordinal": 0, + "type_info": "Int64" + }, + { + "name": "cached_at: DateTime", + "ordinal": 1, + "type_info": "Datetime" + }, + { + "name": "content: Vec", + "ordinal": 2, + "type_info": "Blob" + } + ], + "parameters": { + "Right": 1 + }, + "nullable": [ + false, + false, + false + ] + }, + "hash": "296c95c7ead4d747a4da007b4b6e28d3c6c1c4bb654c82cc40bf61390c3dad4b" +} diff --git a/youmubot-db-sql/.sqlx/query-4b033607229deba540f80e469753e2125b6d8134346144f462325dc025221044.json b/youmubot-db-sql/.sqlx/query-4b033607229deba540f80e469753e2125b6d8134346144f462325dc025221044.json new file mode 100644 index 0000000..91a9e25 --- /dev/null +++ b/youmubot-db-sql/.sqlx/query-4b033607229deba540f80e469753e2125b6d8134346144f462325dc025221044.json @@ -0,0 +1,38 @@ +{ + "db_name": "SQLite", + "query": "SELECT\n beatmap.beatmap_id as \"beatmap_id: i64\",\n beatmap.mode as \"mode: u8\",\n beatmap.cached_at as \"cached_at: DateTime\",\n beatmap.beatmap as \"beatmap: Vec\"\n FROM osu_cached_beatmapsets\n INNER JOIN osu_cached_beatmaps AS beatmap\n ON osu_cached_beatmapsets.beatmap_id = beatmap.beatmap_id\n AND osu_cached_beatmapsets.mode = beatmap.mode\n WHERE\n beatmapset_id = ?\n ", + "describe": { + "columns": [ + { + "name": "beatmap_id: i64", + "ordinal": 0, + "type_info": "Int64" + }, + { + "name": "mode: u8", + "ordinal": 1, + "type_info": "Int64" + }, + { + "name": "cached_at: DateTime", + "ordinal": 2, + "type_info": "Datetime" + }, + { + "name": "beatmap: Vec", + "ordinal": 3, + "type_info": "Blob" + } + ], + "parameters": { + "Right": 1 + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "4b033607229deba540f80e469753e2125b6d8134346144f462325dc025221044" +} diff --git a/youmubot-db-sql/.sqlx/query-5210e3e5610bb968b0b11411b99956d1bf358f2c1e35c4eb5730388ce0c2fe09.json b/youmubot-db-sql/.sqlx/query-5210e3e5610bb968b0b11411b99956d1bf358f2c1e35c4eb5730388ce0c2fe09.json new file mode 100644 index 0000000..d925a90 --- /dev/null +++ b/youmubot-db-sql/.sqlx/query-5210e3e5610bb968b0b11411b99956d1bf358f2c1e35c4eb5730388ce0c2fe09.json @@ -0,0 +1,12 @@ +{ + "db_name": "SQLite", + "query": "INSERT INTO\n osu_last_beatmaps (channel_id, beatmap, mode)\n VALUES\n (?, ?, ?)\n ON CONFLICT (channel_id) DO UPDATE\n SET\n beatmap = excluded.beatmap,\n mode = excluded.mode", + "describe": { + "columns": [], + "parameters": { + "Right": 3 + }, + "nullable": [] + }, + "hash": "5210e3e5610bb968b0b11411b99956d1bf358f2c1e35c4eb5730388ce0c2fe09" +} diff --git a/youmubot-db-sql/.sqlx/query-5753fe315c9a55154d2d80e6d293dc8abffcf426b845624a42cd0bfefc75fb74.json b/youmubot-db-sql/.sqlx/query-5753fe315c9a55154d2d80e6d293dc8abffcf426b845624a42cd0bfefc75fb74.json new file mode 100644 index 0000000..7d74007 --- /dev/null +++ b/youmubot-db-sql/.sqlx/query-5753fe315c9a55154d2d80e6d293dc8abffcf426b845624a42cd0bfefc75fb74.json @@ -0,0 +1,68 @@ +{ + "db_name": "SQLite", + "query": "SELECT\n user_id as \"user_id: i64\",\n username,\n id as \"id: i64\",\n last_update as \"last_update: DateTime\",\n pp_std, pp_taiko, pp_mania, pp_catch,\n failures as \"failures: u8\"\n FROM osu_users", + "describe": { + "columns": [ + { + "name": "user_id: i64", + "ordinal": 0, + "type_info": "Int64" + }, + { + "name": "username", + "ordinal": 1, + "type_info": "Text" + }, + { + "name": "id: i64", + "ordinal": 2, + "type_info": "Int64" + }, + { + "name": "last_update: DateTime", + "ordinal": 3, + "type_info": "Datetime" + }, + { + "name": "pp_std", + "ordinal": 4, + "type_info": "Float" + }, + { + "name": "pp_taiko", + "ordinal": 5, + "type_info": "Float" + }, + { + "name": "pp_mania", + "ordinal": 6, + "type_info": "Float" + }, + { + "name": "pp_catch", + "ordinal": 7, + "type_info": "Float" + }, + { + "name": "failures: u8", + "ordinal": 8, + "type_info": "Int64" + } + ], + "parameters": { + "Right": 0 + }, + "nullable": [ + false, + true, + false, + false, + true, + true, + true, + true, + false + ] + }, + "hash": "5753fe315c9a55154d2d80e6d293dc8abffcf426b845624a42cd0bfefc75fb74" +} diff --git a/youmubot-db-sql/.sqlx/query-6125c1c187029c7ac6e1e9519445e49942ddf6068a16f000dd0750ab8a9d52c2.json b/youmubot-db-sql/.sqlx/query-6125c1c187029c7ac6e1e9519445e49942ddf6068a16f000dd0750ab8a9d52c2.json new file mode 100644 index 0000000..956e81a --- /dev/null +++ b/youmubot-db-sql/.sqlx/query-6125c1c187029c7ac6e1e9519445e49942ddf6068a16f000dd0750ab8a9d52c2.json @@ -0,0 +1,12 @@ +{ + "db_name": "SQLite", + "query": "\n INSERT INTO\n osu_cached_beatmaps (beatmap_id, mode, cached_at, beatmap)\n VALUES\n (?, ?, ?, ?)\n ON CONFLICT (beatmap_id, mode)\n DO UPDATE\n SET\n cached_at = excluded.cached_at,\n beatmap = excluded.beatmap\n ", + "describe": { + "columns": [], + "parameters": { + "Right": 4 + }, + "nullable": [] + }, + "hash": "6125c1c187029c7ac6e1e9519445e49942ddf6068a16f000dd0750ab8a9d52c2" +} diff --git a/youmubot-db-sql/.sqlx/query-6bfd02cb36c9b74ed4c69eb694e936ba2ee8d3864e2a43b43db78afc32a47384.json b/youmubot-db-sql/.sqlx/query-6bfd02cb36c9b74ed4c69eb694e936ba2ee8d3864e2a43b43db78afc32a47384.json new file mode 100644 index 0000000..74c9008 --- /dev/null +++ b/youmubot-db-sql/.sqlx/query-6bfd02cb36c9b74ed4c69eb694e936ba2ee8d3864e2a43b43db78afc32a47384.json @@ -0,0 +1,12 @@ +{ + "db_name": "SQLite", + "query": "\n INSERT INTO\n osu_cached_beatmap_contents (beatmap_id, cached_at, content)\n VALUES\n (?, ?, ?)\n ON CONFLICT (beatmap_id)\n DO UPDATE\n SET\n cached_at = excluded.cached_at,\n content = excluded.content\n ", + "describe": { + "columns": [], + "parameters": { + "Right": 3 + }, + "nullable": [] + }, + "hash": "6bfd02cb36c9b74ed4c69eb694e936ba2ee8d3864e2a43b43db78afc32a47384" +} diff --git a/youmubot-db-sql/.sqlx/query-700ec95294d9a4f21e3d7ff53f15f5dc739bffe8fedc19e35cbb576b6dd2e948.json b/youmubot-db-sql/.sqlx/query-700ec95294d9a4f21e3d7ff53f15f5dc739bffe8fedc19e35cbb576b6dd2e948.json new file mode 100644 index 0000000..ec5b5f5 --- /dev/null +++ b/youmubot-db-sql/.sqlx/query-700ec95294d9a4f21e3d7ff53f15f5dc739bffe8fedc19e35cbb576b6dd2e948.json @@ -0,0 +1,68 @@ +{ + "db_name": "SQLite", + "query": "SELECT\n user_id as \"user_id: i64\",\n username,\n id as \"id: i64\",\n last_update as \"last_update: DateTime\",\n pp_std, pp_taiko, pp_mania, pp_catch,\n failures as \"failures: u8\"\n FROM osu_users WHERE user_id = ?", + "describe": { + "columns": [ + { + "name": "user_id: i64", + "ordinal": 0, + "type_info": "Int64" + }, + { + "name": "username", + "ordinal": 1, + "type_info": "Text" + }, + { + "name": "id: i64", + "ordinal": 2, + "type_info": "Int64" + }, + { + "name": "last_update: DateTime", + "ordinal": 3, + "type_info": "Datetime" + }, + { + "name": "pp_std", + "ordinal": 4, + "type_info": "Float" + }, + { + "name": "pp_taiko", + "ordinal": 5, + "type_info": "Float" + }, + { + "name": "pp_mania", + "ordinal": 6, + "type_info": "Float" + }, + { + "name": "pp_catch", + "ordinal": 7, + "type_info": "Float" + }, + { + "name": "failures: u8", + "ordinal": 8, + "type_info": "Int64" + } + ], + "parameters": { + "Right": 1 + }, + "nullable": [ + false, + true, + false, + false, + true, + true, + true, + true, + false + ] + }, + "hash": "700ec95294d9a4f21e3d7ff53f15f5dc739bffe8fedc19e35cbb576b6dd2e948" +} diff --git a/youmubot-db-sql/.sqlx/query-8b9ad43442b7fa520f2eae498d2ee08264810e49c28bd8ddffaa9f444cada1b5.json b/youmubot-db-sql/.sqlx/query-8b9ad43442b7fa520f2eae498d2ee08264810e49c28bd8ddffaa9f444cada1b5.json new file mode 100644 index 0000000..d9c1c13 --- /dev/null +++ b/youmubot-db-sql/.sqlx/query-8b9ad43442b7fa520f2eae498d2ee08264810e49c28bd8ddffaa9f444cada1b5.json @@ -0,0 +1,12 @@ +{ + "db_name": "SQLite", + "query": "INSERT INTO osu_cached_beatmapsets(beatmapset_id, beatmap_id, mode)\n VALUES (?, ?, ?)\n ON CONFLICT DO NOTHING", + "describe": { + "columns": [], + "parameters": { + "Right": 3 + }, + "nullable": [] + }, + "hash": "8b9ad43442b7fa520f2eae498d2ee08264810e49c28bd8ddffaa9f444cada1b5" +} diff --git a/youmubot-db-sql/.sqlx/query-95541f737a8dfc7f440840617bed87ebde6dabdd70e2ba7b110ebec91e7feda7.json b/youmubot-db-sql/.sqlx/query-95541f737a8dfc7f440840617bed87ebde6dabdd70e2ba7b110ebec91e7feda7.json new file mode 100644 index 0000000..3715e7c --- /dev/null +++ b/youmubot-db-sql/.sqlx/query-95541f737a8dfc7f440840617bed87ebde6dabdd70e2ba7b110ebec91e7feda7.json @@ -0,0 +1,50 @@ +{ + "db_name": "SQLite", + "query": "SELECT\n beatmap_id as \"beatmap_id: i64\",\n mode as \"mode: u8\",\n user_id as \"user_id: i64\",\n mods as \"mods: i64\",\n cached_at as \"cached_at: DateTime\",\n score as \"score: Vec\"\n FROM osu_user_best_scores\n WHERE\n beatmap_id = ?\n AND mode = ?", + "describe": { + "columns": [ + { + "name": "beatmap_id: i64", + "ordinal": 0, + "type_info": "Int64" + }, + { + "name": "mode: u8", + "ordinal": 1, + "type_info": "Int64" + }, + { + "name": "user_id: i64", + "ordinal": 2, + "type_info": "Int64" + }, + { + "name": "mods: i64", + "ordinal": 3, + "type_info": "Int64" + }, + { + "name": "cached_at: DateTime", + "ordinal": 4, + "type_info": "Datetime" + }, + { + "name": "score: Vec", + "ordinal": 5, + "type_info": "Blob" + } + ], + "parameters": { + "Right": 2 + }, + "nullable": [ + false, + false, + false, + false, + false, + false + ] + }, + "hash": "95541f737a8dfc7f440840617bed87ebde6dabdd70e2ba7b110ebec91e7feda7" +} diff --git a/youmubot-db-sql/.sqlx/query-c83421661626cffd81d5590035ae5283a5b0e8a03696ae479b3d275b81b8af83.json b/youmubot-db-sql/.sqlx/query-c83421661626cffd81d5590035ae5283a5b0e8a03696ae479b3d275b81b8af83.json new file mode 100644 index 0000000..e0faea2 --- /dev/null +++ b/youmubot-db-sql/.sqlx/query-c83421661626cffd81d5590035ae5283a5b0e8a03696ae479b3d275b81b8af83.json @@ -0,0 +1,12 @@ +{ + "db_name": "SQLite", + "query": "DELETE FROM osu_user_best_scores WHERE user_id = ?", + "describe": { + "columns": [], + "parameters": { + "Right": 1 + }, + "nullable": [] + }, + "hash": "c83421661626cffd81d5590035ae5283a5b0e8a03696ae479b3d275b81b8af83" +} diff --git a/youmubot-db-sql/.sqlx/query-d428568e88b653317cbe2c5336e6cdee0862df09faaa6c1fa09869d79438e427.json b/youmubot-db-sql/.sqlx/query-d428568e88b653317cbe2c5336e6cdee0862df09faaa6c1fa09869d79438e427.json new file mode 100644 index 0000000..1c1f93c --- /dev/null +++ b/youmubot-db-sql/.sqlx/query-d428568e88b653317cbe2c5336e6cdee0862df09faaa6c1fa09869d79438e427.json @@ -0,0 +1,12 @@ +{ + "db_name": "SQLite", + "query": "DELETE FROM osu_users WHERE user_id = ?", + "describe": { + "columns": [], + "parameters": { + "Right": 1 + }, + "nullable": [] + }, + "hash": "d428568e88b653317cbe2c5336e6cdee0862df09faaa6c1fa09869d79438e427" +} diff --git a/youmubot-db-sql/.sqlx/query-d7c91077f904543740a12185fac7756346aa50a63b911414ee8f7a4a0d6dd1cc.json b/youmubot-db-sql/.sqlx/query-d7c91077f904543740a12185fac7756346aa50a63b911414ee8f7a4a0d6dd1cc.json new file mode 100644 index 0000000..f68b7a6 --- /dev/null +++ b/youmubot-db-sql/.sqlx/query-d7c91077f904543740a12185fac7756346aa50a63b911414ee8f7a4a0d6dd1cc.json @@ -0,0 +1,38 @@ +{ + "db_name": "SQLite", + "query": "SELECT\n beatmap_id as \"beatmap_id: i64\",\n mode as \"mode: u8\",\n cached_at as \"cached_at: DateTime\",\n beatmap as \"beatmap: Vec\"\n FROM osu_cached_beatmaps\n WHERE\n beatmap_id = ?\n AND mode = ?\n ", + "describe": { + "columns": [ + { + "name": "beatmap_id: i64", + "ordinal": 0, + "type_info": "Int64" + }, + { + "name": "mode: u8", + "ordinal": 1, + "type_info": "Int64" + }, + { + "name": "cached_at: DateTime", + "ordinal": 2, + "type_info": "Datetime" + }, + { + "name": "beatmap: Vec", + "ordinal": 3, + "type_info": "Blob" + } + ], + "parameters": { + "Right": 2 + }, + "nullable": [ + false, + false, + false, + false + ] + }, + "hash": "d7c91077f904543740a12185fac7756346aa50a63b911414ee8f7a4a0d6dd1cc" +} diff --git a/youmubot-db-sql/.sqlx/query-e17f70eb4375790907c7ecec1132cab859a7a18a8ce636f0b39c0b5387d9dffc.json b/youmubot-db-sql/.sqlx/query-e17f70eb4375790907c7ecec1132cab859a7a18a8ce636f0b39c0b5387d9dffc.json new file mode 100644 index 0000000..bd0d365 --- /dev/null +++ b/youmubot-db-sql/.sqlx/query-e17f70eb4375790907c7ecec1132cab859a7a18a8ce636f0b39c0b5387d9dffc.json @@ -0,0 +1,12 @@ +{ + "db_name": "SQLite", + "query": "INSERT\n INTO osu_users(user_id, username, id, last_update, pp_std, pp_taiko, pp_mania, pp_catch, failures)\n VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)\n ON CONFLICT (user_id) WHERE id = ? DO UPDATE\n SET\n last_update = excluded.last_update,\n pp_std = excluded.pp_std,\n pp_taiko = excluded.pp_taiko,\n pp_mania = excluded.pp_mania,\n pp_catch = excluded.pp_catch,\n failures = excluded.failures\n ", + "describe": { + "columns": [], + "parameters": { + "Right": 10 + }, + "nullable": [] + }, + "hash": "e17f70eb4375790907c7ecec1132cab859a7a18a8ce636f0b39c0b5387d9dffc" +} diff --git a/youmubot-db-sql/Cargo.toml b/youmubot-db-sql/Cargo.toml index 4c7c879..5ffa6dc 100644 --- a/youmubot-db-sql/Cargo.toml +++ b/youmubot-db-sql/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -sqlx = { version = "0.6", features = ["runtime-tokio-rustls", "sqlite", "chrono", "offline"] } +sqlx = { version = "0.7", features = ["runtime-tokio", "sqlite", "chrono"] } thiserror = "1.0.31" chrono = "0.4.19" futures-util = "0.3.21" diff --git a/youmubot-db-sql/sqlx-data.json b/youmubot-db-sql/sqlx-data.json deleted file mode 100644 index f30f431..0000000 --- a/youmubot-db-sql/sqlx-data.json +++ /dev/null @@ -1,491 +0,0 @@ -{ - "db": "SQLite", - "1bf34dddbe994d6124c9382c75e70e1347329e945de2eefad4bfcab5f81b73ce": { - "query": "SELECT\n channel_id as \"channel_id: i64\",\n beatmap,\n mode as \"mode: u8\"\n FROM osu_last_beatmaps\n WHERE channel_id = ?", - "describe": { - "columns": [ - { - "name": "channel_id: i64", - "ordinal": 0, - "type_info": "Int64" - }, - { - "name": "beatmap", - "ordinal": 1, - "type_info": "Blob" - }, - { - "name": "mode: u8", - "ordinal": 2, - "type_info": "Int64" - } - ], - "parameters": { - "Right": 1 - }, - "nullable": [ - false, - false, - false - ] - } - }, - "235312a1aad1a58c2f7f2d817945bbac57c38ad2c51c1924683d13d045f21ad9": { - "query": "SELECT\n beatmap_id as \"beatmap_id: i64\",\n mode as \"mode: u8\",\n user_id as \"user_id: i64\",\n mods as \"mods: i64\",\n cached_at as \"cached_at: DateTime\",\n score as \"score: Vec\"\n FROM osu_user_best_scores\n WHERE\n beatmap_id = ?\n AND mode = ?\n AND user_id = ?", - "describe": { - "columns": [ - { - "name": "beatmap_id: i64", - "ordinal": 0, - "type_info": "Int64" - }, - { - "name": "mode: u8", - "ordinal": 1, - "type_info": "Int64" - }, - { - "name": "user_id: i64", - "ordinal": 2, - "type_info": "Int64" - }, - { - "name": "mods: i64", - "ordinal": 3, - "type_info": "Int64" - }, - { - "name": "cached_at: DateTime", - "ordinal": 4, - "type_info": "Datetime" - }, - { - "name": "score: Vec", - "ordinal": 5, - "type_info": "Blob" - } - ], - "parameters": { - "Right": 3 - }, - "nullable": [ - false, - false, - false, - false, - false, - false - ] - } - }, - "25077e7b2657eb918fa49acc16ceba14a004ed503c174073a1db184d902ee393": { - "query": "\n INSERT INTO\n osu_user_best_scores (beatmap_id, mode, user_id, mods, cached_at, score)\n VALUES\n (?, ?, ?, ?, ?, ?)\n ON CONFLICT (beatmap_id, mode, user_id, mods)\n DO UPDATE\n SET\n cached_at = excluded.cached_at,\n score = excluded.score\n ", - "describe": { - "columns": [], - "parameters": { - "Right": 6 - }, - "nullable": [] - } - }, - "27edec2f76b1bc48e87b66e6d27e6784e0b0c17dec013feb05c4b7291b8b4a5f": { - "query": "SELECT\n user_id as \"user_id: i64\",\n id as \"id: i64\",\n last_update as \"last_update: DateTime\",\n pp_std, pp_taiko, pp_mania, pp_catch,\n failures as \"failures: u8\"\n FROM osu_users WHERE id = ?", - "describe": { - "columns": [ - { - "name": "user_id: i64", - "ordinal": 0, - "type_info": "Int64" - }, - { - "name": "id: i64", - "ordinal": 1, - "type_info": "Int64" - }, - { - "name": "last_update: DateTime", - "ordinal": 2, - "type_info": "Datetime" - }, - { - "name": "pp_std", - "ordinal": 3, - "type_info": "Float" - }, - { - "name": "pp_taiko", - "ordinal": 4, - "type_info": "Float" - }, - { - "name": "pp_mania", - "ordinal": 5, - "type_info": "Float" - }, - { - "name": "pp_catch", - "ordinal": 6, - "type_info": "Float" - }, - { - "name": "failures: u8", - "ordinal": 7, - "type_info": "Int64" - } - ], - "parameters": { - "Right": 1 - }, - "nullable": [ - false, - false, - false, - true, - true, - true, - true, - false - ] - } - }, - "296c95c7ead4d747a4da007b4b6e28d3c6c1c4bb654c82cc40bf61390c3dad4b": { - "query": "SELECT\n beatmap_id as \"beatmap_id: i64\",\n cached_at as \"cached_at: DateTime\",\n content as \"content: Vec\"\n FROM osu_cached_beatmap_contents\n WHERE\n beatmap_id = ? ", - "describe": { - "columns": [ - { - "name": "beatmap_id: i64", - "ordinal": 0, - "type_info": "Int64" - }, - { - "name": "cached_at: DateTime", - "ordinal": 1, - "type_info": "Datetime" - }, - { - "name": "content: Vec", - "ordinal": 2, - "type_info": "Blob" - } - ], - "parameters": { - "Right": 1 - }, - "nullable": [ - false, - false, - false - ] - } - }, - "3c9d163aa2b752afc74e7b0909a9c1995cd019d9798a992eddc2e778f36f2d4c": { - "query": "SELECT\n user_id as \"user_id: i64\",\n id as \"id: i64\",\n last_update as \"last_update: DateTime\",\n pp_std, pp_taiko, pp_mania, pp_catch,\n failures as \"failures: u8\"\n FROM osu_users", - "describe": { - "columns": [ - { - "name": "user_id: i64", - "ordinal": 0, - "type_info": "Int64" - }, - { - "name": "id: i64", - "ordinal": 1, - "type_info": "Int64" - }, - { - "name": "last_update: DateTime", - "ordinal": 2, - "type_info": "Datetime" - }, - { - "name": "pp_std", - "ordinal": 3, - "type_info": "Float" - }, - { - "name": "pp_taiko", - "ordinal": 4, - "type_info": "Float" - }, - { - "name": "pp_mania", - "ordinal": 5, - "type_info": "Float" - }, - { - "name": "pp_catch", - "ordinal": 6, - "type_info": "Float" - }, - { - "name": "failures: u8", - "ordinal": 7, - "type_info": "Int64" - } - ], - "parameters": { - "Right": 0 - }, - "nullable": [ - false, - false, - false, - true, - true, - true, - true, - false - ] - } - }, - "4b033607229deba540f80e469753e2125b6d8134346144f462325dc025221044": { - "query": "SELECT\n beatmap.beatmap_id as \"beatmap_id: i64\",\n beatmap.mode as \"mode: u8\",\n beatmap.cached_at as \"cached_at: DateTime\",\n beatmap.beatmap as \"beatmap: Vec\"\n FROM osu_cached_beatmapsets\n INNER JOIN osu_cached_beatmaps AS beatmap\n ON osu_cached_beatmapsets.beatmap_id = beatmap.beatmap_id\n AND osu_cached_beatmapsets.mode = beatmap.mode\n WHERE\n beatmapset_id = ?\n ", - "describe": { - "columns": [ - { - "name": "beatmap_id: i64", - "ordinal": 0, - "type_info": "Int64" - }, - { - "name": "mode: u8", - "ordinal": 1, - "type_info": "Int64" - }, - { - "name": "cached_at: DateTime", - "ordinal": 2, - "type_info": "Datetime" - }, - { - "name": "beatmap: Vec", - "ordinal": 3, - "type_info": "Blob" - } - ], - "parameters": { - "Right": 1 - }, - "nullable": [ - false, - false, - false, - false - ] - } - }, - "5210e3e5610bb968b0b11411b99956d1bf358f2c1e35c4eb5730388ce0c2fe09": { - "query": "INSERT INTO\n osu_last_beatmaps (channel_id, beatmap, mode)\n VALUES\n (?, ?, ?)\n ON CONFLICT (channel_id) DO UPDATE\n SET\n beatmap = excluded.beatmap,\n mode = excluded.mode", - "describe": { - "columns": [], - "parameters": { - "Right": 3 - }, - "nullable": [] - } - }, - "55fc5c2846680c32a2c9646e45cc578cff25cde57cca19f5fb53dceacc154954": { - "query": "SELECT\n user_id as \"user_id: i64\",\n id as \"id: i64\",\n last_update as \"last_update: DateTime\",\n pp_std, pp_taiko, pp_mania, pp_catch,\n failures as \"failures: u8\"\n FROM osu_users WHERE user_id = ?", - "describe": { - "columns": [ - { - "name": "user_id: i64", - "ordinal": 0, - "type_info": "Int64" - }, - { - "name": "id: i64", - "ordinal": 1, - "type_info": "Int64" - }, - { - "name": "last_update: DateTime", - "ordinal": 2, - "type_info": "Datetime" - }, - { - "name": "pp_std", - "ordinal": 3, - "type_info": "Float" - }, - { - "name": "pp_taiko", - "ordinal": 4, - "type_info": "Float" - }, - { - "name": "pp_mania", - "ordinal": 5, - "type_info": "Float" - }, - { - "name": "pp_catch", - "ordinal": 6, - "type_info": "Float" - }, - { - "name": "failures: u8", - "ordinal": 7, - "type_info": "Int64" - } - ], - "parameters": { - "Right": 1 - }, - "nullable": [ - false, - false, - false, - true, - true, - true, - true, - false - ] - } - }, - "6125c1c187029c7ac6e1e9519445e49942ddf6068a16f000dd0750ab8a9d52c2": { - "query": "\n INSERT INTO\n osu_cached_beatmaps (beatmap_id, mode, cached_at, beatmap)\n VALUES\n (?, ?, ?, ?)\n ON CONFLICT (beatmap_id, mode)\n DO UPDATE\n SET\n cached_at = excluded.cached_at,\n beatmap = excluded.beatmap\n ", - "describe": { - "columns": [], - "parameters": { - "Right": 4 - }, - "nullable": [] - } - }, - "6bfd02cb36c9b74ed4c69eb694e936ba2ee8d3864e2a43b43db78afc32a47384": { - "query": "\n INSERT INTO\n osu_cached_beatmap_contents (beatmap_id, cached_at, content)\n VALUES\n (?, ?, ?)\n ON CONFLICT (beatmap_id)\n DO UPDATE\n SET\n cached_at = excluded.cached_at,\n content = excluded.content\n ", - "describe": { - "columns": [], - "parameters": { - "Right": 3 - }, - "nullable": [] - } - }, - "6c95dc522e1e8490358ce4c5fea08fe50300ab4092b33eef44aba85f4a43c818": { - "query": "INSERT\n INTO osu_users(user_id, id, last_update, pp_std, pp_taiko, pp_mania, pp_catch, failures)\n VALUES(?, ?, ?, ?, ?, ?, ?, ?)\n ON CONFLICT (user_id) WHERE id = ? DO UPDATE\n SET\n last_update = excluded.last_update,\n pp_std = excluded.pp_std,\n pp_taiko = excluded.pp_taiko,\n pp_mania = excluded.pp_mania,\n pp_catch = excluded.pp_catch,\n failures = excluded.failures\n ", - "describe": { - "columns": [], - "parameters": { - "Right": 9 - }, - "nullable": [] - } - }, - "8b9ad43442b7fa520f2eae498d2ee08264810e49c28bd8ddffaa9f444cada1b5": { - "query": "INSERT INTO osu_cached_beatmapsets(beatmapset_id, beatmap_id, mode)\n VALUES (?, ?, ?)\n ON CONFLICT DO NOTHING", - "describe": { - "columns": [], - "parameters": { - "Right": 3 - }, - "nullable": [] - } - }, - "95541f737a8dfc7f440840617bed87ebde6dabdd70e2ba7b110ebec91e7feda7": { - "query": "SELECT\n beatmap_id as \"beatmap_id: i64\",\n mode as \"mode: u8\",\n user_id as \"user_id: i64\",\n mods as \"mods: i64\",\n cached_at as \"cached_at: DateTime\",\n score as \"score: Vec\"\n FROM osu_user_best_scores\n WHERE\n beatmap_id = ?\n AND mode = ?", - "describe": { - "columns": [ - { - "name": "beatmap_id: i64", - "ordinal": 0, - "type_info": "Int64" - }, - { - "name": "mode: u8", - "ordinal": 1, - "type_info": "Int64" - }, - { - "name": "user_id: i64", - "ordinal": 2, - "type_info": "Int64" - }, - { - "name": "mods: i64", - "ordinal": 3, - "type_info": "Int64" - }, - { - "name": "cached_at: DateTime", - "ordinal": 4, - "type_info": "Datetime" - }, - { - "name": "score: Vec", - "ordinal": 5, - "type_info": "Blob" - } - ], - "parameters": { - "Right": 2 - }, - "nullable": [ - false, - false, - false, - false, - false, - false - ] - } - }, - "c83421661626cffd81d5590035ae5283a5b0e8a03696ae479b3d275b81b8af83": { - "query": "DELETE FROM osu_user_best_scores WHERE user_id = ?", - "describe": { - "columns": [], - "parameters": { - "Right": 1 - }, - "nullable": [] - } - }, - "d428568e88b653317cbe2c5336e6cdee0862df09faaa6c1fa09869d79438e427": { - "query": "DELETE FROM osu_users WHERE user_id = ?", - "describe": { - "columns": [], - "parameters": { - "Right": 1 - }, - "nullable": [] - } - }, - "d7c91077f904543740a12185fac7756346aa50a63b911414ee8f7a4a0d6dd1cc": { - "query": "SELECT\n beatmap_id as \"beatmap_id: i64\",\n mode as \"mode: u8\",\n cached_at as \"cached_at: DateTime\",\n beatmap as \"beatmap: Vec\"\n FROM osu_cached_beatmaps\n WHERE\n beatmap_id = ?\n AND mode = ?\n ", - "describe": { - "columns": [ - { - "name": "beatmap_id: i64", - "ordinal": 0, - "type_info": "Int64" - }, - { - "name": "mode: u8", - "ordinal": 1, - "type_info": "Int64" - }, - { - "name": "cached_at: DateTime", - "ordinal": 2, - "type_info": "Datetime" - }, - { - "name": "beatmap: Vec", - "ordinal": 3, - "type_info": "Blob" - } - ], - "parameters": { - "Right": 2 - }, - "nullable": [ - false, - false, - false, - false - ] - } - } -} \ No newline at end of file diff --git a/youmubot-osu/src/discord/beatmap_cache.rs b/youmubot-osu/src/discord/beatmap_cache.rs index 93e1f49..40f3d76 100644 --- a/youmubot-osu/src/discord/beatmap_cache.rs +++ b/youmubot-osu/src/discord/beatmap_cache.rs @@ -106,9 +106,9 @@ impl BeatmapMetaCache { let mut t = self.pool.begin().await?; for b in &beatmaps { let mut b = Self::to_cached_beatmap(b, None); - b.store(&mut t).await?; + b.store(&mut *t).await?; // Save the beatmapset mapping. - b.link_beatmapset(id as i64, &mut t).await?; + b.link_beatmapset(id as i64, &mut *t).await?; } t.commit().await?; } diff --git a/youmubot-osu/src/discord/db.rs b/youmubot-osu/src/discord/db.rs index db6c788..32ece1c 100644 --- a/youmubot-osu/src/discord/db.rs +++ b/youmubot-osu/src/discord/db.rs @@ -26,7 +26,7 @@ impl OsuSavedUsers { /// Get all users pub async fn all(&self) -> Result> { let mut conn = self.pool.acquire().await?; - model::OsuUser::all(&mut conn) + model::OsuUser::all(&mut *conn) .map(|v| v.map(OsuUser::from).map_err(Error::from)) .try_collect() .await @@ -35,7 +35,7 @@ impl OsuSavedUsers { /// Get an user by their user_id. pub async fn by_user_id(&self, user_id: UserId) -> Result> { let mut conn = self.pool.acquire().await?; - let u = model::OsuUser::by_user_id(user_id.0 as i64, &mut conn) + let u = model::OsuUser::by_user_id(user_id.0 as i64, &mut *conn) .await? .map(OsuUser::from); Ok(u) @@ -44,14 +44,14 @@ impl OsuSavedUsers { /// Save the given user. pub async fn save(&self, u: OsuUser) -> Result<()> { let mut conn = self.pool.acquire().await?; - Ok(model::OsuUser::from(u).store(&mut conn).await?) + Ok(model::OsuUser::from(u).store(&mut *conn).await?) } /// Save the given user as a completely new user. pub async fn new_user(&self, u: OsuUser) -> Result<()> { let mut t = self.pool.begin().await?; - model::OsuUser::delete(u.user_id.0 as i64, &mut t).await?; - model::OsuUser::from(u).store(&mut t).await?; + model::OsuUser::delete(u.user_id.0 as i64, &mut *t).await?; + model::OsuUser::from(u).store(&mut *t).await?; t.commit().await?; Ok(()) }