pub struct UdfCfg<S: UdfState>(/* private fields */);
Expand description
A collection of SQL arguments
This is rusty wrapper around SQL’s UDF_INIT
struct, providing methods to
easily and safely work with arguments.
Implementations§
source§impl<S: UdfState> UdfCfg<S>
impl<S: UdfState> UdfCfg<S>
sourcepub fn get_maybe_null(&self) -> bool
pub fn get_maybe_null(&self) -> bool
Retrieve the setting for whether this UDF may return null
This defaults to true if any argument is nullable, false otherwise
sourcepub fn get_decimals(&self) -> u32
pub fn get_decimals(&self) -> u32
Retrieve the setting for number of decimal places
This defaults to the longest number of digits of any argument, or 31 if there is no fixed number
sourcepub fn set_decimals(&self, v: u32)
pub fn set_decimals(&self, v: u32)
Set the number of decimals this function returns
This can be changed at any point in the UDF (init or process)
sourcepub fn get_max_len(&self) -> u64
pub fn get_max_len(&self) -> u64
Retrieve the current maximum length setting for this in-progress UDF
sourcepub fn get_is_const(&self) -> bool
pub fn get_is_const(&self) -> bool
Get the current const_item
value
source§impl UdfCfg<Init>
impl UdfCfg<Init>
Implementations of actions on a UdfCfg
that are only possible during
initialization
sourcepub fn set_maybe_null(&self, v: bool)
pub fn set_maybe_null(&self, v: bool)
Set whether or not this function may return null
sourcepub fn set_max_len(&self, v: u64)
pub fn set_max_len(&self, v: u64)
Set the maximum possible length of this UDF’s result
This is mostly relevant for String and Decimal return types. See
MaxLenOptions
for possible defaults, including BLOB
sizes.
sourcepub fn set_is_const(&self, v: bool)
pub fn set_is_const(&self, v: bool)
Set a new const_item
value
Set this to true if your function always returns the same values with the same arguments