pub enum DialectRef {
BuiltIn(Dialect),
Custom(String),
}Expand description
A reference to either a built-in Dialect or a custom dialect
registered via the plugin system.
This is the primary handle that plugin-aware API functions accept.
§Example
use sqlglot_rust::dialects::plugin::DialectRef;
use sqlglot_rust::Dialect;
let builtin = DialectRef::from(Dialect::Postgres);
let custom = DialectRef::custom("mydialect");Variants§
BuiltIn(Dialect)
A built-in dialect variant.
Custom(String)
A custom dialect identified by its registered name.
Implementations§
Source§impl DialectRef
impl DialectRef
Sourcepub fn as_builtin(&self) -> Option<Dialect>
pub fn as_builtin(&self) -> Option<Dialect>
Try to resolve this reference to a built-in dialect.
Sourcepub fn as_plugin(&self) -> Option<Arc<dyn DialectPlugin>>
pub fn as_plugin(&self) -> Option<Arc<dyn DialectPlugin>>
Try to resolve this reference to a custom plugin.
Sourcepub fn quote_style(&self) -> QuoteStyle
pub fn quote_style(&self) -> QuoteStyle
Get the quote style for this dialect reference.
Sourcepub fn supports_ilike(&self) -> bool
pub fn supports_ilike(&self) -> bool
Check if this dialect supports ILIKE natively.
Sourcepub fn map_function_name(&self, name: &str) -> String
pub fn map_function_name(&self, name: &str) -> String
Map a function name using this dialect’s rules.
Sourcepub fn map_data_type(&self, dt: &DataType) -> DataType
pub fn map_data_type(&self, dt: &DataType) -> DataType
Map a data type using this dialect’s rules.
Trait Implementations§
Source§impl Clone for DialectRef
impl Clone for DialectRef
Source§fn clone(&self) -> DialectRef
fn clone(&self) -> DialectRef
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DialectRef
impl Debug for DialectRef
Source§impl Display for DialectRef
impl Display for DialectRef
Source§impl From<Dialect> for DialectRef
impl From<Dialect> for DialectRef
Source§impl Hash for DialectRef
impl Hash for DialectRef
Source§impl PartialEq for DialectRef
impl PartialEq for DialectRef
impl Eq for DialectRef
impl StructuralPartialEq for DialectRef
Auto Trait Implementations§
impl Freeze for DialectRef
impl RefUnwindSafe for DialectRef
impl Send for DialectRef
impl Sync for DialectRef
impl Unpin for DialectRef
impl UnsafeUnpin for DialectRef
impl UnwindSafe for DialectRef
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