SqlFunction

Trait SqlFunction 

Source
pub trait SqlFunction: Send + Sync {
    // Required methods
    fn signature(&self) -> FunctionSignature;
    fn evaluate(&self, args: &[DataValue]) -> Result<DataValue>;

    // Provided method
    fn validate_args(&self, args: &[DataValue]) -> Result<()> { ... }
}
Expand description

Trait that all SQL functions must implement

Required Methods§

Source

fn signature(&self) -> FunctionSignature

Get the function’s signature and metadata

Source

fn evaluate(&self, args: &[DataValue]) -> Result<DataValue>

Evaluate the function with the given arguments

Provided Methods§

Source

fn validate_args(&self, args: &[DataValue]) -> Result<()>

Validate arguments before evaluation (default implementation checks count)

Implementors§