impl_supports_fn!() { /* proc-macro */ }Expand description
Implement a built-in SQL function support marker for specific argument counts.
This macro is intended for custom drivers to opt into the built-in SQL functions that
query!/query_lazy! validate at compile time (e.g.
COUNT, SUBSTRING, DATE). See supported for which functions are available.
§Syntax
ⓘ
impl_supports_fn!(DriverType, SupportsTrait, arg_count0, arg_count1, ...);SupportsTraitcomes fromcrate::markers::functions(for exampleSupportsCount).- Provide one or more argument counts.
- Use
-1for functions that appear without parentheses (likeCURRENT_TIMESTAMP). - Use
impl_supports_fn_anyfor variadic functions. - For custom SQL functions (not built-ins), use
custom_sql_function!.
§Example
ⓘ
impl_supports_fn!(DocDriver, SupportsCount, 0, 1);
impl_supports_fn!(DocDriver, SupportsCurrentTimestamp, -1);