#[non_exhaustive]pub enum ScalarFunctionForm {
PostgreSql,
DuckDb,
TSql,
ClickHouse,
Snowflake,
MySql,
Databricks,
GoogleSql,
Redshift,
}Expand description
Which scalar-function grammar this engine speaks.
The default is ScalarFunctionForm::PostgreSql, which is what an
unlisted dialect has always been handed. It is a guess and a dangerous one
on a near neighbour: LANGUAGE SQL IMMUTABLE PARALLEL SAFE is a “syntax
error at or near PARALLEL” on Redshift, an engine that descends from
PostgreSQL and reports itself as one. State your form.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
PostgreSql
CREATE FUNCTION … RETURNS … LANGUAGE SQL IMMUTABLE PARALLEL SAFE AS $$…$$ — PostgreSQL, Citus and Razeri’s agnostic renderer.
DuckDb
DuckDB’s CREATE MACRO.
TSql
T-SQL’s scalar UDF.
ClickHouse
ClickHouse’s lambda CREATE FUNCTION … AS (x) -> ….
Snowflake
Snowflake’s UDF.
MySql
MySQL/MariaDB’s CREATE FUNCTION … DETERMINISTIC.
Databricks
Databricks SQL’s UDF.
GoogleSql
GoogleSQL’s CREATE FUNCTION — BigQuery’s.
Redshift
Redshift’s: the volatility is mandatory rather than optional, there is
no PARALLEL SAFE, LANGUAGE follows the body rather than preceding
it, and the body addresses its parameters as $1 and never by name.
Trait Implementations§
Source§impl Clone for ScalarFunctionForm
impl Clone for ScalarFunctionForm
Source§fn clone(&self) -> ScalarFunctionForm
fn clone(&self) -> ScalarFunctionForm
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more