#[non_exhaustive]pub enum Dialect {
Snowflake,
Databricks,
}Expand description
The SQL dialect a lex/parse/format request targets.
#[non_exhaustive] so further dialects can be added without it being a breaking change. Default
is Dialect::Snowflake.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Snowflake
Snowflake SQL — the original and default dialect of this toolchain.
Databricks
Databricks SQL / Spark SQL. Behavior is being filled in across later phases; today its predicate answers describe the intended divergence but no Databricks-specific lexing, parsing, or formatting is wired up yet.
Implementations§
Source§impl Dialect
impl Dialect
Sourcepub fn supports_dollar_quoting(self) -> bool
pub fn supports_dollar_quoting(self) -> bool
Dollar quoting: $$ ... $$ dollar-quoted bodies and $1 / $name positional/variable
references. Snowflake only — Databricks has no $$ body or $n reference.
Sourcepub fn supports_flow_operator(self) -> bool
pub fn supports_flow_operator(self) -> bool
The flow operator ->> chaining statements into a pipeline. Snowflake only.
Sourcepub fn supports_copy_into(self) -> bool
pub fn supports_copy_into(self) -> bool
COPY INTO <target> FROM <source> bulk load/unload. Snowflake only.
Sourcepub fn supports_double_slash_comments(self) -> bool
pub fn supports_double_slash_comments(self) -> bool
// ... line comments. Snowflake accepts them; Databricks/Spark uses / as an operator
and must not have a doubled slash consume the rest of the physical line.
Sourcepub fn supports_semantic_view(self) -> bool
pub fn supports_semantic_view(self) -> bool
CREATE SEMANTIC VIEW ... semantic-layer DDL. Snowflake only.
Sourcepub fn supports_scripting_blocks(self) -> bool
pub fn supports_scripting_blocks(self) -> bool
SQL scripting blocks: BEGIN ... END, declarations, control-flow statements, and the :=
assignment operator. Snowflake and Databricks both support compound SQL blocks.
Sourcepub fn supports_stage_refs(self) -> bool
pub fn supports_stage_refs(self) -> bool
Stage references: @stage / @~ / @%table paths in FROM, COPY, and PUT/GET.
Snowflake only.
Sourcepub fn supports_backtick_identifiers(self) -> bool
pub fn supports_backtick_identifiers(self) -> bool
Backtick-quoted identifiers: `col`. Databricks only (Snowflake quotes with ").
Sourcepub fn supports_prefixed_strings(self) -> bool
pub fn supports_prefixed_strings(self) -> bool
Databricks/Spark prefixed string literals such as raw strings (r'...') and hex binary
literals (X'1A').
Sourcepub fn supports_null_safe_eq(self) -> bool
pub fn supports_null_safe_eq(self) -> bool
Databricks/Spark null-safe equality operator: <=>.
Sourcepub fn supports_lateral_view(self) -> bool
pub fn supports_lateral_view(self) -> bool
LATERAL VIEW explode(...) table-generating clause. Databricks only.
Sourcepub fn supports_delta_table_options(self) -> bool
pub fn supports_delta_table_options(self) -> bool
Delta/Spark table DDL options: USING, LOCATION, TBLPROPERTIES, OPTIONS, and
PARTITIONED BY. Databricks only.
Sourcepub fn supports_lambda_expr(self) -> bool
pub fn supports_lambda_expr(self) -> bool
Higher-order-function lambdas: x -> expr and (x, y) -> expr. Databricks only for now.
Sourcepub fn supports_as_of_travel(self) -> bool
pub fn supports_as_of_travel(self) -> bool
Time travel via VERSION AS OF / TIMESTAMP AS OF. Databricks only (Snowflake uses
AT / BEFORE).
Sourcepub fn supports_databricks_query_clauses(self) -> bool
pub fn supports_databricks_query_clauses(self) -> bool
Databricks/Spark query distribution clauses: DISTRIBUTE BY, SORT BY, and CLUSTER BY.
Sourcepub fn supports_delta_commands(self) -> bool
pub fn supports_delta_commands(self) -> bool
Delta/Spark maintenance + cache statements — VACUUM, OPTIMIZE … ZORDER BY,
INSERT OVERWRITE, CACHE/UNCACHE/REFRESH, DESCRIBE HISTORY, and the
WHEN NOT MATCHED BY SOURCE/INSERT * MERGE extensions. Databricks only. The leading words
(VACUUM, OPTIMIZE, CACHE, …) are recognized contextually at statement start, so they
stay ordinary identifiers under Snowflake (and elsewhere under Databricks), and Snowflake
output is byte-identical.
Trait Implementations§
impl Copy for Dialect
impl Eq for Dialect
impl StructuralPartialEq for Dialect
Auto Trait Implementations§
impl Freeze for Dialect
impl RefUnwindSafe for Dialect
impl Send for Dialect
impl Sync for Dialect
impl Unpin for Dialect
impl UnsafeUnpin for Dialect
impl UnwindSafe for Dialect
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> HashEqLike<&T> for T
impl<T> HashEqLike<&T> for T
Source§impl<T> HashEqLike<Cow<'_, T>> for T
impl<T> HashEqLike<Cow<'_, T>> for T
Source§impl<T> HashEqLike<T> for T
impl<T> HashEqLike<T> for T
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more