#[admin_fn]
Expand description
Attribute macro to convert a normal function to SQL administration function. The annotated function should accept:
&ProcedureServiceHandlerRef
or&TableMutationHandlerRef
orFlowServiceHandlerRef
as the first argument,&QueryContextRef
as the second argument, and&[ValueRef<'_>]
as the third argument which is SQL function input values in each row.
Return type must be common_query::error::Result<Value>
.
§Example see common/function/src/system/procedure_state.rs
.
§Arguments
name
: The name of the generatedFunction
implementation.ret
: The return type of the generated SQL function, it will be transformed intoConcreteDataType::{ret}_datatype()
result.display_name
: The display name of the generated SQL function.sig_fn
: the function to returnsSignature
of generatedFunction
.
Note that this macro should only be used in common-function
crate for now