#[non_exhaustive]pub enum ProcedureForm {
PlPgSql,
MySql,
TSql,
SnowflakeScripting,
Databricks,
ClickHouse,
GoogleSql,
Agnostic,
Custom(&'static str),
Unsupported(&'static str),
}Expand description
Which stored-procedure grammar this engine speaks.
The default is ProcedureForm::Agnostic, Razeri’s own annotated form. It
parses nowhere: it is the honest answer for a dialect that has not said, and
the conformance kit reports it as an unanswered obligation.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
PlPgSql
PL/pgSQL — a dollar-quoted body with DECLARE, SELECT … INTO,
RAISE, IF and an EXCEPTION block. PostgreSQL, Citus and
Redshift, all three measured deploying and running.
MySql
MySQL/MariaDB’s compound statement — the same block structure with
DELIMITER-free BEGIN … END and no dollar quoting.
TSql
T-SQL — CREATE PROCEDURE … AS BEGIN … END, @-prefixed parameters.
SnowflakeScripting
Snowflake Scripting.
Databricks
Databricks SQL scripting.
ClickHouse
ClickHouse.
GoogleSql
GoogleSQL scripting — BigQuery’s, whose body is not quoted at all.
Agnostic
Razeri’s agnostic annotated form: ANSI SQL carrying @razeri: headers.
It is a design artifact, not something an engine parses.
Custom(&'static str)
This engine has stored procedures and spells them in a grammar Razeri
does not carry. The string is the grammar’s own name — "PL/SQL",
"Teradata SPL" — and it is what a reader of a report or a rendered
comment sees.
Answering this moves the rendering to your dialect and moves nothing
else: Razeri neither substitutes a near neighbour nor refuses, and every
question it would have answered from a named grammar it asks your
dialect instead. The method it asks is
SqlRenderer::render_procedure,
and a dialect that answers Custom without overriding it has
promised a rendering it does not provide — the conformance kit
reports that as blocking, and the rendered SQL says the same thing in a
comment where the procedure would have been.
Unsupported(&'static str)
This engine has no stored procedures. The string is the orientation
an author reads instead of a syntax error — say what this engine offers
in their place (DuckDB’s macros, SQLite’s application-level logic),
because the sentence that helps is the one about this engine.
Not the answer for a grammar Razeri cannot spell — that is
Custom, and the difference is the difference between a
fact about the engine and a fact about Razeri.
Implementations§
Source§impl ProcedureForm
impl ProcedureForm
Sourcepub const fn refusal(self) -> Option<&'static str>
pub const fn refusal(self) -> Option<&'static str>
The dialect’s own refusal wording, or None where this engine has
stored procedures.
Sourcepub const fn custom_grammar(self) -> Option<&'static str>
pub const fn custom_grammar(self) -> Option<&'static str>
The name of the grammar this dialect renders itself, or None where
Razeri renders the procedure.
The one accessor every surface reads — the renderer that delegates, the conformance kit that checks the dialect kept its promise, and any report that names the grammar — so none of them carries a second reading of the variant.
Trait Implementations§
Source§impl Clone for ProcedureForm
impl Clone for ProcedureForm
Source§fn clone(&self) -> ProcedureForm
fn clone(&self) -> ProcedureForm
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more