Constructs a definition for a built-in function out of a static SQL expression. The SQL expression should use the standard parameter syntax (`$1`, `$2`, ...) to refer to the inputs to the function. For example, a built-in function that takes two arguments and concatenates them with an arrow in between could be defined like so: sql_impl_func("$1 || '<->' || $2") The number of parameters in the S
(expr: &str)
| 414 | // of parameters in the built-in's declaration. There is no support for variadic |
| 415 | // functions. |
| 416 | fn sql_impl_func(expr: &str) -> Operation<HirScalarExpr> { |
| 417 | let invoke = sql_impl(expr); |
| 418 | Operation::variadic(move |ecx, args| { |
| 419 | let types = args.iter().map(|arg| ecx.scalar_type(arg)).collect(); |
| 420 | let mut out = invoke(ecx, types)?; |
| 421 | out.splice_parameters(&args, 0); |
| 422 | Ok(out) |
| 423 | }) |
| 424 | } |
| 425 | |
| 426 | // Defines a built-in table function from a static SQL SELECT statement. |
| 427 | // |
nothing calls this directly
no test coverage detected