pub struct FunctionDef {
pub names: Vec<Cow<'static, str>>,
pub kind: FunctionKind,
pub min_args: usize,
pub max_args: Option<usize>,
pub param_types: Option<Vec<Option<DataType>>>,
pub return_type: Option<DataType>,
pub supports_distinct: bool,
pub supports_order_by: bool,
pub allows_star: bool,
pub dialects: Vec<Dialect>,
}Expand description
Metadata for a SQL function.
Fields§
§names: Vec<Cow<'static, str>>All accepted names (first is the canonical name).
kind: FunctionKindThe category of the function.
min_args: usizeMinimum number of arguments (inclusive).
max_args: Option<usize>Maximum number of arguments (None = unlimited).
param_types: Option<Vec<Option<DataType>>>Expected parameter types for type-checking (None = skip check).
return_type: Option<DataType>Return type for type inference (None = unknown).
supports_distinct: boolWhether DISTINCT is allowed (e.g. COUNT(DISTINCT col)).
supports_order_by: boolWhether an ORDER BY child clause is allowed.
allows_star: boolWhether * is accepted as an argument (e.g. COUNT(*)).
dialects: Vec<Dialect>Dialects this function is available in. Empty = all dialects.
Implementations§
Source§impl FunctionDef
impl FunctionDef
Sourcepub fn canonical_name(&self) -> &str
pub fn canonical_name(&self) -> &str
Returns the canonical (first) name.
Sourcepub fn accepts_name(&self, name: &str) -> bool
pub fn accepts_name(&self, name: &str) -> bool
Returns true if name matches the canonical name or any alias.
Sourcepub fn supports_dialect(&self, dialect: Dialect) -> bool
pub fn supports_dialect(&self, dialect: Dialect) -> bool
Returns true if this function is available for the given dialect.
Trait Implementations§
Source§impl Clone for FunctionDef
impl Clone for FunctionDef
Source§fn clone(&self) -> FunctionDef
fn clone(&self) -> FunctionDef
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for FunctionDef
impl RefUnwindSafe for FunctionDef
impl Send for FunctionDef
impl Sync for FunctionDef
impl Unpin for FunctionDef
impl UnsafeUnpin for FunctionDef
impl UnwindSafe for FunctionDef
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request