Skip to main content

max / goingson

Bump sqlx to 0.9, pin libsqlite3-sys 0.37 sqlx 0.8 -> 0.9.0; libsqlite3-sys 0.30 -> 0.37 so goingson's sqlx-sqlite co-links with synckit-client's rusqlite 0.39 (both on libsqlite3-sys 0.37). 0.9 changes applied: dynamic SQL wrapped in sqlx::AssertSqlSafe (repository query builders are structurally dynamic with bound values), the ArgumentBuffer / SqliteArguments associated types dropped their lifetime (custom Encode/Decode impls updated), and borrowed &str query params take AssertSqlSafe.
Co-Authored-By
Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Author: Max Johnson <me@maxj.phd> · 2026-07-21 01:23 UTC
Signed with PGP, not checked
Commit: 3a245f595a39a5d6b2f343f9856c4f9394acd3c3
Parent: 27ed972
20 files changed, +183 insertions, -221 deletions
M Cargo.lock +115 -153
@@ -14,7 +14,7 @@
14 14 source = "registry+https://github.com/rust-lang/crates.io-index"
15 15 checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0"
16 16 dependencies = [
17 - "crypto-common",
17 + "crypto-common 0.1.7",
18 18 "generic-array",
19 19 ]
20 20
@@ -29,18 +29,6 @@
29 29 "cpufeatures 0.2.17",
30 30 ]
31 31
32 - [[package]]
33 - name = "ahash"
34 - version = "0.8.12"
35 - source = "registry+https://github.com/rust-lang/crates.io-index"
36 - checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75"
37 - dependencies = [
38 - "cfg-if",
39 - "once_cell",
40 - "version_check",
41 - "zerocopy",
42 - ]
43 -
44 32 [[package]]
45 33 name = "aho-corasick"
46 34 version = "1.1.4"
@@ -523,7 +511,7 @@
523 511 source = "registry+https://github.com/rust-lang/crates.io-index"
524 512 checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe"
525 513 dependencies = [
526 - "digest",
514 + "digest 0.10.7",
527 515 ]
528 516
529 517 [[package]]
@@ -535,6 +523,15 @@
535 523 "generic-array",
536 524 ]
537 525
526 + [[package]]
527 + name = "block-buffer"
528 + version = "0.12.1"
529 + source = "registry+https://github.com/rust-lang/crates.io-index"
530 + checksum = "d2f6c7dbe95a6ed67ad9f18e57daf93a2f034c524b99fd2b76d18fdfeb6660aa"
531 + dependencies = [
532 + "hybrid-array",
533 + ]
534 +
538 535 [[package]]
539 536 name = "block-padding"
540 537 version = "0.3.3"
@@ -837,7 +834,7 @@
837 834 source = "registry+https://github.com/rust-lang/crates.io-index"
838 835 checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad"
839 836 dependencies = [
840 - "crypto-common",
837 + "crypto-common 0.1.7",
841 838 "inout",
842 839 "zeroize",
843 840 ]
@@ -851,6 +848,12 @@
851 848 "cc",
852 849 ]
853 850
851 + [[package]]
852 + name = "cmov"
853 + version = "0.5.4"
854 + source = "registry+https://github.com/rust-lang/crates.io-index"
855 + checksum = "0c9ea0ac24bc397ab3c98583a3c9ba74fa56b09a4449bbe172b9b1ddb016027a"
856 +
854 857 [[package]]
855 858 name = "combine"
856 859 version = "4.6.7"
@@ -900,12 +903,6 @@
900 903 "crossbeam-utils",
901 904 ]
902 905
903 - [[package]]
904 - name = "const-oid"
905 - version = "0.9.6"
906 - source = "registry+https://github.com/rust-lang/crates.io-index"
907 - checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8"
908 -
909 906 [[package]]
910 907 name = "convert_case"
911 908 version = "0.4.0"
@@ -1091,6 +1088,15 @@
1091 1088 "typenum",
1092 1089 ]
1093 1090
1091 + [[package]]
1092 + name = "crypto-common"
1093 + version = "0.2.2"
1094 + source = "registry+https://github.com/rust-lang/crates.io-index"
1095 + checksum = "ce6e4c961d6cd6c9a86db418387425e8bdeaf05b3c8bc1411e6dca4c252f1453"
1096 + dependencies = [
1097 + "hybrid-array",
1098 + ]
1099 +
1094 1100 [[package]]
1095 1101 name = "csscolorparser"
1096 1102 version = "0.6.2"
@@ -1183,6 +1189,15 @@
1183 1189 "syn 2.0.117",
1184 1190 ]
1185 1191
1192 + [[package]]
1193 + name = "ctutils"
1194 + version = "0.4.2"
1195 + source = "registry+https://github.com/rust-lang/crates.io-index"
1196 + checksum = "7d5515a3834141de9eafb9717ad39eea8247b5674e6066c404e8c4b365d2a29e"
1197 + dependencies = [
1198 + "cmov",
1199 + ]
1200 +
1186 1201 [[package]]
1187 1202 name = "darling"
1188 1203 version = "0.23.0"
@@ -1229,17 +1244,6 @@
1229 1244 source = "registry+https://github.com/rust-lang/crates.io-index"
1230 1245 checksum = "5729f5117e208430e437df2f4843f5e5952997175992d1414f94c57d61e270b4"
1231 1246
1232 - [[package]]
1233 - name = "der"
1234 - version = "0.7.10"
1235 - source = "registry+https://github.com/rust-lang/crates.io-index"
1236 - checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb"
1237 - dependencies = [
1238 - "const-oid",
1239 - "pem-rfc7468",
1240 - "zeroize",
1241 - ]
1242 -
1243 1247 [[package]]
1244 1248 name = "deranged"
1245 1249 version = "0.5.8"
@@ -1302,12 +1306,22 @@
1302 1306 source = "registry+https://github.com/rust-lang/crates.io-index"
1303 1307 checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
1304 1308 dependencies = [
1305 - "block-buffer",
1306 - "const-oid",
1307 - "crypto-common",
1309 + "block-buffer 0.10.4",
1310 + "crypto-common 0.1.7",
1308 1311 "subtle",
1309 1312 ]
1310 1313
1314 + [[package]]
1315 + name = "digest"
1316 + version = "0.11.3"
1317 + source = "registry+https://github.com/rust-lang/crates.io-index"
1318 + checksum = "f1dd6dbb5841937940781866fa1281a1ff7bd3bf827091440879f9994983d5c2"
1319 + dependencies = [
1320 + "block-buffer 0.12.1",
1321 + "crypto-common 0.2.2",
1322 + "ctutils",
1323 + ]
1324 +
1311 1325 [[package]]
1312 1326 name = "dirs"
1313 1327 version = "6.0.0"
@@ -1566,13 +1580,12 @@
1566 1580
1567 1581 [[package]]
1568 1582 name = "etcetera"
1569 - version = "0.8.0"
1583 + version = "0.11.0"
1570 1584 source = "registry+https://github.com/rust-lang/crates.io-index"
1571 - checksum = "136d1b5283a1ab77bd9257427ffd09d8667ced0570b6f938942bc7568ed5b943"
1585 + checksum = "de48cc4d1c1d97a20fd819def54b890cadde72ed3ad0c614822a0a433361be96"
1572 1586 dependencies = [
1573 1587 "cfg-if",
1574 - "home",
1575 - "windows-sys 0.48.0",
1588 + "windows-sys 0.61.2",
1576 1589 ]
1577 1590
1578 1591 [[package]]
@@ -1716,9 +1729,9 @@
1716 1729
1717 1730 [[package]]
1718 1731 name = "flume"
1719 - version = "0.11.1"
1732 + version = "0.12.0"
1720 1733 source = "registry+https://github.com/rust-lang/crates.io-index"
1721 - checksum = "da0e4dd2a88388a1f4ccc7c9ce104604dab68d9f408dc34cd45823d5a9069095"
1734 + checksum = "5e139bc46ca777eb5efaf62df0ab8cc5fd400866427e56c68b22e414e53bd3be"
1722 1735 dependencies = [
1723 1736 "futures-core",
1724 1737 "futures-sink",
@@ -2233,7 +2246,7 @@
2233 2246 "chrono-tz",
2234 2247 "serde",
2235 2248 "serde_json",
2236 - "sha2",
2249 + "sha2 0.10.9",
2237 2250 "sqlx",
2238 2251 "strum",
2239 2252 "strum_macros",
@@ -2290,7 +2303,7 @@
2290 2303 "rfd",
2291 2304 "serde",
2292 2305 "serde_json",
2293 - "sha2",
2306 + "sha2 0.10.9",
2294 2307 "sqlx",
2295 2308 "synckit-client",
2296 2309 "tauri",
@@ -2405,23 +2418,12 @@
2405 2418 source = "registry+https://github.com/rust-lang/crates.io-index"
2406 2419 checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
2407 2420
2408 - [[package]]
2409 - name = "hashbrown"
2410 - version = "0.14.5"
2411 - source = "registry+https://github.com/rust-lang/crates.io-index"
2412 - checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1"
2413 - dependencies = [
2414 - "ahash",
2415 - ]
2416 -
2417 2421 [[package]]
2418 2422 name = "hashbrown"
2419 2423 version = "0.15.5"
2420 2424 source = "registry+https://github.com/rust-lang/crates.io-index"
2421 2425 checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1"
2422 2426 dependencies = [
2423 - "allocator-api2",
2424 - "equivalent",
2425 2427 "foldhash 0.1.5",
2426 2428 ]
2427 2429
@@ -2449,20 +2451,11 @@
2449 2451
2450 2452 [[package]]
2451 2453 name = "hashlink"
2452 - version = "0.9.1"
2454 + version = "0.11.1"
2453 2455 source = "registry+https://github.com/rust-lang/crates.io-index"
2454 - checksum = "6ba4ff7128dee98c7dc9794b6a411377e1404dba1c97deb8d1a55297bd25d8af"
2456 + checksum = "824e001ac4f3012dd16a264bec811403a67ca9deb6c102fc5049b32c4574b35f"
2455 2457 dependencies = [
2456 - "hashbrown 0.14.5",
2457 - ]
2458 -
2459 - [[package]]
2460 - name = "hashlink"
2461 - version = "0.10.0"
2462 - source = "registry+https://github.com/rust-lang/crates.io-index"
2463 - checksum = "7382cf6263419f2d8df38c55d7da83da5c18aef87fc7a7fc1fb1e344edfe14c1"
2464 - dependencies = [
2465 - "hashbrown 0.15.5",
2458 + "hashbrown 0.16.1",
2466 2459 ]
2467 2460
2468 2461 [[package]]
@@ -2495,7 +2488,16 @@
2495 2488 source = "registry+https://github.com/rust-lang/crates.io-index"
2496 2489 checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7"
2497 2490 dependencies = [
2498 - "hmac",
2491 + "hmac 0.12.1",
2492 + ]
2493 +
2494 + [[package]]
2495 + name = "hkdf"
2496 + version = "0.13.0"
2497 + source = "registry+https://github.com/rust-lang/crates.io-index"
2498 + checksum = "4aaa26c720c68b866f2c96ef5c1264b3e6f473fe5d4ce61cd44bbe913e553018"
2499 + dependencies = [
2500 + "hmac 0.13.0",
2499 2501 ]
2500 2502
2501 2503 [[package]]
@@ -2504,16 +2506,16 @@
2504 2506 source = "registry+https://github.com/rust-lang/crates.io-index"
2505 2507 checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e"
2506 2508 dependencies = [
2507 - "digest",
2509 + "digest 0.10.7",
2508 2510 ]
2509 2511
2510 2512 [[package]]
2511 - name = "home"
2512 - version = "0.5.12"
2513 + name = "hmac"
2514 + version = "0.13.0"
2513 2515 source = "registry+https://github.com/rust-lang/crates.io-index"
2514 - checksum = "cc627f471c528ff0c4a49e1d5e60450c8f6461dd6d10ba9dcd3a61d3dff7728d"
2516 + checksum = "6303bc9732ae41b04cb554b844a762b4115a61bfaa81e3e83050991eeb56863f"
2515 2517 dependencies = [
2516 - "windows-sys 0.61.2",
2518 + "digest 0.11.3",
2517 2519 ]
2518 2520
2519 2521 [[package]]
@@ -2593,6 +2595,15 @@
2593 2595 source = "registry+https://github.com/rust-lang/crates.io-index"
2594 2596 checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9"
2595 2597
2598 + [[package]]
2599 + name = "hybrid-array"
2600 + version = "0.4.13"
2601 + source = "registry+https://github.com/rust-lang/crates.io-index"
2602 + checksum = "818356c5132c1fede50f837ca96afbe78ff42413047f4abb886217845e1b6c8c"
2603 + dependencies = [
2604 + "typenum",
2605 + ]
2606 +
2596 2607 [[package]]
2597 2608 name = "hyper"
2598 2609 version = "1.8.1"
@@ -3241,9 +3252,6 @@
3241 3252 version = "1.5.0"
3242 3253 source = "registry+https://github.com/rust-lang/crates.io-index"
3243 3254 checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
3244 - dependencies = [
3245 - "spin",
3246 - ]
3247 3255
3248 3256 [[package]]
3249 3257 name = "leb128fmt"
@@ -3337,9 +3345,9 @@
3337 3345
3338 3346 [[package]]
3339 3347 name = "libsqlite3-sys"
3340 - version = "0.30.1"
3348 + version = "0.37.0"
3341 3349 source = "registry+https://github.com/rust-lang/crates.io-index"
3342 - checksum = "2e99fb7a497b1e3339bc746195567ed8d3e24945ecd636e3619d20b9de9e9149"
3350 + checksum = "b1f111c8c41e7c61a49cd34e44c7619462967221a6443b0ec299e0ac30cfb9b1"
3343 3351 dependencies = [
3344 3352 "cc",
3345 3353 "pkg-config",
@@ -3529,12 +3537,12 @@
3529 3537
3530 3538 [[package]]
3531 3539 name = "md-5"
3532 - version = "0.10.6"
3540 + version = "0.11.0"
3533 3541 source = "registry+https://github.com/rust-lang/crates.io-index"
3534 - checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf"
3542 + checksum = "69b6441f590336821bb897fb28fc622898ccceb1d6cea3fde5ea86b090c4de98"
3535 3543 dependencies = [
3536 3544 "cfg-if",
3537 - "digest",
3545 + "digest 0.11.3",
3538 3546 ]
3539 3547
3540 3548 [[package]]
@@ -3828,22 +3836,6 @@
3828 3836 "num-traits",
3829 3837 ]
3830 3838
3831 - [[package]]
3832 - name = "num-bigint-dig"
3833 - version = "0.8.6"
3834 - source = "registry+https://github.com/rust-lang/crates.io-index"
3835 - checksum = "e661dda6640fad38e827a6d4a310ff4763082116fe217f279885c97f511bb0b7"
3836 - dependencies = [
3837 - "lazy_static",
3838 - "libm",
3839 - "num-integer",
3840 - "num-iter",
3841 - "num-traits",
3842 - "rand 0.8.5",
3843 - "smallvec",
3844 - "zeroize",
3845 - ]
3846 -
3847 3839 [[package]]
3848 3840 name = "num-complex"
3849 3841 version = "0.4.6"
@@ -3908,7 +3900,6 @@
3908 3900 checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
3909 3901 dependencies = [
3910 3902 "autocfg",
3911 - "libm",
3912 3903 ]
3913 3904
3914 3905 [[package]]
@@ -4290,15 +4281,6 @@
4290 4281 source = "registry+https://github.com/rust-lang/crates.io-index"
4291 4282 checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3"
4292 4283
4293 - [[package]]
4294 - name = "pem-rfc7468"
4295 - version = "0.7.0"
4296 - source = "registry+https://github.com/rust-lang/crates.io-index"
4297 - checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412"
4298 - dependencies = [
4299 - "base64ct",
4300 - ]
4301 -
4302 4284 [[package]]
4303 4285 name = "percent-encoding"
4304 4286 version = "2.3.2"
@@ -4595,27 +4577,6 @@
4595 4577 "futures-io",
4596 4578 ]
4597 4579
4598 - [[package]]
4599 - name = "pkcs1"
4600 - version = "0.7.5"
4601 - source = "registry+https://github.com/rust-lang/crates.io-index"
4602 - checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f"
4603 - dependencies = [
4604 - "der",
4605 - "pkcs8",
4606 - "spki",
4607 - ]
4608 -
4609 - [[package]]
4610 - name = "pkcs8"
4611 - version = "0.10.2"
4612 - source = "registry+https://github.com/rust-lang/crates.io-index"
4613 - checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7"
4614 - dependencies = [
4615 - "der",
4616 - "spki",
4617 - ]
4618 -
4619 4580 [[package]]
4620 4581 name = "pkg-config"
4621 4582 version = "0.3.32"
@@ -5350,37 +5311,28 @@
5350 5311 ]
5351 5312
5352 5313 [[package]]
5353 - name = "rsa"
5354 - version = "0.9.10"
5314 + name = "rsqlite-vfs"
5315 + version = "0.1.1"
5355 5316 source = "registry+https://github.com/rust-lang/crates.io-index"
5356 - checksum = "b8573f03f5883dcaebdfcf4725caa1ecb9c15b2ef50c43a07b816e06799bb12d"
5317 + checksum = "c51c9ae4df8a7fba42103df5c621fa3c37eccf3a3c650879e90fc48b11cc192c"
5357 5318 dependencies = [
5358 - "const-oid",
5359 - "digest",
5360 - "num-bigint-dig",
5361 - "num-integer",
5362 - "num-traits",
5363 - "pkcs1",
5364 - "pkcs8",
5365 - "rand_core 0.6.4",
5366 - "signature",
5367 - "spki",
5368 - "subtle",
5369 - "zeroize",
5319 + "hashbrown 0.16.1",
5320 + "thiserror 2.0.18",
5370 5321 ]
5371 5322
5372 5323 [[package]]
5373 5324 name = "rusqlite"
5374 - version = "0.32.1"
5325 + version = "0.39.0"
5375 5326 source = "registry+https://github.com/rust-lang/crates.io-index"
5376 - checksum = "7753b721174eb8ff87a9a0e799e2d7bc3749323e773db92e0984debb00019d6e"
5327 + checksum = "a0d2b0146dd9661bf67bb107c0bb2a55064d556eeb3fc314151b957f313bcd4e"
5377 5328 dependencies = [
5378 5329 "bitflags 2.13.1",
5379 5330 "fallible-iterator",
5380 5331 "fallible-streaming-iterator",
5381 - "hashlink 0.9.1",
5332 + "hashlink",
5382 5333 "libsqlite3-sys",
5383 5334 "smallvec",
5335 + "sqlite-wasm-rs",
5384 5336 ]
5385 5337
5386 5338 [[package]]
@@ -5600,11 +5552,11 @@
5600 5552 "futures-util",
5601 5553 "generic-array",
5602 5554 "getrandom 0.2.17",
5603 - "hkdf",
5555 + "hkdf 0.12.4",
5604 5556 "num",
5605 5557 "once_cell",
5606 5558 "serde",
5607 - "sha2",
5559 + "sha2 0.10.9",
5608 5560 "zbus",
5609 5561 ]
5610 5562
@@ -5876,13 +5828,13 @@
5876 5828
5877 5829 [[package]]
5878 5830 name = "sha1"
5879 - version = "0.10.6"
5831 + version = "0.11.0"
5880 5832 source = "registry+https://github.com/rust-lang/crates.io-index"
5881 - checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba"
5833 + checksum = "aacc4cc499359472b4abe1bf11d0b12e688af9a805fa5e3016f9a386dc2d0214"
5882 5834 dependencies = [
5883 5835 "cfg-if",
5884 - "cpufeatures 0.2.17",
5885 - "digest",
5836 + "cpufeatures 0.3.0",
5837 + "digest 0.11.3",
5886 5838 ]
5887 5839
5888 5840 [[package]]
@@ -5899,7 +5851,18 @@
5899 5851 dependencies = [
5900 5852 "cfg-if",
5901 5853 "cpufeatures 0.2.17",
5902 - "digest",
5854 + "digest 0.10.7",
5855 + ]
5856 +
5857 + [[package]]
5858 + name = "sha2"
5859 + version = "0.11.0"
5860 + source = "registry+https://github.com/rust-lang/crates.io-index"
5861 + checksum = "446ba717509524cb3f22f17ecc096f10f4822d76ab5c0b9822c5f9c284e825f4"
5862 + dependencies = [
5863 + "cfg-if",
5864 + "cpufeatures 0.3.0",
5865 + "digest 0.11.3",
5903 5866 ]
5904 5867
5905 5868 [[package]]
@@ -5948,16 +5911,6 @@
5948 5911 "libc",
5949 5912 ]
5950 5913
5951 - [[package]]
Lines truncated
M Cargo.toml +1 -1
@@ -28,7 +28,7 @@
28 28 tokio = { version = "1.49", features = ["rt-multi-thread", "macros"] }
29 29
30 30 # Database - SQLx
31 - sqlx = { version = "0.8", features = ["runtime-tokio"] }
31 + sqlx = { version = "0.9", features = ["runtime-tokio"] }
32 32
33 33 # Authentication
34 34 argon2 = "0.5"
@@ -108,7 +108,7 @@
108 108 # Android: bundle SQLite (system SQLite not accessible via NDK)
109 109 # and vendor OpenSSL (native-tls deps need it for cross-compilation)
110 110 [target.'cfg(target_os = "android")'.dependencies]
111 - libsqlite3-sys = { version = "0.30", features = ["bundled"] }
111 + libsqlite3-sys = { version = "0.37", features = ["bundled"] }
112 112 openssl = { version = "0.10", features = ["vendored"] }
113 113
114 114 [dev-dependencies]
@@ -88,7 +88,7 @@
88 88 impl<'q> sqlx::Encode<'q, sqlx::Sqlite> for $name {
89 89 fn encode_by_ref(
90 90 &self,
91 - buf: &mut <sqlx::Sqlite as sqlx::Database>::ArgumentBuffer<'q>,
91 + buf: &mut <sqlx::Sqlite as sqlx::Database>::ArgumentBuffer,
92 92 ) -> Result<sqlx::encode::IsNull, sqlx::error::BoxDynError> {
93 93 <Uuid as sqlx::Encode<'q, sqlx::Sqlite>>::encode_by_ref(&self.0, buf)
94 94 }
@@ -163,7 +163,7 @@
163 163 table, col_list, placeholders, conflict
164 164 );
165 165
166 - let mut query = sqlx::query(&sql);
166 + let mut query = sqlx::query(sqlx::AssertSqlSafe(sql.as_str()));
167 167
168 168 for col in &included {
169 169 query = bind_json_value(query, &data[*col]);
@@ -186,7 +186,7 @@
186 186 conn: &mut SqliteConnection,
187 187 table: &str,
188 188 ) -> Result<std::collections::HashSet<String>, CoreError> {
189 - let rows = sqlx::query(&format!("PRAGMA table_info({})", table))
189 + let rows = sqlx::query(sqlx::AssertSqlSafe(format!("PRAGMA table_info({})", table)))
190 190 .fetch_all(&mut *conn)
191 191 .await
192 192 .map_err(CoreError::database)?;
@@ -235,7 +235,7 @@
235 235 col_list, placeholders, update_set
236 236 );
237 237
238 - let mut query = sqlx::query(&sql);
238 + let mut query = sqlx::query(sqlx::AssertSqlSafe(sql.as_str()));
239 239
240 240 // Bind the 16 sync columns from data
241 241 for col in cols {
@@ -255,9 +255,9 @@
255 255
256 256 /// Bind a JSON value to a sqlx query.
257 257 pub(crate) fn bind_json_value<'q>(
258 - query: sqlx::query::Query<'q, sqlx::Sqlite, sqlx::sqlite::SqliteArguments<'q>>,
258 + query: sqlx::query::Query<'q, sqlx::Sqlite, sqlx::sqlite::SqliteArguments>,
259 259 val: &'q serde_json::Value,
260 - ) -> sqlx::query::Query<'q, sqlx::Sqlite, sqlx::sqlite::SqliteArguments<'q>> {
260 + ) -> sqlx::query::Query<'q, sqlx::Sqlite, sqlx::sqlite::SqliteArguments> {
261 261 match val {
262 262 serde_json::Value::String(s) => query.bind(s.as_str()),
263 263 serde_json::Value::Number(n) => {
@@ -287,7 +287,7 @@
287 287 }
288 288
289 289 let sql = format!("DELETE FROM {} WHERE id = ?", table);
290 - sqlx::query(&sql)
290 + sqlx::query(sqlx::AssertSqlSafe(sql.as_str()))
291 291 .bind(row_id)
292 292 .execute(&mut *conn)
293 293 .await
@@ -155,7 +155,7 @@
155 155 "SELECT table_name, row_id, hlc_wall, hlc_counter, hlc_node \
156 156 FROM sync_committed_hlc WHERE row_id IN ({placeholders})"
157 157 );
158 - let mut query = sqlx::query_as::<_, (String, String, i64, i64, String)>(&sql);
158 + let mut query = sqlx::query_as::<_, (String, String, i64, i64, String)>(sqlx::AssertSqlSafe(sql.as_str()));
159 159 for (_, row_id) in keys {
160 160 query = query.bind(row_id);
161 161 }
@@ -183,7 +183,7 @@
183 183 WHERE NOT EXISTS (SELECT 1 FROM sync_changelog sc WHERE sc.table_name = '{table}' AND sc.row_id = {table}.id)",
184 184 );
185 185
186 - let result = sqlx::query(&sql)
186 + let result = sqlx::query(sqlx::AssertSqlSafe(sql.as_str()))
187 187 .execute(pool)
188 188 .await
189 189 .map_err(CoreError::database)?;
@@ -26,7 +26,7 @@
26 26 let placeholders = keys.iter().map(|_| "?").collect::<Vec<_>>().join(",");
27 27 let query = format!("SELECT key, value FROM sync_state WHERE key IN ({})", placeholders);
28 28
29 - let mut q = sqlx::query_as::<_, (String, String)>(&query);
29 + let mut q = sqlx::query_as::<_, (String, String)>(sqlx::AssertSqlSafe(query.as_str()));
30 30 for key in keys {
31 31 q = q.bind(*key);
32 32 }
@@ -52,7 +52,7 @@
52 52 bind_placeholders(task_ids.len())
53 53 );
54 54
55 - let mut q = sqlx::query_as::<_, AnnotationRow>(&query);
55 + let mut q = sqlx::query_as::<_, AnnotationRow>(sqlx::AssertSqlSafe(query.as_str()));
56 56 for id in task_ids {
57 57 q = q.bind(id);
58 58 }
@@ -95,7 +95,7 @@
95 95 "SELECT {} FROM attachments WHERE task_id = ? AND user_id = ? ORDER BY created_at ASC",
96 96 SELECT_COLS
97 97 );
98 - let rows = sqlx::query_as::<_, AttachmentRow>(&sql)
98 + let rows = sqlx::query_as::<_, AttachmentRow>(sqlx::AssertSqlSafe(sql.as_str()))
99 99 .bind(task_id.to_string())
100 100 .bind(user_id.to_string())
101 101 .fetch_all(&self.pool)
@@ -111,7 +111,7 @@
111 111 "SELECT {} FROM attachments WHERE project_id = ? AND user_id = ? ORDER BY created_at ASC",
112 112 SELECT_COLS
113 113 );
114 - let rows = sqlx::query_as::<_, AttachmentRow>(&sql)
114 + let rows = sqlx::query_as::<_, AttachmentRow>(sqlx::AssertSqlSafe(sql.as_str()))
115 115 .bind(project_id.to_string())
116 116 .bind(user_id.to_string())
117 117 .fetch_all(&self.pool)
@@ -127,7 +127,7 @@
127 127 "SELECT {} FROM attachments WHERE id = ? AND user_id = ?",
128 128 SELECT_COLS
129 129 );
130 - let row = sqlx::query_as::<_, AttachmentRow>(&sql)
130 + let row = sqlx::query_as::<_, AttachmentRow>(sqlx::AssertSqlSafe(sql.as_str()))
131 131 .bind(id.to_string())
132 132 .bind(user_id.to_string())
133 133 .fetch_optional(&self.pool)
@@ -155,7 +155,7 @@
155 155 "SELECT {} FROM attachments WHERE blob_hash = ? AND user_id = ? ORDER BY created_at ASC",
156 156 SELECT_COLS
157 157 );
158 - let rows = sqlx::query_as::<_, AttachmentRow>(&sql)
158 + let rows = sqlx::query_as::<_, AttachmentRow>(sqlx::AssertSqlSafe(sql.as_str()))
159 159 .bind(blob_hash)
160 160 .bind(user_id.to_string())
161 161 .fetch_all(&self.pool)
@@ -184,7 +184,7 @@
184 184 "SELECT {} FROM attachments WHERE user_id = ? ORDER BY created_at ASC",
185 185 SELECT_COLS
186 186 );
187 - let rows = sqlx::query_as::<_, AttachmentRow>(&sql)
187 + let rows = sqlx::query_as::<_, AttachmentRow>(sqlx::AssertSqlSafe(sql.as_str()))
188 188 .bind(user_id.to_string())
189 189 .fetch_all(&self.pool)
190 190 .await
@@ -180,7 +180,7 @@
180 180 placeholders
181 181 );
182 182
183 - let mut query = sqlx::query_as::<_, ContactEmailRow>(&sql);
183 + let mut query = sqlx::query_as::<_, ContactEmailRow>(sqlx::AssertSqlSafe(sql.as_str()));
184 184 for id in ids {
185 185 query = query.bind(id);
186 186 }
@@ -210,7 +210,7 @@
210 210 placeholders
211 211 );
212 212
213 - let mut query = sqlx::query_as::<_, ContactPhoneRow>(&sql);
213 + let mut query = sqlx::query_as::<_, ContactPhoneRow>(sqlx::AssertSqlSafe(sql.as_str()));
214 214 for id in ids {
215 215 query = query.bind(id);
216 216 }
@@ -240,7 +240,7 @@
240 240 placeholders
241 241 );
242 242
243 - let mut query = sqlx::query_as::<_, SocialHandleRow>(&sql);
243 + let mut query = sqlx::query_as::<_, SocialHandleRow>(sqlx::AssertSqlSafe(sql.as_str()));
244 244 for id in ids {
245 245 query = query.bind(id);
246 246 }
@@ -270,7 +270,7 @@
270 270 placeholders
271 271 );
272 272
273 - let mut query = sqlx::query_as::<_, CustomFieldRow>(&sql);
273 + let mut query = sqlx::query_as::<_, CustomFieldRow>(sqlx::AssertSqlSafe(sql.as_str()));
274 274 for id in ids {
275 275 query = query.bind(id);
276 276 }
@@ -498,7 +498,7 @@
498 498 let user_id_str = user_id.to_string();
499 499 let placeholders = bind_placeholders(ids.len());
500 500 let sql = format!("DELETE FROM contacts WHERE user_id = ? AND id IN ({placeholders})");
501 - let mut query = sqlx::query(&sql).bind(&user_id_str);
501 + let mut query = sqlx::query(sqlx::AssertSqlSafe(sql.as_str())).bind(&user_id_str);
502 502 for id in ids {
503 503 query = query.bind(id.to_string());
504 504 }
@@ -526,7 +526,7 @@
526 526 WHERE user_id = ? AND id IN ({placeholders})
527 527 AND (tags IS NULL OR tags NOT LIKE ? ESCAPE '\')"#,
528 528 );
529 - let mut query = sqlx::query(&sql)
529 + let mut query = sqlx::query(sqlx::AssertSqlSafe(sql.as_str()))
530 530 .bind(tag)
531 531 .bind(tag)
532 532 .bind(&user_id_str);
@@ -596,7 +596,7 @@
596 596 conditions.join(" AND ")
597 597 );
598 598
599 - let mut query = sqlx::query_as::<_, ContactRow>(&sql);
599 + let mut query = sqlx::query_as::<_, ContactRow>(sqlx::AssertSqlSafe(sql.as_str()));
600 600 for bind in &binds {
601 601 query = query.bind(bind);
602 602 }
@@ -617,7 +617,7 @@
617 617 ORDER BY c.display_name ASC, ce.is_primary DESC",
618 618 implicit_filter
619 619 );
620 - let rows: Vec<(String, String, i64)> = sqlx::query_as(&sql)
620 + let rows: Vec<(String, String, i64)> = sqlx::query_as(sqlx::AssertSqlSafe(sql.as_str()))
621 621 .bind(user_id.to_string())
622 622 .fetch_all(&self.pool)
623 623 .await
@@ -670,7 +670,7 @@
670 670 placeholders
671 671 );
672 672
673 - let mut q = sqlx::query_as::<_, (String,)>(&query).bind(user_id.to_string());
673 + let mut q = sqlx::query_as::<_, (String,)>(sqlx::AssertSqlSafe(query.as_str())).bind(user_id.to_string());
674 674 for addr in addresses {
675 675 q = q.bind(addr.to_lowercase());
676 676 }