fnck_sql

Macro scala_function

Source
macro_rules! scala_function {
    ($struct_name:ident::$function_name:ident($($arg_ty:expr),*) -> $return_ty:expr => $closure:expr) => { ... };
}
Expand description

ยงExamples

scala_function!(MyFunction::sum(LogicalType::Integer, LogicalType::Integer) -> LogicalType::Integer => |v1: DataValue, v2: DataValue| {
    DataValue::binary_op(&v1, &v2, &BinaryOperator::Plus)
});

let fnck_sql = DataBaseBuilder::path("./example")
    .register_scala_function(TestFunction::new())
    .build()
    ?;