├── .env ├── .envrc ├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── LICENSE ├── README.md ├── deny.toml ├── examples └── prepare.rs ├── flake.lock ├── flake.nix ├── src └── lib.rs └── tests └── quote.rs /.env: -------------------------------------------------------------------------------- 1 | DATABASE_URL="sqlite://sqlite.db" 2 | -------------------------------------------------------------------------------- /.envrc: -------------------------------------------------------------------------------- 1 | use flake 2 | dotenv 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | .direnv/ 3 | sqlite.db* 4 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "addr2line" 7 | version = "0.21.0" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" 10 | dependencies = [ 11 | "gimli", 12 | ] 13 | 14 | [[package]] 15 | name = "adler" 16 | version = "1.0.2" 17 | source = "registry+https://github.com/rust-lang/crates.io-index" 18 | checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" 19 | 20 | [[package]] 21 | name = "ahash" 22 | version = "0.8.11" 23 | source = "registry+https://github.com/rust-lang/crates.io-index" 24 | checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" 25 | dependencies = [ 26 | "cfg-if", 27 | "getrandom", 28 | "once_cell", 29 | "version_check", 30 | "zerocopy", 31 | ] 32 | 33 | [[package]] 34 | name = "aho-corasick" 35 | version = "1.1.2" 36 | source = "registry+https://github.com/rust-lang/crates.io-index" 37 | checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" 38 | dependencies = [ 39 | "memchr", 40 | ] 41 | 42 | [[package]] 43 | name = "allocator-api2" 44 | version = "0.2.16" 45 | source = "registry+https://github.com/rust-lang/crates.io-index" 46 | checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" 47 | 48 | [[package]] 49 | name = "android-tzdata" 50 | version = "0.1.1" 51 | source = "registry+https://github.com/rust-lang/crates.io-index" 52 | checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" 53 | 54 | [[package]] 55 | name = "android_system_properties" 56 | version = "0.1.5" 57 | source = "registry+https://github.com/rust-lang/crates.io-index" 58 | checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" 59 | dependencies = [ 60 | "libc", 61 | ] 62 | 63 | [[package]] 64 | name = "anstream" 65 | version = "0.6.14" 66 | source = "registry+https://github.com/rust-lang/crates.io-index" 67 | checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" 68 | dependencies = [ 69 | "anstyle", 70 | "anstyle-parse", 71 | "anstyle-query", 72 | "anstyle-wincon", 73 | "colorchoice", 74 | "is_terminal_polyfill", 75 | "utf8parse", 76 | ] 77 | 78 | [[package]] 79 | name = "anstyle" 80 | version = "1.0.4" 81 | source = "registry+https://github.com/rust-lang/crates.io-index" 82 | checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" 83 | 84 | [[package]] 85 | name = "anstyle-parse" 86 | version = "0.2.3" 87 | source = "registry+https://github.com/rust-lang/crates.io-index" 88 | checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" 89 | dependencies = [ 90 | "utf8parse", 91 | ] 92 | 93 | [[package]] 94 | name = "anstyle-query" 95 | version = "1.0.1" 96 | source = "registry+https://github.com/rust-lang/crates.io-index" 97 | checksum = "a3a318f1f38d2418400f8209655bfd825785afd25aa30bb7ba6cc792e4596748" 98 | dependencies = [ 99 | "windows-sys 0.52.0", 100 | ] 101 | 102 | [[package]] 103 | name = "anstyle-wincon" 104 | version = "3.0.3" 105 | source = "registry+https://github.com/rust-lang/crates.io-index" 106 | checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" 107 | dependencies = [ 108 | "anstyle", 109 | "windows-sys 0.52.0", 110 | ] 111 | 112 | [[package]] 113 | name = "ariadne" 114 | version = "0.4.1" 115 | source = "registry+https://github.com/rust-lang/crates.io-index" 116 | checksum = "44055e597c674aef7cb903b2b9f6e4cba1277ed0d2d61dae7cd52d7ffa81f8e2" 117 | dependencies = [ 118 | "unicode-width", 119 | "yansi", 120 | ] 121 | 122 | [[package]] 123 | name = "atoi" 124 | version = "2.0.0" 125 | source = "registry+https://github.com/rust-lang/crates.io-index" 126 | checksum = "f28d99ec8bfea296261ca1af174f24225171fea9664ba9003cbebee704810528" 127 | dependencies = [ 128 | "num-traits", 129 | ] 130 | 131 | [[package]] 132 | name = "autocfg" 133 | version = "1.1.0" 134 | source = "registry+https://github.com/rust-lang/crates.io-index" 135 | checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" 136 | 137 | [[package]] 138 | name = "backtrace" 139 | version = "0.3.69" 140 | source = "registry+https://github.com/rust-lang/crates.io-index" 141 | checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" 142 | dependencies = [ 143 | "addr2line", 144 | "cc", 145 | "cfg-if", 146 | "libc", 147 | "miniz_oxide", 148 | "object", 149 | "rustc-demangle", 150 | ] 151 | 152 | [[package]] 153 | name = "base64" 154 | version = "0.21.5" 155 | source = "registry+https://github.com/rust-lang/crates.io-index" 156 | checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" 157 | 158 | [[package]] 159 | name = "base64ct" 160 | version = "1.6.0" 161 | source = "registry+https://github.com/rust-lang/crates.io-index" 162 | checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" 163 | 164 | [[package]] 165 | name = "bitflags" 166 | version = "1.3.2" 167 | source = "registry+https://github.com/rust-lang/crates.io-index" 168 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 169 | 170 | [[package]] 171 | name = "bitflags" 172 | version = "2.4.1" 173 | source = "registry+https://github.com/rust-lang/crates.io-index" 174 | checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" 175 | dependencies = [ 176 | "serde", 177 | ] 178 | 179 | [[package]] 180 | name = "block-buffer" 181 | version = "0.10.4" 182 | source = "registry+https://github.com/rust-lang/crates.io-index" 183 | checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" 184 | dependencies = [ 185 | "generic-array", 186 | ] 187 | 188 | [[package]] 189 | name = "bumpalo" 190 | version = "3.16.0" 191 | source = "registry+https://github.com/rust-lang/crates.io-index" 192 | checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" 193 | 194 | [[package]] 195 | name = "byteorder" 196 | version = "1.5.0" 197 | source = "registry+https://github.com/rust-lang/crates.io-index" 198 | checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" 199 | 200 | [[package]] 201 | name = "bytes" 202 | version = "1.5.0" 203 | source = "registry+https://github.com/rust-lang/crates.io-index" 204 | checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" 205 | 206 | [[package]] 207 | name = "cc" 208 | version = "1.0.83" 209 | source = "registry+https://github.com/rust-lang/crates.io-index" 210 | checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" 211 | dependencies = [ 212 | "libc", 213 | ] 214 | 215 | [[package]] 216 | name = "cfg-if" 217 | version = "1.0.0" 218 | source = "registry+https://github.com/rust-lang/crates.io-index" 219 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 220 | 221 | [[package]] 222 | name = "chrono" 223 | version = "0.4.38" 224 | source = "registry+https://github.com/rust-lang/crates.io-index" 225 | checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" 226 | dependencies = [ 227 | "android-tzdata", 228 | "iana-time-zone", 229 | "js-sys", 230 | "num-traits", 231 | "wasm-bindgen", 232 | "windows-targets 0.52.0", 233 | ] 234 | 235 | [[package]] 236 | name = "chumsky" 237 | version = "0.9.3" 238 | source = "registry+https://github.com/rust-lang/crates.io-index" 239 | checksum = "8eebd66744a15ded14960ab4ccdbfb51ad3b81f51f3f04a80adac98c985396c9" 240 | dependencies = [ 241 | "hashbrown", 242 | "stacker", 243 | ] 244 | 245 | [[package]] 246 | name = "colorchoice" 247 | version = "1.0.0" 248 | source = "registry+https://github.com/rust-lang/crates.io-index" 249 | checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" 250 | 251 | [[package]] 252 | name = "const-oid" 253 | version = "0.9.5" 254 | source = "registry+https://github.com/rust-lang/crates.io-index" 255 | checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" 256 | 257 | [[package]] 258 | name = "core-foundation-sys" 259 | version = "0.8.6" 260 | source = "registry+https://github.com/rust-lang/crates.io-index" 261 | checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" 262 | 263 | [[package]] 264 | name = "cpufeatures" 265 | version = "0.2.11" 266 | source = "registry+https://github.com/rust-lang/crates.io-index" 267 | checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" 268 | dependencies = [ 269 | "libc", 270 | ] 271 | 272 | [[package]] 273 | name = "crc" 274 | version = "3.0.1" 275 | source = "registry+https://github.com/rust-lang/crates.io-index" 276 | checksum = "86ec7a15cbe22e59248fc7eadb1907dab5ba09372595da4d73dd805ed4417dfe" 277 | dependencies = [ 278 | "crc-catalog", 279 | ] 280 | 281 | [[package]] 282 | name = "crc-catalog" 283 | version = "2.4.0" 284 | source = "registry+https://github.com/rust-lang/crates.io-index" 285 | checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" 286 | 287 | [[package]] 288 | name = "crossbeam-queue" 289 | version = "0.3.8" 290 | source = "registry+https://github.com/rust-lang/crates.io-index" 291 | checksum = "d1cfb3ea8a53f37c40dea2c7bedcbd88bdfae54f5e2175d6ecaff1c988353add" 292 | dependencies = [ 293 | "cfg-if", 294 | "crossbeam-utils", 295 | ] 296 | 297 | [[package]] 298 | name = "crossbeam-utils" 299 | version = "0.8.16" 300 | source = "registry+https://github.com/rust-lang/crates.io-index" 301 | checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" 302 | dependencies = [ 303 | "cfg-if", 304 | ] 305 | 306 | [[package]] 307 | name = "crypto-common" 308 | version = "0.1.6" 309 | source = "registry+https://github.com/rust-lang/crates.io-index" 310 | checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" 311 | dependencies = [ 312 | "generic-array", 313 | "typenum", 314 | ] 315 | 316 | [[package]] 317 | name = "csv" 318 | version = "1.3.0" 319 | source = "registry+https://github.com/rust-lang/crates.io-index" 320 | checksum = "ac574ff4d437a7b5ad237ef331c17ccca63c46479e5b5453eb8e10bb99a759fe" 321 | dependencies = [ 322 | "csv-core", 323 | "itoa", 324 | "ryu", 325 | "serde", 326 | ] 327 | 328 | [[package]] 329 | name = "csv-core" 330 | version = "0.1.11" 331 | source = "registry+https://github.com/rust-lang/crates.io-index" 332 | checksum = "5efa2b3d7902f4b634a20cae3c9c4e6209dc4779feb6863329607560143efa70" 333 | dependencies = [ 334 | "memchr", 335 | ] 336 | 337 | [[package]] 338 | name = "der" 339 | version = "0.7.8" 340 | source = "registry+https://github.com/rust-lang/crates.io-index" 341 | checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" 342 | dependencies = [ 343 | "const-oid", 344 | "pem-rfc7468", 345 | "zeroize", 346 | ] 347 | 348 | [[package]] 349 | name = "digest" 350 | version = "0.10.7" 351 | source = "registry+https://github.com/rust-lang/crates.io-index" 352 | checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" 353 | dependencies = [ 354 | "block-buffer", 355 | "const-oid", 356 | "crypto-common", 357 | "subtle", 358 | ] 359 | 360 | [[package]] 361 | name = "dotenvy" 362 | version = "0.15.7" 363 | source = "registry+https://github.com/rust-lang/crates.io-index" 364 | checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" 365 | 366 | [[package]] 367 | name = "either" 368 | version = "1.9.0" 369 | source = "registry+https://github.com/rust-lang/crates.io-index" 370 | checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" 371 | dependencies = [ 372 | "serde", 373 | ] 374 | 375 | [[package]] 376 | name = "enum-as-inner" 377 | version = "0.6.0" 378 | source = "registry+https://github.com/rust-lang/crates.io-index" 379 | checksum = "5ffccbb6966c05b32ef8fbac435df276c4ae4d3dc55a8cd0eb9745e6c12f546a" 380 | dependencies = [ 381 | "heck 0.4.1", 382 | "proc-macro2", 383 | "quote", 384 | "syn 2.0.67", 385 | ] 386 | 387 | [[package]] 388 | name = "equivalent" 389 | version = "1.0.1" 390 | source = "registry+https://github.com/rust-lang/crates.io-index" 391 | checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" 392 | 393 | [[package]] 394 | name = "errno" 395 | version = "0.3.8" 396 | source = "registry+https://github.com/rust-lang/crates.io-index" 397 | checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" 398 | dependencies = [ 399 | "libc", 400 | "windows-sys 0.52.0", 401 | ] 402 | 403 | [[package]] 404 | name = "etcetera" 405 | version = "0.8.0" 406 | source = "registry+https://github.com/rust-lang/crates.io-index" 407 | checksum = "136d1b5283a1ab77bd9257427ffd09d8667ced0570b6f938942bc7568ed5b943" 408 | dependencies = [ 409 | "cfg-if", 410 | "home", 411 | "windows-sys 0.48.0", 412 | ] 413 | 414 | [[package]] 415 | name = "event-listener" 416 | version = "2.5.3" 417 | source = "registry+https://github.com/rust-lang/crates.io-index" 418 | checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" 419 | 420 | [[package]] 421 | name = "fastrand" 422 | version = "2.0.1" 423 | source = "registry+https://github.com/rust-lang/crates.io-index" 424 | checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" 425 | 426 | [[package]] 427 | name = "finl_unicode" 428 | version = "1.2.0" 429 | source = "registry+https://github.com/rust-lang/crates.io-index" 430 | checksum = "8fcfdc7a0362c9f4444381a9e697c79d435fe65b52a37466fc2c1184cee9edc6" 431 | 432 | [[package]] 433 | name = "flume" 434 | version = "0.11.0" 435 | source = "registry+https://github.com/rust-lang/crates.io-index" 436 | checksum = "55ac459de2512911e4b674ce33cf20befaba382d05b62b008afc1c8b57cbf181" 437 | dependencies = [ 438 | "futures-core", 439 | "futures-sink", 440 | "spin 0.9.8", 441 | ] 442 | 443 | [[package]] 444 | name = "form_urlencoded" 445 | version = "1.2.1" 446 | source = "registry+https://github.com/rust-lang/crates.io-index" 447 | checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" 448 | dependencies = [ 449 | "percent-encoding", 450 | ] 451 | 452 | [[package]] 453 | name = "futures-channel" 454 | version = "0.3.29" 455 | source = "registry+https://github.com/rust-lang/crates.io-index" 456 | checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" 457 | dependencies = [ 458 | "futures-core", 459 | "futures-sink", 460 | ] 461 | 462 | [[package]] 463 | name = "futures-core" 464 | version = "0.3.29" 465 | source = "registry+https://github.com/rust-lang/crates.io-index" 466 | checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" 467 | 468 | [[package]] 469 | name = "futures-executor" 470 | version = "0.3.29" 471 | source = "registry+https://github.com/rust-lang/crates.io-index" 472 | checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc" 473 | dependencies = [ 474 | "futures-core", 475 | "futures-task", 476 | "futures-util", 477 | ] 478 | 479 | [[package]] 480 | name = "futures-intrusive" 481 | version = "0.5.0" 482 | source = "registry+https://github.com/rust-lang/crates.io-index" 483 | checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" 484 | dependencies = [ 485 | "futures-core", 486 | "lock_api", 487 | "parking_lot", 488 | ] 489 | 490 | [[package]] 491 | name = "futures-io" 492 | version = "0.3.29" 493 | source = "registry+https://github.com/rust-lang/crates.io-index" 494 | checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" 495 | 496 | [[package]] 497 | name = "futures-sink" 498 | version = "0.3.29" 499 | source = "registry+https://github.com/rust-lang/crates.io-index" 500 | checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" 501 | 502 | [[package]] 503 | name = "futures-task" 504 | version = "0.3.29" 505 | source = "registry+https://github.com/rust-lang/crates.io-index" 506 | checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" 507 | 508 | [[package]] 509 | name = "futures-util" 510 | version = "0.3.29" 511 | source = "registry+https://github.com/rust-lang/crates.io-index" 512 | checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" 513 | dependencies = [ 514 | "futures-core", 515 | "futures-io", 516 | "futures-sink", 517 | "futures-task", 518 | "memchr", 519 | "pin-project-lite", 520 | "pin-utils", 521 | "slab", 522 | ] 523 | 524 | [[package]] 525 | name = "generic-array" 526 | version = "0.14.7" 527 | source = "registry+https://github.com/rust-lang/crates.io-index" 528 | checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" 529 | dependencies = [ 530 | "typenum", 531 | "version_check", 532 | ] 533 | 534 | [[package]] 535 | name = "getrandom" 536 | version = "0.2.11" 537 | source = "registry+https://github.com/rust-lang/crates.io-index" 538 | checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" 539 | dependencies = [ 540 | "cfg-if", 541 | "libc", 542 | "wasi", 543 | ] 544 | 545 | [[package]] 546 | name = "gimli" 547 | version = "0.28.1" 548 | source = "registry+https://github.com/rust-lang/crates.io-index" 549 | checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" 550 | 551 | [[package]] 552 | name = "hashbrown" 553 | version = "0.14.3" 554 | source = "registry+https://github.com/rust-lang/crates.io-index" 555 | checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" 556 | dependencies = [ 557 | "ahash", 558 | "allocator-api2", 559 | ] 560 | 561 | [[package]] 562 | name = "hashlink" 563 | version = "0.8.4" 564 | source = "registry+https://github.com/rust-lang/crates.io-index" 565 | checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" 566 | dependencies = [ 567 | "hashbrown", 568 | ] 569 | 570 | [[package]] 571 | name = "heck" 572 | version = "0.4.1" 573 | source = "registry+https://github.com/rust-lang/crates.io-index" 574 | checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" 575 | dependencies = [ 576 | "unicode-segmentation", 577 | ] 578 | 579 | [[package]] 580 | name = "heck" 581 | version = "0.5.0" 582 | source = "registry+https://github.com/rust-lang/crates.io-index" 583 | checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" 584 | 585 | [[package]] 586 | name = "hermit-abi" 587 | version = "0.3.3" 588 | source = "registry+https://github.com/rust-lang/crates.io-index" 589 | checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" 590 | 591 | [[package]] 592 | name = "hex" 593 | version = "0.4.3" 594 | source = "registry+https://github.com/rust-lang/crates.io-index" 595 | checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" 596 | 597 | [[package]] 598 | name = "hkdf" 599 | version = "0.12.3" 600 | source = "registry+https://github.com/rust-lang/crates.io-index" 601 | checksum = "791a029f6b9fc27657f6f188ec6e5e43f6911f6f878e0dc5501396e09809d437" 602 | dependencies = [ 603 | "hmac", 604 | ] 605 | 606 | [[package]] 607 | name = "hmac" 608 | version = "0.12.1" 609 | source = "registry+https://github.com/rust-lang/crates.io-index" 610 | checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" 611 | dependencies = [ 612 | "digest", 613 | ] 614 | 615 | [[package]] 616 | name = "home" 617 | version = "0.5.5" 618 | source = "registry+https://github.com/rust-lang/crates.io-index" 619 | checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" 620 | dependencies = [ 621 | "windows-sys 0.48.0", 622 | ] 623 | 624 | [[package]] 625 | name = "iana-time-zone" 626 | version = "0.1.60" 627 | source = "registry+https://github.com/rust-lang/crates.io-index" 628 | checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" 629 | dependencies = [ 630 | "android_system_properties", 631 | "core-foundation-sys", 632 | "iana-time-zone-haiku", 633 | "js-sys", 634 | "wasm-bindgen", 635 | "windows-core", 636 | ] 637 | 638 | [[package]] 639 | name = "iana-time-zone-haiku" 640 | version = "0.1.2" 641 | source = "registry+https://github.com/rust-lang/crates.io-index" 642 | checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" 643 | dependencies = [ 644 | "cc", 645 | ] 646 | 647 | [[package]] 648 | name = "idna" 649 | version = "0.5.0" 650 | source = "registry+https://github.com/rust-lang/crates.io-index" 651 | checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" 652 | dependencies = [ 653 | "unicode-bidi", 654 | "unicode-normalization", 655 | ] 656 | 657 | [[package]] 658 | name = "indexmap" 659 | version = "2.1.0" 660 | source = "registry+https://github.com/rust-lang/crates.io-index" 661 | checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" 662 | dependencies = [ 663 | "equivalent", 664 | "hashbrown", 665 | ] 666 | 667 | [[package]] 668 | name = "is_terminal_polyfill" 669 | version = "1.70.0" 670 | source = "registry+https://github.com/rust-lang/crates.io-index" 671 | checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" 672 | 673 | [[package]] 674 | name = "itertools" 675 | version = "0.12.0" 676 | source = "registry+https://github.com/rust-lang/crates.io-index" 677 | checksum = "25db6b064527c5d482d0423354fcd07a89a2dfe07b67892e62411946db7f07b0" 678 | dependencies = [ 679 | "either", 680 | ] 681 | 682 | [[package]] 683 | name = "itoa" 684 | version = "1.0.9" 685 | source = "registry+https://github.com/rust-lang/crates.io-index" 686 | checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" 687 | 688 | [[package]] 689 | name = "js-sys" 690 | version = "0.3.69" 691 | source = "registry+https://github.com/rust-lang/crates.io-index" 692 | checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" 693 | dependencies = [ 694 | "wasm-bindgen", 695 | ] 696 | 697 | [[package]] 698 | name = "lazy_static" 699 | version = "1.4.0" 700 | source = "registry+https://github.com/rust-lang/crates.io-index" 701 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 702 | dependencies = [ 703 | "spin 0.5.2", 704 | ] 705 | 706 | [[package]] 707 | name = "libc" 708 | version = "0.2.150" 709 | source = "registry+https://github.com/rust-lang/crates.io-index" 710 | checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" 711 | 712 | [[package]] 713 | name = "libm" 714 | version = "0.2.8" 715 | source = "registry+https://github.com/rust-lang/crates.io-index" 716 | checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" 717 | 718 | [[package]] 719 | name = "libsqlite3-sys" 720 | version = "0.27.0" 721 | source = "registry+https://github.com/rust-lang/crates.io-index" 722 | checksum = "cf4e226dcd58b4be396f7bd3c20da8fdee2911400705297ba7d2d7cc2c30f716" 723 | dependencies = [ 724 | "cc", 725 | "pkg-config", 726 | "vcpkg", 727 | ] 728 | 729 | [[package]] 730 | name = "linux-raw-sys" 731 | version = "0.4.12" 732 | source = "registry+https://github.com/rust-lang/crates.io-index" 733 | checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" 734 | 735 | [[package]] 736 | name = "lock_api" 737 | version = "0.4.11" 738 | source = "registry+https://github.com/rust-lang/crates.io-index" 739 | checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" 740 | dependencies = [ 741 | "autocfg", 742 | "scopeguard", 743 | ] 744 | 745 | [[package]] 746 | name = "log" 747 | version = "0.4.21" 748 | source = "registry+https://github.com/rust-lang/crates.io-index" 749 | checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" 750 | 751 | [[package]] 752 | name = "md-5" 753 | version = "0.10.6" 754 | source = "registry+https://github.com/rust-lang/crates.io-index" 755 | checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" 756 | dependencies = [ 757 | "cfg-if", 758 | "digest", 759 | ] 760 | 761 | [[package]] 762 | name = "memchr" 763 | version = "2.6.4" 764 | source = "registry+https://github.com/rust-lang/crates.io-index" 765 | checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" 766 | 767 | [[package]] 768 | name = "minimal-lexical" 769 | version = "0.2.1" 770 | source = "registry+https://github.com/rust-lang/crates.io-index" 771 | checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" 772 | 773 | [[package]] 774 | name = "miniz_oxide" 775 | version = "0.7.1" 776 | source = "registry+https://github.com/rust-lang/crates.io-index" 777 | checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" 778 | dependencies = [ 779 | "adler", 780 | ] 781 | 782 | [[package]] 783 | name = "mio" 784 | version = "0.8.10" 785 | source = "registry+https://github.com/rust-lang/crates.io-index" 786 | checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" 787 | dependencies = [ 788 | "libc", 789 | "wasi", 790 | "windows-sys 0.48.0", 791 | ] 792 | 793 | [[package]] 794 | name = "nom" 795 | version = "7.1.3" 796 | source = "registry+https://github.com/rust-lang/crates.io-index" 797 | checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" 798 | dependencies = [ 799 | "memchr", 800 | "minimal-lexical", 801 | ] 802 | 803 | [[package]] 804 | name = "num-bigint-dig" 805 | version = "0.8.4" 806 | source = "registry+https://github.com/rust-lang/crates.io-index" 807 | checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" 808 | dependencies = [ 809 | "byteorder", 810 | "lazy_static", 811 | "libm", 812 | "num-integer", 813 | "num-iter", 814 | "num-traits", 815 | "rand", 816 | "smallvec", 817 | "zeroize", 818 | ] 819 | 820 | [[package]] 821 | name = "num-integer" 822 | version = "0.1.45" 823 | source = "registry+https://github.com/rust-lang/crates.io-index" 824 | checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" 825 | dependencies = [ 826 | "autocfg", 827 | "num-traits", 828 | ] 829 | 830 | [[package]] 831 | name = "num-iter" 832 | version = "0.1.43" 833 | source = "registry+https://github.com/rust-lang/crates.io-index" 834 | checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" 835 | dependencies = [ 836 | "autocfg", 837 | "num-integer", 838 | "num-traits", 839 | ] 840 | 841 | [[package]] 842 | name = "num-traits" 843 | version = "0.2.17" 844 | source = "registry+https://github.com/rust-lang/crates.io-index" 845 | checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" 846 | dependencies = [ 847 | "autocfg", 848 | "libm", 849 | ] 850 | 851 | [[package]] 852 | name = "num_cpus" 853 | version = "1.16.0" 854 | source = "registry+https://github.com/rust-lang/crates.io-index" 855 | checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" 856 | dependencies = [ 857 | "hermit-abi", 858 | "libc", 859 | ] 860 | 861 | [[package]] 862 | name = "object" 863 | version = "0.32.1" 864 | source = "registry+https://github.com/rust-lang/crates.io-index" 865 | checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" 866 | dependencies = [ 867 | "memchr", 868 | ] 869 | 870 | [[package]] 871 | name = "once_cell" 872 | version = "1.19.0" 873 | source = "registry+https://github.com/rust-lang/crates.io-index" 874 | checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" 875 | 876 | [[package]] 877 | name = "parking_lot" 878 | version = "0.12.1" 879 | source = "registry+https://github.com/rust-lang/crates.io-index" 880 | checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" 881 | dependencies = [ 882 | "lock_api", 883 | "parking_lot_core", 884 | ] 885 | 886 | [[package]] 887 | name = "parking_lot_core" 888 | version = "0.9.9" 889 | source = "registry+https://github.com/rust-lang/crates.io-index" 890 | checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" 891 | dependencies = [ 892 | "cfg-if", 893 | "libc", 894 | "redox_syscall", 895 | "smallvec", 896 | "windows-targets 0.48.5", 897 | ] 898 | 899 | [[package]] 900 | name = "paste" 901 | version = "1.0.14" 902 | source = "registry+https://github.com/rust-lang/crates.io-index" 903 | checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" 904 | 905 | [[package]] 906 | name = "pem-rfc7468" 907 | version = "0.7.0" 908 | source = "registry+https://github.com/rust-lang/crates.io-index" 909 | checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" 910 | dependencies = [ 911 | "base64ct", 912 | ] 913 | 914 | [[package]] 915 | name = "percent-encoding" 916 | version = "2.3.1" 917 | source = "registry+https://github.com/rust-lang/crates.io-index" 918 | checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" 919 | 920 | [[package]] 921 | name = "pin-project-lite" 922 | version = "0.2.13" 923 | source = "registry+https://github.com/rust-lang/crates.io-index" 924 | checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" 925 | 926 | [[package]] 927 | name = "pin-utils" 928 | version = "0.1.0" 929 | source = "registry+https://github.com/rust-lang/crates.io-index" 930 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 931 | 932 | [[package]] 933 | name = "pkcs1" 934 | version = "0.7.5" 935 | source = "registry+https://github.com/rust-lang/crates.io-index" 936 | checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f" 937 | dependencies = [ 938 | "der", 939 | "pkcs8", 940 | "spki", 941 | ] 942 | 943 | [[package]] 944 | name = "pkcs8" 945 | version = "0.10.2" 946 | source = "registry+https://github.com/rust-lang/crates.io-index" 947 | checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" 948 | dependencies = [ 949 | "der", 950 | "spki", 951 | ] 952 | 953 | [[package]] 954 | name = "pkg-config" 955 | version = "0.3.27" 956 | source = "registry+https://github.com/rust-lang/crates.io-index" 957 | checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" 958 | 959 | [[package]] 960 | name = "ppv-lite86" 961 | version = "0.2.17" 962 | source = "registry+https://github.com/rust-lang/crates.io-index" 963 | checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" 964 | 965 | [[package]] 966 | name = "proc-macro2" 967 | version = "1.0.86" 968 | source = "registry+https://github.com/rust-lang/crates.io-index" 969 | checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" 970 | dependencies = [ 971 | "unicode-ident", 972 | ] 973 | 974 | [[package]] 975 | name = "prql-compiler" 976 | version = "0.12.2" 977 | source = "registry+https://github.com/rust-lang/crates.io-index" 978 | checksum = "24746068d2efd201c8b4f288d0010be7ebef3a49aef45b3848d3f557790b482f" 979 | dependencies = [ 980 | "prqlc", 981 | ] 982 | 983 | [[package]] 984 | name = "prqlc" 985 | version = "0.12.2" 986 | source = "registry+https://github.com/rust-lang/crates.io-index" 987 | checksum = "57894e5531a475a6ea4bb3be9b5824f84fed1ea81280819791447a773163000c" 988 | dependencies = [ 989 | "anstream", 990 | "ariadne", 991 | "chrono", 992 | "csv", 993 | "enum-as-inner", 994 | "itertools", 995 | "log", 996 | "once_cell", 997 | "prqlc-ast", 998 | "prqlc-parser", 999 | "regex", 1000 | "semver", 1001 | "serde", 1002 | "serde_json", 1003 | "sqlformat", 1004 | "sqlparser", 1005 | "strum", 1006 | "strum_macros", 1007 | ] 1008 | 1009 | [[package]] 1010 | name = "prqlc-ast" 1011 | version = "0.12.2" 1012 | source = "registry+https://github.com/rust-lang/crates.io-index" 1013 | checksum = "7392fb56fbf926ea290e514b8c40192e3f447489d2d1a188aef1f5d7401196c2" 1014 | dependencies = [ 1015 | "chumsky", 1016 | "enum-as-inner", 1017 | "semver", 1018 | "serde", 1019 | "stacker", 1020 | "strum", 1021 | ] 1022 | 1023 | [[package]] 1024 | name = "prqlc-parser" 1025 | version = "0.12.2" 1026 | source = "registry+https://github.com/rust-lang/crates.io-index" 1027 | checksum = "eaa919a403dcf3c2fe7d7f4a9f60d8e0ed03dc8838bdd6bf017b1d411aa23b50" 1028 | dependencies = [ 1029 | "chumsky", 1030 | "itertools", 1031 | "log", 1032 | "prqlc-ast", 1033 | "semver", 1034 | "serde", 1035 | "stacker", 1036 | ] 1037 | 1038 | [[package]] 1039 | name = "prqlx" 1040 | version = "0.2.1" 1041 | dependencies = [ 1042 | "prql-compiler", 1043 | "quote", 1044 | "sqlx", 1045 | "syn 2.0.67", 1046 | "tokio", 1047 | ] 1048 | 1049 | [[package]] 1050 | name = "psm" 1051 | version = "0.1.21" 1052 | source = "registry+https://github.com/rust-lang/crates.io-index" 1053 | checksum = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874" 1054 | dependencies = [ 1055 | "cc", 1056 | ] 1057 | 1058 | [[package]] 1059 | name = "quote" 1060 | version = "1.0.36" 1061 | source = "registry+https://github.com/rust-lang/crates.io-index" 1062 | checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" 1063 | dependencies = [ 1064 | "proc-macro2", 1065 | ] 1066 | 1067 | [[package]] 1068 | name = "rand" 1069 | version = "0.8.5" 1070 | source = "registry+https://github.com/rust-lang/crates.io-index" 1071 | checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" 1072 | dependencies = [ 1073 | "libc", 1074 | "rand_chacha", 1075 | "rand_core", 1076 | ] 1077 | 1078 | [[package]] 1079 | name = "rand_chacha" 1080 | version = "0.3.1" 1081 | source = "registry+https://github.com/rust-lang/crates.io-index" 1082 | checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" 1083 | dependencies = [ 1084 | "ppv-lite86", 1085 | "rand_core", 1086 | ] 1087 | 1088 | [[package]] 1089 | name = "rand_core" 1090 | version = "0.6.4" 1091 | source = "registry+https://github.com/rust-lang/crates.io-index" 1092 | checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" 1093 | dependencies = [ 1094 | "getrandom", 1095 | ] 1096 | 1097 | [[package]] 1098 | name = "redox_syscall" 1099 | version = "0.4.1" 1100 | source = "registry+https://github.com/rust-lang/crates.io-index" 1101 | checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" 1102 | dependencies = [ 1103 | "bitflags 1.3.2", 1104 | ] 1105 | 1106 | [[package]] 1107 | name = "regex" 1108 | version = "1.10.5" 1109 | source = "registry+https://github.com/rust-lang/crates.io-index" 1110 | checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" 1111 | dependencies = [ 1112 | "aho-corasick", 1113 | "memchr", 1114 | "regex-automata", 1115 | "regex-syntax", 1116 | ] 1117 | 1118 | [[package]] 1119 | name = "regex-automata" 1120 | version = "0.4.7" 1121 | source = "registry+https://github.com/rust-lang/crates.io-index" 1122 | checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" 1123 | dependencies = [ 1124 | "aho-corasick", 1125 | "memchr", 1126 | "regex-syntax", 1127 | ] 1128 | 1129 | [[package]] 1130 | name = "regex-syntax" 1131 | version = "0.8.2" 1132 | source = "registry+https://github.com/rust-lang/crates.io-index" 1133 | checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" 1134 | 1135 | [[package]] 1136 | name = "ring" 1137 | version = "0.17.7" 1138 | source = "registry+https://github.com/rust-lang/crates.io-index" 1139 | checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" 1140 | dependencies = [ 1141 | "cc", 1142 | "getrandom", 1143 | "libc", 1144 | "spin 0.9.8", 1145 | "untrusted", 1146 | "windows-sys 0.48.0", 1147 | ] 1148 | 1149 | [[package]] 1150 | name = "rsa" 1151 | version = "0.9.6" 1152 | source = "registry+https://github.com/rust-lang/crates.io-index" 1153 | checksum = "5d0e5124fcb30e76a7e79bfee683a2746db83784b86289f6251b54b7950a0dfc" 1154 | dependencies = [ 1155 | "const-oid", 1156 | "digest", 1157 | "num-bigint-dig", 1158 | "num-integer", 1159 | "num-traits", 1160 | "pkcs1", 1161 | "pkcs8", 1162 | "rand_core", 1163 | "signature", 1164 | "spki", 1165 | "subtle", 1166 | "zeroize", 1167 | ] 1168 | 1169 | [[package]] 1170 | name = "rustc-demangle" 1171 | version = "0.1.23" 1172 | source = "registry+https://github.com/rust-lang/crates.io-index" 1173 | checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" 1174 | 1175 | [[package]] 1176 | name = "rustix" 1177 | version = "0.38.26" 1178 | source = "registry+https://github.com/rust-lang/crates.io-index" 1179 | checksum = "9470c4bf8246c8daf25f9598dca807fb6510347b1e1cfa55749113850c79d88a" 1180 | dependencies = [ 1181 | "bitflags 2.4.1", 1182 | "errno", 1183 | "libc", 1184 | "linux-raw-sys", 1185 | "windows-sys 0.52.0", 1186 | ] 1187 | 1188 | [[package]] 1189 | name = "rustls" 1190 | version = "0.21.9" 1191 | source = "registry+https://github.com/rust-lang/crates.io-index" 1192 | checksum = "629648aced5775d558af50b2b4c7b02983a04b312126d45eeead26e7caa498b9" 1193 | dependencies = [ 1194 | "ring", 1195 | "rustls-webpki", 1196 | "sct", 1197 | ] 1198 | 1199 | [[package]] 1200 | name = "rustls-pemfile" 1201 | version = "1.0.4" 1202 | source = "registry+https://github.com/rust-lang/crates.io-index" 1203 | checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" 1204 | dependencies = [ 1205 | "base64", 1206 | ] 1207 | 1208 | [[package]] 1209 | name = "rustls-webpki" 1210 | version = "0.101.7" 1211 | source = "registry+https://github.com/rust-lang/crates.io-index" 1212 | checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" 1213 | dependencies = [ 1214 | "ring", 1215 | "untrusted", 1216 | ] 1217 | 1218 | [[package]] 1219 | name = "rustversion" 1220 | version = "1.0.14" 1221 | source = "registry+https://github.com/rust-lang/crates.io-index" 1222 | checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" 1223 | 1224 | [[package]] 1225 | name = "ryu" 1226 | version = "1.0.15" 1227 | source = "registry+https://github.com/rust-lang/crates.io-index" 1228 | checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" 1229 | 1230 | [[package]] 1231 | name = "scopeguard" 1232 | version = "1.2.0" 1233 | source = "registry+https://github.com/rust-lang/crates.io-index" 1234 | checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" 1235 | 1236 | [[package]] 1237 | name = "sct" 1238 | version = "0.7.1" 1239 | source = "registry+https://github.com/rust-lang/crates.io-index" 1240 | checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" 1241 | dependencies = [ 1242 | "ring", 1243 | "untrusted", 1244 | ] 1245 | 1246 | [[package]] 1247 | name = "semver" 1248 | version = "1.0.23" 1249 | source = "registry+https://github.com/rust-lang/crates.io-index" 1250 | checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" 1251 | dependencies = [ 1252 | "serde", 1253 | ] 1254 | 1255 | [[package]] 1256 | name = "serde" 1257 | version = "1.0.203" 1258 | source = "registry+https://github.com/rust-lang/crates.io-index" 1259 | checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" 1260 | dependencies = [ 1261 | "serde_derive", 1262 | ] 1263 | 1264 | [[package]] 1265 | name = "serde_derive" 1266 | version = "1.0.203" 1267 | source = "registry+https://github.com/rust-lang/crates.io-index" 1268 | checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" 1269 | dependencies = [ 1270 | "proc-macro2", 1271 | "quote", 1272 | "syn 2.0.67", 1273 | ] 1274 | 1275 | [[package]] 1276 | name = "serde_json" 1277 | version = "1.0.117" 1278 | source = "registry+https://github.com/rust-lang/crates.io-index" 1279 | checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" 1280 | dependencies = [ 1281 | "itoa", 1282 | "ryu", 1283 | "serde", 1284 | ] 1285 | 1286 | [[package]] 1287 | name = "sha1" 1288 | version = "0.10.6" 1289 | source = "registry+https://github.com/rust-lang/crates.io-index" 1290 | checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" 1291 | dependencies = [ 1292 | "cfg-if", 1293 | "cpufeatures", 1294 | "digest", 1295 | ] 1296 | 1297 | [[package]] 1298 | name = "sha2" 1299 | version = "0.10.8" 1300 | source = "registry+https://github.com/rust-lang/crates.io-index" 1301 | checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" 1302 | dependencies = [ 1303 | "cfg-if", 1304 | "cpufeatures", 1305 | "digest", 1306 | ] 1307 | 1308 | [[package]] 1309 | name = "signature" 1310 | version = "2.2.0" 1311 | source = "registry+https://github.com/rust-lang/crates.io-index" 1312 | checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" 1313 | dependencies = [ 1314 | "digest", 1315 | "rand_core", 1316 | ] 1317 | 1318 | [[package]] 1319 | name = "slab" 1320 | version = "0.4.9" 1321 | source = "registry+https://github.com/rust-lang/crates.io-index" 1322 | checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" 1323 | dependencies = [ 1324 | "autocfg", 1325 | ] 1326 | 1327 | [[package]] 1328 | name = "smallvec" 1329 | version = "1.11.2" 1330 | source = "registry+https://github.com/rust-lang/crates.io-index" 1331 | checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" 1332 | 1333 | [[package]] 1334 | name = "socket2" 1335 | version = "0.5.5" 1336 | source = "registry+https://github.com/rust-lang/crates.io-index" 1337 | checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" 1338 | dependencies = [ 1339 | "libc", 1340 | "windows-sys 0.48.0", 1341 | ] 1342 | 1343 | [[package]] 1344 | name = "spin" 1345 | version = "0.5.2" 1346 | source = "registry+https://github.com/rust-lang/crates.io-index" 1347 | checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" 1348 | 1349 | [[package]] 1350 | name = "spin" 1351 | version = "0.9.8" 1352 | source = "registry+https://github.com/rust-lang/crates.io-index" 1353 | checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" 1354 | dependencies = [ 1355 | "lock_api", 1356 | ] 1357 | 1358 | [[package]] 1359 | name = "spki" 1360 | version = "0.7.3" 1361 | source = "registry+https://github.com/rust-lang/crates.io-index" 1362 | checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" 1363 | dependencies = [ 1364 | "base64ct", 1365 | "der", 1366 | ] 1367 | 1368 | [[package]] 1369 | name = "sqlformat" 1370 | version = "0.2.3" 1371 | source = "registry+https://github.com/rust-lang/crates.io-index" 1372 | checksum = "ce81b7bd7c4493975347ef60d8c7e8b742d4694f4c49f93e0a12ea263938176c" 1373 | dependencies = [ 1374 | "itertools", 1375 | "nom", 1376 | "unicode_categories", 1377 | ] 1378 | 1379 | [[package]] 1380 | name = "sqlparser" 1381 | version = "0.47.0" 1382 | source = "registry+https://github.com/rust-lang/crates.io-index" 1383 | checksum = "295e9930cd7a97e58ca2a070541a3ca502b17f5d1fa7157376d0fabd85324f25" 1384 | dependencies = [ 1385 | "log", 1386 | "serde", 1387 | ] 1388 | 1389 | [[package]] 1390 | name = "sqlx" 1391 | version = "0.7.4" 1392 | source = "registry+https://github.com/rust-lang/crates.io-index" 1393 | checksum = "c9a2ccff1a000a5a59cd33da541d9f2fdcd9e6e8229cc200565942bff36d0aaa" 1394 | dependencies = [ 1395 | "sqlx-core", 1396 | "sqlx-macros", 1397 | "sqlx-mysql", 1398 | "sqlx-postgres", 1399 | "sqlx-sqlite", 1400 | ] 1401 | 1402 | [[package]] 1403 | name = "sqlx-core" 1404 | version = "0.7.4" 1405 | source = "registry+https://github.com/rust-lang/crates.io-index" 1406 | checksum = "24ba59a9342a3d9bab6c56c118be528b27c9b60e490080e9711a04dccac83ef6" 1407 | dependencies = [ 1408 | "ahash", 1409 | "atoi", 1410 | "byteorder", 1411 | "bytes", 1412 | "crc", 1413 | "crossbeam-queue", 1414 | "either", 1415 | "event-listener", 1416 | "futures-channel", 1417 | "futures-core", 1418 | "futures-intrusive", 1419 | "futures-io", 1420 | "futures-util", 1421 | "hashlink", 1422 | "hex", 1423 | "indexmap", 1424 | "log", 1425 | "memchr", 1426 | "once_cell", 1427 | "paste", 1428 | "percent-encoding", 1429 | "rustls", 1430 | "rustls-pemfile", 1431 | "serde", 1432 | "serde_json", 1433 | "sha2", 1434 | "smallvec", 1435 | "sqlformat", 1436 | "thiserror", 1437 | "tokio", 1438 | "tokio-stream", 1439 | "tracing", 1440 | "url", 1441 | "webpki-roots", 1442 | ] 1443 | 1444 | [[package]] 1445 | name = "sqlx-macros" 1446 | version = "0.7.4" 1447 | source = "registry+https://github.com/rust-lang/crates.io-index" 1448 | checksum = "4ea40e2345eb2faa9e1e5e326db8c34711317d2b5e08d0d5741619048a803127" 1449 | dependencies = [ 1450 | "proc-macro2", 1451 | "quote", 1452 | "sqlx-core", 1453 | "sqlx-macros-core", 1454 | "syn 1.0.109", 1455 | ] 1456 | 1457 | [[package]] 1458 | name = "sqlx-macros-core" 1459 | version = "0.7.4" 1460 | source = "registry+https://github.com/rust-lang/crates.io-index" 1461 | checksum = "5833ef53aaa16d860e92123292f1f6a3d53c34ba8b1969f152ef1a7bb803f3c8" 1462 | dependencies = [ 1463 | "dotenvy", 1464 | "either", 1465 | "heck 0.4.1", 1466 | "hex", 1467 | "once_cell", 1468 | "proc-macro2", 1469 | "quote", 1470 | "serde", 1471 | "serde_json", 1472 | "sha2", 1473 | "sqlx-core", 1474 | "sqlx-sqlite", 1475 | "syn 1.0.109", 1476 | "tempfile", 1477 | "tokio", 1478 | "url", 1479 | ] 1480 | 1481 | [[package]] 1482 | name = "sqlx-mysql" 1483 | version = "0.7.4" 1484 | source = "registry+https://github.com/rust-lang/crates.io-index" 1485 | checksum = "1ed31390216d20e538e447a7a9b959e06ed9fc51c37b514b46eb758016ecd418" 1486 | dependencies = [ 1487 | "atoi", 1488 | "base64", 1489 | "bitflags 2.4.1", 1490 | "byteorder", 1491 | "bytes", 1492 | "crc", 1493 | "digest", 1494 | "dotenvy", 1495 | "either", 1496 | "futures-channel", 1497 | "futures-core", 1498 | "futures-io", 1499 | "futures-util", 1500 | "generic-array", 1501 | "hex", 1502 | "hkdf", 1503 | "hmac", 1504 | "itoa", 1505 | "log", 1506 | "md-5", 1507 | "memchr", 1508 | "once_cell", 1509 | "percent-encoding", 1510 | "rand", 1511 | "rsa", 1512 | "sha1", 1513 | "sha2", 1514 | "smallvec", 1515 | "sqlx-core", 1516 | "stringprep", 1517 | "thiserror", 1518 | "tracing", 1519 | "whoami", 1520 | ] 1521 | 1522 | [[package]] 1523 | name = "sqlx-postgres" 1524 | version = "0.7.4" 1525 | source = "registry+https://github.com/rust-lang/crates.io-index" 1526 | checksum = "7c824eb80b894f926f89a0b9da0c7f435d27cdd35b8c655b114e58223918577e" 1527 | dependencies = [ 1528 | "atoi", 1529 | "base64", 1530 | "bitflags 2.4.1", 1531 | "byteorder", 1532 | "crc", 1533 | "dotenvy", 1534 | "etcetera", 1535 | "futures-channel", 1536 | "futures-core", 1537 | "futures-io", 1538 | "futures-util", 1539 | "hex", 1540 | "hkdf", 1541 | "hmac", 1542 | "home", 1543 | "itoa", 1544 | "log", 1545 | "md-5", 1546 | "memchr", 1547 | "once_cell", 1548 | "rand", 1549 | "serde", 1550 | "serde_json", 1551 | "sha2", 1552 | "smallvec", 1553 | "sqlx-core", 1554 | "stringprep", 1555 | "thiserror", 1556 | "tracing", 1557 | "whoami", 1558 | ] 1559 | 1560 | [[package]] 1561 | name = "sqlx-sqlite" 1562 | version = "0.7.4" 1563 | source = "registry+https://github.com/rust-lang/crates.io-index" 1564 | checksum = "b244ef0a8414da0bed4bb1910426e890b19e5e9bccc27ada6b797d05c55ae0aa" 1565 | dependencies = [ 1566 | "atoi", 1567 | "flume", 1568 | "futures-channel", 1569 | "futures-core", 1570 | "futures-executor", 1571 | "futures-intrusive", 1572 | "futures-util", 1573 | "libsqlite3-sys", 1574 | "log", 1575 | "percent-encoding", 1576 | "serde", 1577 | "sqlx-core", 1578 | "tracing", 1579 | "url", 1580 | "urlencoding", 1581 | ] 1582 | 1583 | [[package]] 1584 | name = "stacker" 1585 | version = "0.1.15" 1586 | source = "registry+https://github.com/rust-lang/crates.io-index" 1587 | checksum = "c886bd4480155fd3ef527d45e9ac8dd7118a898a46530b7b94c3e21866259fce" 1588 | dependencies = [ 1589 | "cc", 1590 | "cfg-if", 1591 | "libc", 1592 | "psm", 1593 | "winapi", 1594 | ] 1595 | 1596 | [[package]] 1597 | name = "stringprep" 1598 | version = "0.1.4" 1599 | source = "registry+https://github.com/rust-lang/crates.io-index" 1600 | checksum = "bb41d74e231a107a1b4ee36bd1214b11285b77768d2e3824aedafa988fd36ee6" 1601 | dependencies = [ 1602 | "finl_unicode", 1603 | "unicode-bidi", 1604 | "unicode-normalization", 1605 | ] 1606 | 1607 | [[package]] 1608 | name = "strum" 1609 | version = "0.26.2" 1610 | source = "registry+https://github.com/rust-lang/crates.io-index" 1611 | checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" 1612 | dependencies = [ 1613 | "strum_macros", 1614 | ] 1615 | 1616 | [[package]] 1617 | name = "strum_macros" 1618 | version = "0.26.4" 1619 | source = "registry+https://github.com/rust-lang/crates.io-index" 1620 | checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" 1621 | dependencies = [ 1622 | "heck 0.5.0", 1623 | "proc-macro2", 1624 | "quote", 1625 | "rustversion", 1626 | "syn 2.0.67", 1627 | ] 1628 | 1629 | [[package]] 1630 | name = "subtle" 1631 | version = "2.5.0" 1632 | source = "registry+https://github.com/rust-lang/crates.io-index" 1633 | checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" 1634 | 1635 | [[package]] 1636 | name = "syn" 1637 | version = "1.0.109" 1638 | source = "registry+https://github.com/rust-lang/crates.io-index" 1639 | checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" 1640 | dependencies = [ 1641 | "proc-macro2", 1642 | "quote", 1643 | "unicode-ident", 1644 | ] 1645 | 1646 | [[package]] 1647 | name = "syn" 1648 | version = "2.0.67" 1649 | source = "registry+https://github.com/rust-lang/crates.io-index" 1650 | checksum = "ff8655ed1d86f3af4ee3fd3263786bc14245ad17c4c7e85ba7187fb3ae028c90" 1651 | dependencies = [ 1652 | "proc-macro2", 1653 | "quote", 1654 | "unicode-ident", 1655 | ] 1656 | 1657 | [[package]] 1658 | name = "tempfile" 1659 | version = "3.8.1" 1660 | source = "registry+https://github.com/rust-lang/crates.io-index" 1661 | checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" 1662 | dependencies = [ 1663 | "cfg-if", 1664 | "fastrand", 1665 | "redox_syscall", 1666 | "rustix", 1667 | "windows-sys 0.48.0", 1668 | ] 1669 | 1670 | [[package]] 1671 | name = "thiserror" 1672 | version = "1.0.50" 1673 | source = "registry+https://github.com/rust-lang/crates.io-index" 1674 | checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" 1675 | dependencies = [ 1676 | "thiserror-impl", 1677 | ] 1678 | 1679 | [[package]] 1680 | name = "thiserror-impl" 1681 | version = "1.0.50" 1682 | source = "registry+https://github.com/rust-lang/crates.io-index" 1683 | checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" 1684 | dependencies = [ 1685 | "proc-macro2", 1686 | "quote", 1687 | "syn 2.0.67", 1688 | ] 1689 | 1690 | [[package]] 1691 | name = "tinyvec" 1692 | version = "1.6.0" 1693 | source = "registry+https://github.com/rust-lang/crates.io-index" 1694 | checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" 1695 | dependencies = [ 1696 | "tinyvec_macros", 1697 | ] 1698 | 1699 | [[package]] 1700 | name = "tinyvec_macros" 1701 | version = "0.1.1" 1702 | source = "registry+https://github.com/rust-lang/crates.io-index" 1703 | checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" 1704 | 1705 | [[package]] 1706 | name = "tokio" 1707 | version = "1.38.0" 1708 | source = "registry+https://github.com/rust-lang/crates.io-index" 1709 | checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" 1710 | dependencies = [ 1711 | "backtrace", 1712 | "bytes", 1713 | "libc", 1714 | "mio", 1715 | "num_cpus", 1716 | "pin-project-lite", 1717 | "socket2", 1718 | "tokio-macros", 1719 | "windows-sys 0.48.0", 1720 | ] 1721 | 1722 | [[package]] 1723 | name = "tokio-macros" 1724 | version = "2.3.0" 1725 | source = "registry+https://github.com/rust-lang/crates.io-index" 1726 | checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" 1727 | dependencies = [ 1728 | "proc-macro2", 1729 | "quote", 1730 | "syn 2.0.67", 1731 | ] 1732 | 1733 | [[package]] 1734 | name = "tokio-stream" 1735 | version = "0.1.14" 1736 | source = "registry+https://github.com/rust-lang/crates.io-index" 1737 | checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" 1738 | dependencies = [ 1739 | "futures-core", 1740 | "pin-project-lite", 1741 | "tokio", 1742 | ] 1743 | 1744 | [[package]] 1745 | name = "tracing" 1746 | version = "0.1.40" 1747 | source = "registry+https://github.com/rust-lang/crates.io-index" 1748 | checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" 1749 | dependencies = [ 1750 | "log", 1751 | "pin-project-lite", 1752 | "tracing-attributes", 1753 | "tracing-core", 1754 | ] 1755 | 1756 | [[package]] 1757 | name = "tracing-attributes" 1758 | version = "0.1.27" 1759 | source = "registry+https://github.com/rust-lang/crates.io-index" 1760 | checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" 1761 | dependencies = [ 1762 | "proc-macro2", 1763 | "quote", 1764 | "syn 2.0.67", 1765 | ] 1766 | 1767 | [[package]] 1768 | name = "tracing-core" 1769 | version = "0.1.32" 1770 | source = "registry+https://github.com/rust-lang/crates.io-index" 1771 | checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" 1772 | dependencies = [ 1773 | "once_cell", 1774 | ] 1775 | 1776 | [[package]] 1777 | name = "typenum" 1778 | version = "1.17.0" 1779 | source = "registry+https://github.com/rust-lang/crates.io-index" 1780 | checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" 1781 | 1782 | [[package]] 1783 | name = "unicode-bidi" 1784 | version = "0.3.14" 1785 | source = "registry+https://github.com/rust-lang/crates.io-index" 1786 | checksum = "6f2528f27a9eb2b21e69c95319b30bd0efd85d09c379741b0f78ea1d86be2416" 1787 | 1788 | [[package]] 1789 | name = "unicode-ident" 1790 | version = "1.0.12" 1791 | source = "registry+https://github.com/rust-lang/crates.io-index" 1792 | checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" 1793 | 1794 | [[package]] 1795 | name = "unicode-normalization" 1796 | version = "0.1.22" 1797 | source = "registry+https://github.com/rust-lang/crates.io-index" 1798 | checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" 1799 | dependencies = [ 1800 | "tinyvec", 1801 | ] 1802 | 1803 | [[package]] 1804 | name = "unicode-segmentation" 1805 | version = "1.10.1" 1806 | source = "registry+https://github.com/rust-lang/crates.io-index" 1807 | checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" 1808 | 1809 | [[package]] 1810 | name = "unicode-width" 1811 | version = "0.1.11" 1812 | source = "registry+https://github.com/rust-lang/crates.io-index" 1813 | checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" 1814 | 1815 | [[package]] 1816 | name = "unicode_categories" 1817 | version = "0.1.1" 1818 | source = "registry+https://github.com/rust-lang/crates.io-index" 1819 | checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" 1820 | 1821 | [[package]] 1822 | name = "untrusted" 1823 | version = "0.9.0" 1824 | source = "registry+https://github.com/rust-lang/crates.io-index" 1825 | checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" 1826 | 1827 | [[package]] 1828 | name = "url" 1829 | version = "2.5.0" 1830 | source = "registry+https://github.com/rust-lang/crates.io-index" 1831 | checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" 1832 | dependencies = [ 1833 | "form_urlencoded", 1834 | "idna", 1835 | "percent-encoding", 1836 | ] 1837 | 1838 | [[package]] 1839 | name = "urlencoding" 1840 | version = "2.1.3" 1841 | source = "registry+https://github.com/rust-lang/crates.io-index" 1842 | checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" 1843 | 1844 | [[package]] 1845 | name = "utf8parse" 1846 | version = "0.2.1" 1847 | source = "registry+https://github.com/rust-lang/crates.io-index" 1848 | checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" 1849 | 1850 | [[package]] 1851 | name = "vcpkg" 1852 | version = "0.2.15" 1853 | source = "registry+https://github.com/rust-lang/crates.io-index" 1854 | checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" 1855 | 1856 | [[package]] 1857 | name = "version_check" 1858 | version = "0.9.4" 1859 | source = "registry+https://github.com/rust-lang/crates.io-index" 1860 | checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" 1861 | 1862 | [[package]] 1863 | name = "wasi" 1864 | version = "0.11.0+wasi-snapshot-preview1" 1865 | source = "registry+https://github.com/rust-lang/crates.io-index" 1866 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 1867 | 1868 | [[package]] 1869 | name = "wasm-bindgen" 1870 | version = "0.2.92" 1871 | source = "registry+https://github.com/rust-lang/crates.io-index" 1872 | checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" 1873 | dependencies = [ 1874 | "cfg-if", 1875 | "wasm-bindgen-macro", 1876 | ] 1877 | 1878 | [[package]] 1879 | name = "wasm-bindgen-backend" 1880 | version = "0.2.92" 1881 | source = "registry+https://github.com/rust-lang/crates.io-index" 1882 | checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" 1883 | dependencies = [ 1884 | "bumpalo", 1885 | "log", 1886 | "once_cell", 1887 | "proc-macro2", 1888 | "quote", 1889 | "syn 2.0.67", 1890 | "wasm-bindgen-shared", 1891 | ] 1892 | 1893 | [[package]] 1894 | name = "wasm-bindgen-macro" 1895 | version = "0.2.92" 1896 | source = "registry+https://github.com/rust-lang/crates.io-index" 1897 | checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" 1898 | dependencies = [ 1899 | "quote", 1900 | "wasm-bindgen-macro-support", 1901 | ] 1902 | 1903 | [[package]] 1904 | name = "wasm-bindgen-macro-support" 1905 | version = "0.2.92" 1906 | source = "registry+https://github.com/rust-lang/crates.io-index" 1907 | checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" 1908 | dependencies = [ 1909 | "proc-macro2", 1910 | "quote", 1911 | "syn 2.0.67", 1912 | "wasm-bindgen-backend", 1913 | "wasm-bindgen-shared", 1914 | ] 1915 | 1916 | [[package]] 1917 | name = "wasm-bindgen-shared" 1918 | version = "0.2.92" 1919 | source = "registry+https://github.com/rust-lang/crates.io-index" 1920 | checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" 1921 | 1922 | [[package]] 1923 | name = "webpki-roots" 1924 | version = "0.25.3" 1925 | source = "registry+https://github.com/rust-lang/crates.io-index" 1926 | checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10" 1927 | 1928 | [[package]] 1929 | name = "whoami" 1930 | version = "1.4.1" 1931 | source = "registry+https://github.com/rust-lang/crates.io-index" 1932 | checksum = "22fc3756b8a9133049b26c7f61ab35416c130e8c09b660f5b3958b446f52cc50" 1933 | 1934 | [[package]] 1935 | name = "winapi" 1936 | version = "0.3.9" 1937 | source = "registry+https://github.com/rust-lang/crates.io-index" 1938 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 1939 | dependencies = [ 1940 | "winapi-i686-pc-windows-gnu", 1941 | "winapi-x86_64-pc-windows-gnu", 1942 | ] 1943 | 1944 | [[package]] 1945 | name = "winapi-i686-pc-windows-gnu" 1946 | version = "0.4.0" 1947 | source = "registry+https://github.com/rust-lang/crates.io-index" 1948 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 1949 | 1950 | [[package]] 1951 | name = "winapi-x86_64-pc-windows-gnu" 1952 | version = "0.4.0" 1953 | source = "registry+https://github.com/rust-lang/crates.io-index" 1954 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 1955 | 1956 | [[package]] 1957 | name = "windows-core" 1958 | version = "0.52.0" 1959 | source = "registry+https://github.com/rust-lang/crates.io-index" 1960 | checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" 1961 | dependencies = [ 1962 | "windows-targets 0.52.0", 1963 | ] 1964 | 1965 | [[package]] 1966 | name = "windows-sys" 1967 | version = "0.48.0" 1968 | source = "registry+https://github.com/rust-lang/crates.io-index" 1969 | checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" 1970 | dependencies = [ 1971 | "windows-targets 0.48.5", 1972 | ] 1973 | 1974 | [[package]] 1975 | name = "windows-sys" 1976 | version = "0.52.0" 1977 | source = "registry+https://github.com/rust-lang/crates.io-index" 1978 | checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" 1979 | dependencies = [ 1980 | "windows-targets 0.52.0", 1981 | ] 1982 | 1983 | [[package]] 1984 | name = "windows-targets" 1985 | version = "0.48.5" 1986 | source = "registry+https://github.com/rust-lang/crates.io-index" 1987 | checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" 1988 | dependencies = [ 1989 | "windows_aarch64_gnullvm 0.48.5", 1990 | "windows_aarch64_msvc 0.48.5", 1991 | "windows_i686_gnu 0.48.5", 1992 | "windows_i686_msvc 0.48.5", 1993 | "windows_x86_64_gnu 0.48.5", 1994 | "windows_x86_64_gnullvm 0.48.5", 1995 | "windows_x86_64_msvc 0.48.5", 1996 | ] 1997 | 1998 | [[package]] 1999 | name = "windows-targets" 2000 | version = "0.52.0" 2001 | source = "registry+https://github.com/rust-lang/crates.io-index" 2002 | checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" 2003 | dependencies = [ 2004 | "windows_aarch64_gnullvm 0.52.0", 2005 | "windows_aarch64_msvc 0.52.0", 2006 | "windows_i686_gnu 0.52.0", 2007 | "windows_i686_msvc 0.52.0", 2008 | "windows_x86_64_gnu 0.52.0", 2009 | "windows_x86_64_gnullvm 0.52.0", 2010 | "windows_x86_64_msvc 0.52.0", 2011 | ] 2012 | 2013 | [[package]] 2014 | name = "windows_aarch64_gnullvm" 2015 | version = "0.48.5" 2016 | source = "registry+https://github.com/rust-lang/crates.io-index" 2017 | checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" 2018 | 2019 | [[package]] 2020 | name = "windows_aarch64_gnullvm" 2021 | version = "0.52.0" 2022 | source = "registry+https://github.com/rust-lang/crates.io-index" 2023 | checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" 2024 | 2025 | [[package]] 2026 | name = "windows_aarch64_msvc" 2027 | version = "0.48.5" 2028 | source = "registry+https://github.com/rust-lang/crates.io-index" 2029 | checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" 2030 | 2031 | [[package]] 2032 | name = "windows_aarch64_msvc" 2033 | version = "0.52.0" 2034 | source = "registry+https://github.com/rust-lang/crates.io-index" 2035 | checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" 2036 | 2037 | [[package]] 2038 | name = "windows_i686_gnu" 2039 | version = "0.48.5" 2040 | source = "registry+https://github.com/rust-lang/crates.io-index" 2041 | checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" 2042 | 2043 | [[package]] 2044 | name = "windows_i686_gnu" 2045 | version = "0.52.0" 2046 | source = "registry+https://github.com/rust-lang/crates.io-index" 2047 | checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" 2048 | 2049 | [[package]] 2050 | name = "windows_i686_msvc" 2051 | version = "0.48.5" 2052 | source = "registry+https://github.com/rust-lang/crates.io-index" 2053 | checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" 2054 | 2055 | [[package]] 2056 | name = "windows_i686_msvc" 2057 | version = "0.52.0" 2058 | source = "registry+https://github.com/rust-lang/crates.io-index" 2059 | checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" 2060 | 2061 | [[package]] 2062 | name = "windows_x86_64_gnu" 2063 | version = "0.48.5" 2064 | source = "registry+https://github.com/rust-lang/crates.io-index" 2065 | checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" 2066 | 2067 | [[package]] 2068 | name = "windows_x86_64_gnu" 2069 | version = "0.52.0" 2070 | source = "registry+https://github.com/rust-lang/crates.io-index" 2071 | checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" 2072 | 2073 | [[package]] 2074 | name = "windows_x86_64_gnullvm" 2075 | version = "0.48.5" 2076 | source = "registry+https://github.com/rust-lang/crates.io-index" 2077 | checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" 2078 | 2079 | [[package]] 2080 | name = "windows_x86_64_gnullvm" 2081 | version = "0.52.0" 2082 | source = "registry+https://github.com/rust-lang/crates.io-index" 2083 | checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" 2084 | 2085 | [[package]] 2086 | name = "windows_x86_64_msvc" 2087 | version = "0.48.5" 2088 | source = "registry+https://github.com/rust-lang/crates.io-index" 2089 | checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" 2090 | 2091 | [[package]] 2092 | name = "windows_x86_64_msvc" 2093 | version = "0.52.0" 2094 | source = "registry+https://github.com/rust-lang/crates.io-index" 2095 | checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" 2096 | 2097 | [[package]] 2098 | name = "yansi" 2099 | version = "1.0.1" 2100 | source = "registry+https://github.com/rust-lang/crates.io-index" 2101 | checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" 2102 | 2103 | [[package]] 2104 | name = "zerocopy" 2105 | version = "0.7.34" 2106 | source = "registry+https://github.com/rust-lang/crates.io-index" 2107 | checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" 2108 | dependencies = [ 2109 | "zerocopy-derive", 2110 | ] 2111 | 2112 | [[package]] 2113 | name = "zerocopy-derive" 2114 | version = "0.7.34" 2115 | source = "registry+https://github.com/rust-lang/crates.io-index" 2116 | checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" 2117 | dependencies = [ 2118 | "proc-macro2", 2119 | "quote", 2120 | "syn 2.0.67", 2121 | ] 2122 | 2123 | [[package]] 2124 | name = "zeroize" 2125 | version = "1.7.0" 2126 | source = "registry+https://github.com/rust-lang/crates.io-index" 2127 | checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" 2128 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "prqlx" 3 | version = "0.2.1" 4 | edition = "2021" 5 | license = "MIT" 6 | description = "A procedural macro for using PRQL in sqlx" 7 | repository = "https://github.com/Suyashtnt/prqlx" 8 | readme = "README.md" 9 | keywords = ["sqlx", "prql", "sql", "query", "macro"] 10 | categories = ["database"] 11 | authors = ["Suyash "] 12 | 13 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 14 | 15 | [dependencies] 16 | prql-compiler = "0.12.2" 17 | quote = "1.0.36" 18 | syn = "2.0.39" 19 | 20 | [dev-dependencies] 21 | tokio = { version = "1.38.0", features = ["rt-multi-thread", "macros"] } 22 | sqlx = { version = "0.7.4", default-features = false, features = [ 23 | "macros", 24 | "runtime-tokio-rustls", 25 | "sqlite", 26 | "migrate", 27 | ] } 28 | 29 | [lib] 30 | proc-macro = true 31 | 32 | [profile.dev.package.sqlx-macros] 33 | opt-level = 3 34 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Suyash 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PRQLX 2 | 3 | Combining the query language of [PRQL](https://prql-lang.org) with the macro powers of [SQLX](https://docs.rs/sqlx). 4 | 5 | PRQL is an amazing DSL for sql, but it doesn't have native support in sqlx. This crate bridges the gap by compiling prql _in the rust macro itself_ before it's sent to sqlx (and your database). This means you can use the prql syntax with: 6 | 7 | - All supported sqlx databases 8 | - Nice compiler errors 9 | - Fully typed rust 10 | 11 | ## Usage 12 | 13 | ```sh 14 | cargo add prqlx 15 | cargo add sqlx # requires sqlx to be installed by you so you can configure it correctly 16 | ``` 17 | 18 | ```rs 19 | use prqlx::{query, query_as}; 20 | 21 | async fn test_query() { 22 | // get your sqlx pool in whatever way 23 | let pool = get_database_pool().await; 24 | 25 | // simply use it like a regular sqlx query, except you now use PRQL! 26 | let val = query!( 27 | " 28 | from users 29 | select { id, name } 30 | " 31 | ) 32 | .fetch_all(&pool) 33 | .await 34 | .unwrap(); 35 | 36 | // Same thing with query_as! 37 | // Bindings also just work:tm: 38 | let val2 = query_as!( 39 | User, 40 | " 41 | from users 42 | select { id, name } 43 | filter id == $1 44 | ", 45 | 123 46 | ) 47 | .fetch_one(&pool) 48 | .await 49 | .unwrap(); 50 | 51 | println!("{:?}", val2); 52 | } 53 | ``` 54 | 55 | ## Caveats 56 | 57 | PRQL doesn't natively support `?` for bindings. You will have to use `s"?"` for that. Rather use `${num}` for bindings. 58 | 59 | ## Todos 60 | 61 | Not all macros have been implemented. The only ones are `query` and `query_as`. If you would like another to be added, please file an issue (or make a PR!). 62 | 63 | ## Testing/Contributing 64 | 65 | Before running `cargo test`, the database must first be setup. To do so, run `cargo run --example prepare` to prepare the sqlite database. After that, you can develop as usual. 66 | -------------------------------------------------------------------------------- /deny.toml: -------------------------------------------------------------------------------- 1 | [licenses] 2 | allow = [ 3 | "MIT" 4 | ] 5 | -------------------------------------------------------------------------------- /examples/prepare.rs: -------------------------------------------------------------------------------- 1 | use sqlx::{migrate::MigrateDatabase, Sqlite, SqlitePool}; 2 | const DB_URL: &str = "sqlite://sqlite.db"; 3 | 4 | async fn setup_db() -> SqlitePool { 5 | if !Sqlite::database_exists(DB_URL).await.unwrap_or(false) { 6 | println!("Creating database {}", DB_URL); 7 | Sqlite::create_database(DB_URL).await.unwrap() 8 | } else { 9 | println!("Database already exists"); 10 | } 11 | 12 | let pool = SqlitePool::connect(DB_URL).await.unwrap(); 13 | sqlx::query("CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY NOT NULL, name VARCHAR(250) NOT NULL);") 14 | .execute(&pool) 15 | .await 16 | .unwrap(); 17 | 18 | pool 19 | } 20 | 21 | #[tokio::main] 22 | async fn main() { 23 | println!("Setting up database..."); 24 | setup_db().await; 25 | println!("Database setup complete"); 26 | } 27 | -------------------------------------------------------------------------------- /flake.lock: -------------------------------------------------------------------------------- 1 | { 2 | "nodes": { 3 | "advisory-db": { 4 | "flake": false, 5 | "locked": { 6 | "lastModified": 1701193254, 7 | "narHash": "sha256-Hr7efA3GjwqBkGYKmd3XmGckdPQikbcCmOrq7fmTp3A=", 8 | "owner": "rustsec", 9 | "repo": "advisory-db", 10 | "rev": "43af5fef0591531a72ebb86c5f1c623ee95c62fe", 11 | "type": "github" 12 | }, 13 | "original": { 14 | "owner": "rustsec", 15 | "repo": "advisory-db", 16 | "type": "github" 17 | } 18 | }, 19 | "crane": { 20 | "inputs": { 21 | "nixpkgs": [ 22 | "nixpkgs" 23 | ] 24 | }, 25 | "locked": { 26 | "lastModified": 1701622587, 27 | "narHash": "sha256-o3XhxCCyrUHZ0tlta2W7/MuXzy+n0+BUt3rKFK3DIK4=", 28 | "owner": "ipetkov", 29 | "repo": "crane", 30 | "rev": "c09d2cbe84cc2adfe1943cb2a0b55a71c835ca9a", 31 | "type": "github" 32 | }, 33 | "original": { 34 | "owner": "ipetkov", 35 | "repo": "crane", 36 | "type": "github" 37 | } 38 | }, 39 | "fenix": { 40 | "inputs": { 41 | "nixpkgs": [ 42 | "nixpkgs" 43 | ], 44 | "rust-analyzer-src": "rust-analyzer-src" 45 | }, 46 | "locked": { 47 | "lastModified": 1701884128, 48 | "narHash": "sha256-8PiBdXnFkbDlV6NMWgqNcnlHJr87g9mvyZVRUy9uDqs=", 49 | "owner": "nix-community", 50 | "repo": "fenix", 51 | "rev": "3c94b1be4688e3ddc8897a26c60dcd67a69a1845", 52 | "type": "github" 53 | }, 54 | "original": { 55 | "owner": "nix-community", 56 | "repo": "fenix", 57 | "type": "github" 58 | } 59 | }, 60 | "flake-utils": { 61 | "inputs": { 62 | "systems": "systems" 63 | }, 64 | "locked": { 65 | "lastModified": 1701680307, 66 | "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", 67 | "owner": "numtide", 68 | "repo": "flake-utils", 69 | "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", 70 | "type": "github" 71 | }, 72 | "original": { 73 | "owner": "numtide", 74 | "repo": "flake-utils", 75 | "type": "github" 76 | } 77 | }, 78 | "nixpkgs": { 79 | "locked": { 80 | "lastModified": 1701693815, 81 | "narHash": "sha256-7BkrXykVWfkn6+c1EhFA3ko4MLi3gVG0p9G96PNnKTM=", 82 | "owner": "NixOS", 83 | "repo": "nixpkgs", 84 | "rev": "09ec6a0881e1a36c29d67497693a67a16f4da573", 85 | "type": "github" 86 | }, 87 | "original": { 88 | "owner": "NixOS", 89 | "ref": "nixpkgs-unstable", 90 | "repo": "nixpkgs", 91 | "type": "github" 92 | } 93 | }, 94 | "root": { 95 | "inputs": { 96 | "advisory-db": "advisory-db", 97 | "crane": "crane", 98 | "fenix": "fenix", 99 | "flake-utils": "flake-utils", 100 | "nixpkgs": "nixpkgs" 101 | } 102 | }, 103 | "rust-analyzer-src": { 104 | "flake": false, 105 | "locked": { 106 | "lastModified": 1701792945, 107 | "narHash": "sha256-sDsGXchaAIqq/UsRcgQh/BtX6WzaIN8wa7FNhwhZ540=", 108 | "owner": "rust-lang", 109 | "repo": "rust-analyzer", 110 | "rev": "05df6c52cac9f5ce37a543a0b81d3bd6a1ec9d6d", 111 | "type": "github" 112 | }, 113 | "original": { 114 | "owner": "rust-lang", 115 | "ref": "nightly", 116 | "repo": "rust-analyzer", 117 | "type": "github" 118 | } 119 | }, 120 | "systems": { 121 | "locked": { 122 | "lastModified": 1681028828, 123 | "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", 124 | "owner": "nix-systems", 125 | "repo": "default", 126 | "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", 127 | "type": "github" 128 | }, 129 | "original": { 130 | "owner": "nix-systems", 131 | "repo": "default", 132 | "type": "github" 133 | } 134 | } 135 | }, 136 | "root": "root", 137 | "version": 7 138 | } 139 | -------------------------------------------------------------------------------- /flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | description = "Build a cargo project"; 3 | 4 | inputs = { 5 | nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; 6 | 7 | crane = { 8 | url = "github:ipetkov/crane"; 9 | inputs.nixpkgs.follows = "nixpkgs"; 10 | }; 11 | 12 | fenix = { 13 | url = "github:nix-community/fenix"; 14 | inputs.nixpkgs.follows = "nixpkgs"; 15 | }; 16 | 17 | flake-utils.url = "github:numtide/flake-utils"; 18 | 19 | advisory-db = { 20 | url = "github:rustsec/advisory-db"; 21 | flake = false; 22 | }; 23 | }; 24 | 25 | outputs = { 26 | self, 27 | nixpkgs, 28 | crane, 29 | fenix, 30 | flake-utils, 31 | advisory-db, 32 | ... 33 | }: 34 | flake-utils.lib.eachDefaultSystem (system: let 35 | pkgs = import nixpkgs { 36 | inherit system; 37 | overlays = [fenix.overlays.default]; 38 | }; 39 | 40 | inherit (pkgs) lib; 41 | 42 | craneLib = crane.lib.${system}; 43 | src = craneLib.cleanCargoSource (craneLib.path ./.); 44 | 45 | # Common arguments can be set here to avoid repeating them later 46 | commonArgs = { 47 | inherit src; 48 | strictDeps = true; 49 | 50 | buildInputs = 51 | [ 52 | # Add additional build inputs here 53 | ] 54 | ++ lib.optionals pkgs.stdenv.isDarwin [ 55 | # Additional darwin specific inputs can be set here 56 | pkgs.libiconv 57 | ]; 58 | 59 | # Additional environment variables can be set directly 60 | # MY_CUSTOM_VAR = "some value"; 61 | RUST_SRC_PATH = "${pkgs.fenix.complete.rust-src}/lib/rustlib/src/rust/library"; 62 | }; 63 | 64 | toolchain = pkgs.fenix.complete.withComponents [ 65 | "clippy" 66 | "rust-src" 67 | "cargo" 68 | "rustc" 69 | "rustfmt" 70 | ]; 71 | 72 | craneLibLLvmTools = craneLib.overrideToolchain toolchain; 73 | 74 | # Build *just* the cargo dependencies, so we can reuse 75 | # all of that work (e.g. via cachix) when running in CI 76 | cargoArtifacts = craneLib.buildDepsOnly commonArgs; 77 | 78 | # Build the actual crate itself, reusing the dependency 79 | # artifacts from above. 80 | my-crate = craneLib.buildPackage (commonArgs 81 | // { 82 | inherit cargoArtifacts; 83 | }); 84 | in { 85 | checks = { 86 | # Build the crate as part of `nix flake check` for convenience 87 | inherit my-crate; 88 | 89 | # Run clippy (and deny all warnings) on the crate source, 90 | # again, resuing the dependency artifacts from above. 91 | # 92 | # Note that this is done as a separate derivation so that 93 | # we can block the CI if there are issues here, but not 94 | # prevent downstream consumers from building our crate by itself. 95 | my-crate-clippy = craneLib.cargoClippy (commonArgs 96 | // { 97 | inherit cargoArtifacts; 98 | cargoClippyExtraArgs = "--all-targets -- --deny warnings"; 99 | }); 100 | 101 | my-crate-doc = craneLib.cargoDoc (commonArgs 102 | // { 103 | inherit cargoArtifacts; 104 | }); 105 | 106 | # Check formatting 107 | my-crate-fmt = craneLib.cargoFmt { 108 | inherit src; 109 | }; 110 | 111 | # Audit dependencies 112 | my-crate-audit = craneLib.cargoAudit { 113 | inherit src advisory-db; 114 | }; 115 | 116 | # Audit licenses 117 | my-crate-deny = craneLib.cargoDeny { 118 | inherit src; 119 | }; 120 | 121 | # Run tests with cargo-nextest 122 | # Consider setting `doCheck = false` on `my-crate` if you do not want 123 | # the tests to run twice 124 | my-crate-nextest = craneLib.cargoNextest (commonArgs 125 | // { 126 | inherit cargoArtifacts; 127 | partitions = 1; 128 | partitionType = "count"; 129 | }); 130 | }; 131 | 132 | packages = { 133 | default = my-crate; 134 | my-crate-llvm-coverage = craneLibLLvmTools.cargoLlvmCov (commonArgs 135 | // { 136 | inherit cargoArtifacts; 137 | }); 138 | }; 139 | 140 | apps.default = flake-utils.lib.mkApp { 141 | drv = my-crate; 142 | }; 143 | 144 | devShells.default = craneLib.devShell { 145 | # Inherit inputs from checks. 146 | checks = self.checks.${system}; 147 | 148 | RUST_SRC_PATH = "${pkgs.fenix.complete.rust-src}/lib/rustlib/src/rust/library"; 149 | 150 | # Extra inputs can be added here; cargo and rustc are provided by default. 151 | packages = [ 152 | toolchain 153 | pkgs.rust-analyzer-nightly 154 | pkgs.pkg-config 155 | pkgs.alejandra 156 | pkgs.nil 157 | pkgs.cargo-shuttle 158 | pkgs.bacon 159 | pkgs.marksman 160 | ]; 161 | }; 162 | }); 163 | } 164 | -------------------------------------------------------------------------------- /src/lib.rs: -------------------------------------------------------------------------------- 1 | use proc_macro::TokenStream; 2 | use quote::quote; 3 | use syn::{ 4 | parse::{Parse, ParseStream}, 5 | parse_macro_input, 6 | punctuated::Punctuated, 7 | Expr, ExprLit, Lit, Path, Token, 8 | }; 9 | 10 | struct QueryInput { 11 | /// The SQL query to execute 12 | query: Expr, 13 | /// Any extra arguments to pass to [`sqlx::query`] 14 | args: Punctuated, 15 | } 16 | 17 | impl Parse for QueryInput { 18 | fn parse(input: ParseStream) -> syn::Result { 19 | let query: Expr = input.parse()?; 20 | let args = if input.is_empty() { 21 | Punctuated::new() 22 | } else { 23 | let _: Token![,] = input.parse()?; 24 | input.parse_terminated(Expr::parse, Token![,])? 25 | }; 26 | 27 | Ok(Self { query, args }) 28 | } 29 | } 30 | 31 | struct QueryAsInput { 32 | /// The type to parse the query as 33 | ty: Path, 34 | /// The SQL query to execute 35 | query: Expr, 36 | /// Any extra arguments to pass to [`sqlx::query`] 37 | args: Punctuated, 38 | } 39 | 40 | impl Parse for QueryAsInput { 41 | fn parse(input: ParseStream) -> syn::Result { 42 | let ty: Path = input.parse()?; 43 | let _: Token![,] = input.parse()?; 44 | let query: Expr = input.parse()?; 45 | let args = if input.is_empty() { 46 | Punctuated::new() 47 | } else { 48 | let _: Token![,] = input.parse()?; 49 | input.parse_terminated(Expr::parse, Token![,])? 50 | }; 51 | 52 | Ok(Self { ty, query, args }) 53 | } 54 | } 55 | 56 | fn to_sql(query: Expr) -> String { 57 | let prql_string = match query { 58 | Expr::Lit(ExprLit { 59 | lit: Lit::Str(lit_str), 60 | .. 61 | }) => lit_str.value(), 62 | _ => panic!("query! requires a string for the query"), 63 | }; 64 | 65 | let opts = prql_compiler::Options::default().no_format().no_signature(); 66 | match prql_compiler::compile(&prql_string, &opts) { 67 | Ok(r) => r, 68 | Err(err) => { 69 | panic!("{}", err) 70 | } 71 | } 72 | } 73 | 74 | #[proc_macro] 75 | /// Combines a PRQL query with a call to [`sqlx::query`]. 76 | pub fn query(input: TokenStream) -> TokenStream { 77 | let parsed = parse_macro_input!(input as QueryInput); 78 | 79 | let sql_string = to_sql(parsed.query); 80 | 81 | if parsed.args.is_empty() { 82 | let tokens = quote! { 83 | sqlx::query!(#sql_string) 84 | }; 85 | 86 | tokens.into() 87 | } else { 88 | let args = parsed.args.iter(); 89 | let tokens = quote! { 90 | sqlx::query!(#sql_string, #(#args),*) 91 | }; 92 | 93 | tokens.into() 94 | } 95 | } 96 | 97 | #[proc_macro] 98 | /// Combines a PRQL query with a call to [`sqlx::query_as`]. 99 | pub fn query_as(input: TokenStream) -> TokenStream { 100 | let parsed = parse_macro_input!(input as QueryAsInput); 101 | 102 | let sql_string = to_sql(parsed.query); 103 | let ty = parsed.ty.require_ident().unwrap(); 104 | 105 | if parsed.args.is_empty() { 106 | let tokens = quote! { 107 | sqlx::query_as!(#ty, #sql_string) 108 | }; 109 | 110 | tokens.into() 111 | } else { 112 | let args = parsed.args.iter(); 113 | let tokens = quote! { 114 | sqlx::query_as!(#ty, #sql_string, #(#args),*) 115 | }; 116 | 117 | tokens.into() 118 | } 119 | } 120 | -------------------------------------------------------------------------------- /tests/quote.rs: -------------------------------------------------------------------------------- 1 | use prqlx::{query, query_as}; 2 | use sqlx::{migrate::MigrateDatabase, Sqlite, SqlitePool}; 3 | 4 | const DB_URL: &str = "sqlite://sqlite.db"; 5 | 6 | async fn setup_db() -> SqlitePool { 7 | if !Sqlite::database_exists(DB_URL).await.unwrap_or(false) { 8 | println!("Creating database {}", DB_URL); 9 | Sqlite::create_database(DB_URL).await.unwrap() 10 | } else { 11 | println!("Database already exists"); 12 | } 13 | 14 | let pool = SqlitePool::connect(DB_URL).await.unwrap(); 15 | sqlx::query("CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY NOT NULL, name VARCHAR(250) NOT NULL);") 16 | .execute(&pool) 17 | .await 18 | .unwrap(); 19 | 20 | sqlx::query("INSERT OR IGNORE INTO users (id, name) VALUES (123, 'John Doe');") 21 | .execute(&pool) 22 | .await 23 | .unwrap(); 24 | 25 | pool 26 | } 27 | 28 | #[tokio::test] 29 | async fn test_query() { 30 | let pool = setup_db().await; 31 | 32 | let val = query!( 33 | " 34 | from users 35 | select { id, name } 36 | " 37 | ) 38 | .fetch_all(&pool) 39 | .await 40 | .unwrap(); 41 | 42 | println!("{:?}", val); 43 | } 44 | 45 | #[derive(Debug)] 46 | #[allow(dead_code)] 47 | struct User { 48 | id: i64, 49 | name: String, 50 | } 51 | 52 | #[tokio::test] 53 | async fn test_query_as() { 54 | let pool = setup_db().await; 55 | 56 | let val = query_as!( 57 | User, 58 | " 59 | from users 60 | select { id, name } 61 | " 62 | ) 63 | .fetch_all(&pool) 64 | .await 65 | .unwrap(); 66 | 67 | assert_eq!(val[0].name, "John Doe"); 68 | } 69 | 70 | #[tokio::test] 71 | async fn test_query_with_args() { 72 | let pool = setup_db().await; 73 | 74 | let user_id = 123i64; 75 | let val = query_as!( 76 | User, 77 | " 78 | from users 79 | select { id, name } 80 | filter id == $1 81 | ", 82 | user_id 83 | ) 84 | .fetch_one(&pool) 85 | .await 86 | .unwrap(); 87 | 88 | assert_eq!(val.name, "John Doe"); 89 | } 90 | --------------------------------------------------------------------------------