Crates.io | sqlx-conditional-queries |
lib.rs | sqlx-conditional-queries |
version | 0.2.1 |
source | src |
created_at | 2023-02-15 13:18:05.942698 |
updated_at | 2024-08-19 17:12:01.220435 |
description | Compile-time conditional queries for SQLx |
homepage | |
repository | https://github.com/kyrias/sqlx-conditional-queries |
max_upload_size | |
id | 785742 |
size | 20,309 |
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.
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!
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