pub enum FunctionOption<X: Extension = NoExt> {
Language {
name: LanguageName,
meta: Meta,
},
As {
body: FunctionBody<X>,
meta: Meta,
},
NullBehavior {
behavior: FunctionNullBehavior,
meta: Meta,
},
Deterministic {
not: bool,
meta: Meta,
},
DataAccess {
access: SqlDataAccess,
meta: Meta,
},
SqlSecurity {
context: SqlSecurityContext,
meta: Meta,
},
Comment {
comment: Literal,
meta: Meta,
},
}Expand description
The SQL function option forms represented by the AST.
Variants§
Language
A LANGUAGE <name> clause naming the routine’s implementation language. The name is a
NonReservedWord_or_Sconst (LanguageName) — a bare word or, on the PostgreSQL
surface, an Sconst string (LANGUAGE 'sql'/E'sql'/$$sql$$) — shared with the
DoArg::Language argument.
Fields
name: LanguageNameName referenced by this syntax.
As
AS <body> — the string routine body, carried on the FunctionBody axis. The AS
option only ever homes an opaque source string (plain '…' or dollar-quoted
$tag$…$tag$), i.e. FunctionBody::Definition; the live RETURN <expr> body rides
the trailing CreateFunction::body slot, a disjoint grammatical position.
Fields
body: FunctionBody<X>The routine’s string body; see FunctionBody.
NullBehavior
The null-call behaviour (CALLED ON NULL INPUT / RETURNS NULL ON NULL INPUT
/ STRICT).
Fields
behavior: FunctionNullBehaviorThe null-input behaviour; see FunctionNullBehavior.
Deterministic
The MySQL [NOT] DETERMINISTIC routine characteristic — whether the routine
always produces the same result for the same inputs. The not field records the negated
spelling so NOT DETERMINISTIC round-trips distinctly from a
routine that simply omits the characteristic. A stored-routine option (MySQL SQL/PSM),
not a PostgreSQL CREATE FUNCTION clause.
Fields
DataAccess
The MySQL SQL-data-access routine characteristic (CONTAINS SQL / NO SQL /
READS SQL DATA / MODIFIES SQL DATA) — the advisory declaration of how the
routine body touches data.
Fields
access: SqlDataAccessWhich data-access class was written; see SqlDataAccess.
SqlSecurity
The MySQL SQL SECURITY {DEFINER | INVOKER} routine characteristic — the privilege
context the routine executes under.
Fields
context: SqlSecurityContextThe security context; see SqlSecurityContext.
Comment
The MySQL COMMENT '<string>' routine characteristic — a stored descriptive comment.
The PostgreSQL comment surface is the separate COMMENT ON FUNCTION statement, so
this inline option is MySQL-only.
Trait Implementations§
Source§impl<X: Clone + Extension> Clone for FunctionOption<X>
impl<X: Clone + Extension> Clone for FunctionOption<X>
Source§fn clone(&self) -> FunctionOption<X>
fn clone(&self) -> FunctionOption<X>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'de, X> Deserialize<'de> for FunctionOption<X>where
X: Deserialize<'de> + Extension,
impl<'de, X> Deserialize<'de> for FunctionOption<X>where
X: Deserialize<'de> + Extension,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl<X: Eq + Extension> Eq for FunctionOption<X>
Source§impl<X: Extension + Render> Render for FunctionOption<X>
impl<X: Extension + Render> Render for FunctionOption<X>
Source§fn render(&self, ctx: &RenderCtx<'_>, f: &mut Formatter<'_>) -> Result
fn render(&self, ctx: &RenderCtx<'_>, f: &mut Formatter<'_>) -> Result
Source§fn operand_binding_power(&self) -> Option<BindingPower>
fn operand_binding_power(&self) -> Option<BindingPower>
None (the default) for a self-delimiting node — an atom, call, or
constructor — that never needs parentheses. Read moreSource§impl<X> Serialize for FunctionOption<X>
impl<X> Serialize for FunctionOption<X>
Source§impl<X: Extension> Spanned for FunctionOption<X>
impl<X: Extension> Spanned for FunctionOption<X>
impl<X: PartialEq + Extension> StructuralPartialEq for FunctionOption<X>
Auto Trait Implementations§
impl<X> Freeze for FunctionOption<X>
impl<X> RefUnwindSafe for FunctionOption<X>where
X: RefUnwindSafe,
impl<X> Send for FunctionOption<X>where
X: Send,
impl<X> Sync for FunctionOption<X>where
X: Sync,
impl<X> Unpin for FunctionOption<X>
impl<X> UnsafeUnpin for FunctionOption<X>
impl<X> UnwindSafe for FunctionOption<X>where
X: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> DynAstExt for T
impl<T> DynAstExt for T
Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&dyn Any for downcasting a node back to its concrete type.Source§fn dyn_clone(&self) -> Box<dyn DynAstExt>
fn dyn_clone(&self) -> Box<dyn DynAstExt>
Clone (whose
Self-returning signature cannot go through a vtable).Source§fn dyn_eq(&self, other: &dyn DynAstExt) -> bool
fn dyn_eq(&self, other: &dyn DynAstExt) -> bool
PartialEq (whose &Self argument cannot go through a vtable). Equal
iff other holds the same concrete type and that type deems the values
equal; differently-typed nodes are never equal.