5 releases

0.2.1 Aug 19, 2024
0.2.0 Aug 19, 2024
0.1.4 Mar 27, 2024
0.1.3 Jul 12, 2023
0.1.2 Feb 16, 2023

#400 in Database interfaces

Download history 216/week @ 2024-07-23 215/week @ 2024-07-30 304/week @ 2024-08-06 394/week @ 2024-08-13 407/week @ 2024-08-20 287/week @ 2024-08-27 324/week @ 2024-09-03 427/week @ 2024-09-10 1092/week @ 2024-09-17 1997/week @ 2024-09-24 1204/week @ 2024-10-01 2498/week @ 2024-10-08 2367/week @ 2024-10-15 2211/week @ 2024-10-22 2933/week @ 2024-10-29 2789/week @ 2024-11-05

10,664 downloads per month

MIT/Apache

9KB

Conditional compile-time verified queries with SQLx

github crates.io docs.rs

This crate provides a macro for generating conditional compile-time verified queries while using the SQLx query_as! macro. This allows you to have parts of the query conditional in ways in which your chosen database doesn't allow by emitting multiple query_as! invocations that are chosen over by a match statement.

Variant growth

Note that this means that we end up emitting as many query_as! invocations as there are elements in the Cartesian product of all of the different conditionals. This means that the number of variants increase very rapidly!

Features

Which database type should be supported is specified by activating one of the following features. If more than one feature is activated then the first one in the list takes precedence.

  • postgres
  • mysql
  • sqlite

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~0.8–1.3MB
~28K SLoC