// Pedantic config
use TokenStream;
pub use match_variant;
/// # Register exposed function names required for a UDF
///
/// This macro is applied to an `impl BasicUdf` block (and an `AggregateUdf`
/// block, if applicable) and exposed the C-callable functions that
/// `MariaDB`/`MySQL` expect.
///
/// Usage:
///
/// ```ignore
/// #[register]
/// impl BasicUdf for MyStruct {
/// ...
/// }
///
/// #[register]
/// impl AggregateUdf for MyStruct {
/// ...
/// }
/// ```
///
/// Its process is as follows:
///
/// - Convert the implemented struct's name to snake case to create the function
/// name
/// - Obtain the return type from the `Returns` type in `BasicUdf`
/// - Create functions `fn_name`, `fn_name_init`, and `fn_name_deinit` with
/// correct signatures and interfaces
/// - If applied on an `impl AggregateUdf` block, create `fn_name_clear` and
/// `fn_name_add`. `fn_name_remove` is also included if it is redefined
// Arguments don't yet work
//
// # Arguments
//
// - `#[udf::register(name = "new_name")]` will specify a name for your SQL
// function. If this is not specified, your struct name will be converted to
// snake case and used (e.g. `AddAllNumbers` would become `add_all_numbers`
// by default).
// #[cfg(not(test))] // Work around for rust-lang/rust#62127