Macro sqlx::query_scalar
source · macro_rules! query_scalar { ($query:expr) => { ... }; ($query:expr, $($args:tt)*) => { ... }; }
Expand description
A variant of [query!] which expects a single column from the query and evaluates to an instance of QueryScalar.
The name of the column is not required to be a valid Rust identifier, however you can still use the column type override syntax in which case the column name does have to be a valid Rust identifier for the override to parse properly. If the override parse fails the error is silently ignored (we just don’t have a reliable way to tell the difference). If you’re getting a different type than expected, please check to see if your override syntax is correct before opening an issue.
Wildcard overrides like in [query_as!] are also allowed, in which case the output type is left up to inference.
See [query!] for more information.