Skip to main content

AnsiDialect

Struct AnsiDialect 

Source
pub struct AnsiDialect;
Expand description

Zero-config SqlRenderer for the Agnostic pseudo-platform.

Uses ANSI SQL type names and double-quote identifier quoting. Intended for parameterless to_sql() / to_ddl() convenience methods that need a default renderer.

Trait Implementations§

Source§

impl DdlRenderer for AnsiDialect

Source§

fn render_create_table_prefix(&self) -> &'static str

Prefix for CREATE TABLE statements.
Source§

fn column_default_precedes_not_null(&self) -> bool

Whether a column’s DEFAULT is written before its NOT NULL. Read more
Source§

fn supports_foreign_key_action(&self, action: ReferentialAction) -> bool

Whether this engine carries the given foreign-key referential action (ON DELETE … / ON UPDATE …) in CREATE TABLE DDL. Read more
Source§

fn render_create_view_prefix(&self) -> &'static str

Prefix for CREATE VIEW statements.
Source§

fn replaces_a_view_that_is_read(&self) -> bool

Whether CREATE OR REPLACE VIEW replaces a view that other objects read. Read more
Source§

fn render_view_replacement(&self, replacement: &ViewReplacement<'_>) -> String

The statements that make a view other objects read, on an engine that answers false to replaces_a_view_that_is_read. Read more
Source§

fn render_column_definition( &self, name: &str, dt: &DataType, nullable: bool, ) -> String

Render a column definition (name, type, nullability).
Source§

fn render_column_evolution( &self, change: &ColumnEvolution<'_>, ) -> Option<String>

The statement this engine takes for one change to a table that already holds rows, or None where it has none. Read more
Source§

fn render_identity_column(&self, name: &str, data_type: &DataType) -> String

Render the surrogate identity column — a plain, ungenerated NOT NULL column of the type it is given, on every dialect. Read more
Source§

fn generates_identity_values(&self) -> bool

Whether this platform’s engine actually assigns an identity column’s value, rather than merely tolerating the declaration. Read more
Source§

fn representable_timestamp_ceiling( &self, data_type: &DataType, ) -> Option<&'static str>

The latest instant this platform can hold EXACTLY in the column it renders for data_type — the ceiling the refuse-by-name rule compares against, or None for no declared ceiling. Read more
Source§

fn auto_increment_requires_key(&self) -> bool

Whether the platform requires every auto-increment / identity column to be the leading column of an index (PK or KEY). Read more
Source§

fn render_drop_table_prefix(&self, if_exists: bool) -> String

Prefix for DROP TABLE statements.
Source§

fn render_drop_view_prefix(&self, if_exists: bool) -> String

Prefix for DROP VIEW statements.
Source§

fn render_create_schema_prefix(&self, if_not_exists: bool) -> String

Prefix for CREATE SCHEMA / CREATE NAMESPACE.
Source§

fn render_create_schema_statement( &self, name: &str, if_not_exists: bool, ) -> String

Render a complete CREATE SCHEMA statement. Read more
Source§

fn render_table_comment(&self, table: &str, comment: &str) -> Option<String>

Render a table comment (platform-specific syntax). Read more
Source§

fn render_column_comment( &self, table: &str, column: &str, comment: &str, ) -> Option<String>

Render a column comment — not wired to anything, and measured. Read more
Source§

fn supports_if_not_exists(&self) -> bool

Whether to render IF NOT EXISTS on CREATE TABLE.
Source§

fn render_column_default(&self, value: &str) -> Option<String>

Render a column’s DEFAULT clause — keyword included — or decline it. Read more
Source§

fn render_declared_column_default( &self, value: &str, column_type: &DataType, ) -> String

Spell an author’s OWN declared default in this engine’s words. Read more
Source§

fn render_begin_transaction(&self) -> &'static str

Render a BEGIN transaction statement. Read more
Source§

fn render_commit(&self) -> &'static str

Render a COMMIT transaction statement.
Source§

fn supports_ddl_transactions(&self) -> bool

Whether the platform supports DDL transactions.
Source§

fn render_drop_function( &self, name: &str, param_types: &[&str], if_exists: bool, ) -> String

Render a DROP FUNCTION statement with optional parameter types for overloaded functions.
Source§

fn render_drop_object_keyword(&self, obj_type: &str) -> String

Render the drop keyword for a SQL object type.
Source§

fn render_create_view_keyword(&self, secure: bool, global_temp: bool) -> String

Render the CREATE VIEW keyword/prefix with secure/global_temp modifiers.
Source§

fn supports_alter_drop_if_exists(&self) -> bool

Whether ALTER TABLE … DROP COLUMN IF EXISTS is part of the grammar. Read more
Source§

fn render_drop_column( &self, table: WrittenObject<'_>, column: &str, only_where_it_stands: bool, ) -> Option<Written>

The statement that drops one column of a table that holds rows. Read more
Source§

fn render_drop_view( &self, view: WrittenObject<'_>, only_where_it_stands: bool, ) -> Option<Written>

The statement that drops one of Razeri’s views, spelled as the statement writes it. Read more
Source§

fn render_create_table_if_absent( &self, table: WrittenObject<'_>, create: &str, ) -> Option<Written>

A CREATE TABLE that runs only where the table is not there yet, on an engine whose grammar has no CREATE TABLE IF NOT EXISTS. Read more
Source§

fn render_copy_table( &self, source: WrittenObject<'_>, copy: WrittenObject<'_>, ) -> Written

The statement that copies a table, every row it holds, into a new table beside it. Read more
Source§

fn render_table_storage_options( &self, settings: &[EngineSetting<'_>], ) -> Option<String>

The clause a table’s storage settings are written in, after its column list — SQL Server’s WITH (DATA_COMPRESSION = PAGE) — or None where none of settings is this engine’s, which is the default. Read more
Source§

fn drop_index_uses_on_syntax(&self) -> bool

Whether DROP INDEX uses ON syntax: DROP INDEX idx ON table (SqlServer).
Source§

fn constraint_enforcement(&self) -> ConstraintEnforcement

Whether this engine checks the constraints it accepts. Read more
Source§

fn key_constraint_suffix(&self) -> &'static str

The words a key constraint must carry to be accepted at all. Read more
Source§

fn supports_primary_key_constraint(&self) -> bool

Whether a PRIMARY KEY is part of the grammar. Read more
Source§

fn supports_foreign_key_constraint(&self) -> bool

Whether a FOREIGN KEY … REFERENCES is part of the grammar. Read more
Source§

fn supports_unique_constraint(&self) -> bool

Whether a table-level UNIQUE (…) constraint is part of the grammar. Read more
Source§

fn supports_check_constraint(&self) -> bool

Whether a table-level CHECK (…) constraint is part of the grammar. Read more
Source§

fn supports_cascade_drop(&self) -> bool

Whether the platform supports CASCADE/RESTRICT in DROP statements. Read more
Source§

fn supports_procedure_comment(&self) -> bool

Whether COMMENT ON PROCEDURE is part of the grammar. Read more
Source§

fn supports_drop_function_arg_types(&self) -> bool

Whether the platform supports function argument types in DROP FUNCTION. Read more
Source§

fn supports_sync_drop(&self) -> bool

Whether the platform supports SYNC option for DROP (ClickHouse).
Source§

fn supports_force_drop(&self) -> bool

Whether the platform supports FORCE option for DROP (Databricks).
Source§

fn supports_alter_drop_cascade(&self) -> bool

Whether the platform supports CASCADE in ALTER TABLE DROP. Read more
Source§

impl FormulaRenderer for AnsiDialect

Source§

fn render_string_agg( &self, expr: &str, sep: &str, distinct: bool, order: Option<&str>, ) -> String

Render STRING_AGG / LISTAGG style aggregation.
Source§

fn render_concat_ws(&self, separator: &str, parts: &[&str]) -> String

Render CONCAT_WS.
Source§

fn render_first_value(&self, expr: &str, ignore_nulls: bool) -> String

Render FIRST_VALUE with optional IGNORE NULLS.
Source§

fn render_stddev(&self, expr: &str, population: bool) -> String

Render STDDEV_POP / STDDEV_SAMP.
Source§

fn render_variance(&self, expr: &str, population: bool) -> String

Render VAR_POP / VAR_SAMP.
Source§

fn render_percentile( &self, expr: &str, percentile: f64, continuous: bool, ) -> String

Render PERCENTILE_CONT / PERCENTILE_DISC.
Source§

fn render_median(&self, expr: &str) -> String

Render MEDIAN.
Source§

fn render_count_if(&self, condition: &str) -> String

Render COUNT IF semantics.
Source§

fn render_sum_if(&self, expr: &str, condition: &str) -> String

Render SUM IF semantics.
Source§

fn render_avg_if(&self, expr: &str, condition: &str) -> String

Render AVG IF semantics.
Source§

fn render_split(&self, expr: &str, delimiter: &str) -> String

Render SPLIT / STRING_TO_ARRAY style expression.
Source§

fn render_regexp_like(&self, expr: &str, pattern: &str) -> String

Render REGEXP_LIKE / RLIKE.
Source§

fn render_regexp_replace( &self, expr: &str, pattern: &str, replacement: &str, ) -> String

Render REGEXP_REPLACE.
Source§

fn render_regexp_extract( &self, expr: &str, pattern: &str, group: Option<usize>, ) -> String

Render REGEXP_EXTRACT / REGEXP_SUBSTR.
Source§

fn supports_split(&self) -> bool

Whether this engine splits a text into a list, the way render_split writes it. Read more
Source§

fn supports_regexp_like(&self) -> bool

Whether this engine tests a text against a regular expression, the way render_regexp_like writes it. Read more
Source§

fn supports_regexp_extract(&self) -> bool

Whether this engine takes the part of a text a regular expression matches, the way render_regexp_extract writes it. Read more
Source§

fn supports_ordered_string_agg(&self) -> bool

Whether this engine orders the values a string aggregation joins, the ORDER BY inside render_string_agg. Read more
Source§

fn render_nvl2(&self, expr: &str, not_null: &str, is_null: &str) -> String

Render NVL2 semantics.
Source§

fn render_multi_if(&self, conditions: &[(&str, &str)], else_: &str) -> String

Render multi-branch IF semantics.
Source§

fn render_power_operator(&self) -> Option<String>

This engine’s exponentiation operator, or None where it has none. Read more
Source§

fn render_ilike_operator(&self) -> Option<String>

This engine’s case-insensitive LIKE, or None where it has none.
Source§

fn render_not_ilike_operator(&self) -> Option<String>

This engine’s negated case-insensitive LIKE, or None where it has none.
Source§

fn render_concat_operator(&self) -> Option<String>

This engine’s string concatenation operator, or None where it joins strings only through a function.
Source§

fn render_bitwise_xor_operator(&self) -> String

👎Deprecated since 0.14.0:

answer render_bitwise_operator(BitwiseOperator::Xor) instead, which can say the engine has none

Render the bitwise XOR operator.
Source§

fn render_bitwise_operator(&self, operator: BitwiseOperator) -> Option<String>

This engine’s spelling of one bitwise operator, or None where it has no such operator. Read more
Source§

fn render_try_cast_str(&self, expr: &str, type_str: &str) -> String

Render TRY_CAST expression (takes pre-rendered type string).
Source§

fn render_convert( &self, expr: &str, type_str: &str, style: Option<i32>, ) -> String

Render CONVERT expression with optional style.
Source§

fn render_safe_cast(&self, expr: &str, type_str: &str) -> String

Render SAFE_CAST expression.
Source§

fn render_if_null(&self, expr: &str, replacement: &str) -> String

Render IFNULL / ISNULL / COALESCE expression.
Source§

fn render_named_param(&self, name: &str) -> String

Render a named parameter reference.
Source§

fn render_positional_param(&self, pos: usize) -> String

Render a positional parameter reference.
Source§

fn render_data_type_ref(&self, dt: &DataTypeRef) -> String

Render a DataTypeRef as a SQL type name string. Read more
Source§

impl ReplicationRenderer for AnsiDialect

Source§

fn session_prerequisites(&self) -> Vec<String>

Statements every generated script runs before its first real statement, in this order, in the same session. Read more
Source§

fn session_prerequisites_for(&self, computes_key: bool) -> Vec<String>

The session’s settings for one design, which may need fewer than Self::session_prerequisites names. Read more
Source§

fn sid_external_artifact(&self) -> Option<SidExternalArtifact>

Does an external artifact already carry the name generate_sid on this platform, and what is it? Read more
Source§

fn sid_library_source(&self) -> Option<SidLibrarySource>

The source of a library the operator compiles, where the key function arrives that way — shipped in the deploy bundle as a file of its own, so the build is one line. Read more
Source§

fn sid_prerequisites(&self) -> String

Returns prerequisite SQL/instructions for SID deployment. Read more
Source§

fn sid_prerequisite_statements(&self) -> Vec<String>

The executable statements inside Self::sid_prerequisites, in order — razeri’s own text, split on razeri’s own declared boundary. Read more
Source§

fn sid_pure_sql_fallback(&self) -> Option<String>

A prerequisite script that installs the same key function without compiling anything — where the platform has one, and None where it does not. Read more
Source§

fn sid_pure_sql_fallback_in(&self, schemas: &[&str]) -> Option<String>

Self::sid_pure_sql_fallback, installed in every schema a design writes into. Read more
Source§

fn sid_prerequisite_kind(&self) -> SidPrerequisiteKind

Which of SidPrerequisiteKind’s shapes this platform’s prerequisite is. Read more
Source§

fn sid_prerequisite_home(&self) -> SidPrerequisiteHome

Where Self::sid_prerequisites puts what it installs, so that a key function created in some other schema can call it by name. Read more
Source§

fn sid_validation_query(&self, schema: Option<&str>, null_sid: i64) -> String

Returns a validation query to verify the SID function is operational. Read more
Source§

fn render_data_extract( &self, qualified: &str, columns: &str, file_path: &str, format: &str, where_clause: &str, _batch_size: Option<usize>, ) -> String

Renders an extract/export SQL statement for the given table. Read more
Source§

fn render_data_load( &self, qualified: &str, file_path: &str, _format: &str, ) -> String

Renders a load/import SQL statement for the given table. Read more
Source§

fn render_checksum_query(&self, qualified: &str) -> String

Renders a checksum validation query for data comparison. Read more
Source§

fn parquet_export_warning(&self) -> Option<&str>

Warning about Parquet export limitations on this platform. Read more
Source§

fn sid_deployment_warning(&self) -> Option<&str>

Warning about SID function deployment requirements on this platform. Read more
Source§

fn replication_target_warnings(&self) -> Vec<String>

General replication caveats for this platform as a target. Read more
Source§

fn truncate_caveat(&self) -> Option<&str>

Warning about TRUNCATE behavior on this platform. Read more
Source§

impl SqlRenderer for AnsiDialect

Source§

fn sid_spelling(&self) -> SidSpelling

ANSI’s vocabulary on purpose, and named so — not the guess a dialect that has decided nothing inherits.

Source§

fn render_data_type(&self, dt: &DataType) -> String

Render a DataType as platform-specific SQL.
Source§

fn quote_identifier(&self, name: &str) -> String

Quote an identifier using platform conventions. Read more
Source§

fn qualify_name(&self, schema: Option<&str>, name: &str) -> String

Render a fully qualified name (optional schema + name).
Source§

fn render_current_timestamp(&self) -> String

Render the platform’s CURRENT_TIMESTAMP expression.
Source§

fn is_agnostic_dialect(&self) -> bool

Whether this dialect is the “agnostic” pseudo-dialect. Read more
Source§

fn dialect_name(&self) -> &'static str

Return a stable string identifier for this dialect. Read more
Source§

fn to_formula_renderer(&self) -> Box<dyn FormulaRenderer>

Create a boxed FormulaRenderer for this dialect. Read more
Source§

fn render_parameter_data_type(&self, dt: &DataType) -> String

The type text for a routine’s PARAMETER, which is not always the text a column carries. Read more
Source§

fn render_nullable_data_type(&self, dt: &DataType) -> String

The type text for a column that ADMITS NULL — the whole type, not a modifier appended to one. Read more
Source§

fn render_comment(&self, text: &str) -> String

A comment, written as this engine reads one. Read more
Source§

fn uses_schema_in_qualified_names(&self) -> bool

Whether this dialect uses schemas in qualified names. Read more
Source§

fn fold_schema_into_name(&self, schema: &str, name: &str) -> Option<String>

The name an object takes on an engine with no schemas, where this dialect keeps a design’s layers apart by folding the schema into it — sales_raw and customers become sales_raw_customers — or None, the default, where the schema is dropped. Read more
Source§

fn supports_secure_view(&self) -> bool

Whether this dialect supports SECURE VIEW (Snowflake).
Source§

fn supports_global_temporary_view(&self) -> bool

Whether this dialect supports GLOBAL TEMPORARY VIEW (Databricks).
Source§

fn catalog_system_schemas(&self) -> &'static [&'static str]

The schemas a catalog scan passes over — the engine’s own bookkeeping, never a warehouse’s contents. Read more
Source§

fn render_catalog_columns_query(&self, schema: Option<&str>) -> Option<String>

The query that lists what the warehouse holds — one row per column, as (schema, object, column). Read more
Source§

fn render_catalog_object_times_query( &self, schema: Option<&str>, ) -> Option<String>

The query that says when each object was created, as (schema, object, created_at) — where the engine records it at all. Read more
Source§

fn catalog_scope_predicate(&self, column: &str, schema: Option<&str>) -> String

The WHERE clause both catalog queries share: one named schema, or every schema that is not the engine’s own. Read more
Source§

fn sid_helper_body(&self) -> Option<SidHelperBody>

The body of the surrogate-key helper, where SQL cannot spell it. Read more
Source§

fn delimited_file_relation(&self, path_literal: &str) -> Option<String>

How this engine reads a delimited text file as a relation, or None where it cannot. Read more
Source§

fn delimited_file_relation_for( &self, file: &DelimitedFile<'_>, ) -> Option<String>

How this engine reads a delimited text file as a relation, told everything Razeri knows about the file — or None where it cannot. Read more
Source§

fn parquet_file_relation(&self, path_literal: &str) -> Option<String>

How this engine reads a parquet file as a relation of text — or None where it cannot, which is the default. Read more
Source§

fn delimited_file_prerequisites(&self, directory_literal: &str) -> Vec<String>

Statements this engine needs run once before any of its file relations resolve, in order — and none by default. Read more
Source§

fn delimited_file_statements_for(&self, file: &DelimitedFile<'_>) -> Vec<String>

Statements this engine needs run before it can read THIS file, in order — and none by default. Read more
Source§

fn render_one_row_source(&self) -> Option<String>

The one-row table a query reads when it has nothing else to read, or None on an engine that takes a SELECT with no FROM at all. Read more
Source§

fn render_shared_relation(&self, name: &str, relation: &str) -> Option<String>

A view one statement reads in several places, read once: the item of the statement’s leading WITH that keeps relation’s rows under name, written name AS (…) — or None, the default, where each place the statement names the view reads it again. Read more
Source§

fn delimited_file_relation_in_encoding( &self, path_literal: &str, encoding: &str, ) -> Option<String>

How this engine reads a delimited text file whose bytes are not UTF-8, or None where it states no way to. Read more
Source§

fn render_cast_type(&self, dt: &DataType) -> String

The CAST target spelling for a DataType on this engine. Read more
Source§

fn procedure_form(&self) -> ProcedureForm

Which stored-procedure grammar this engine speaks. Read more
Source§

fn scalar_function_form(&self) -> ScalarFunctionForm

Which scalar-function grammar this engine speaks. Read more
Source§

fn bulk_load_form(&self) -> Option<BulkLoadForm>

Which of Razeri’s bulk-load grammars this engine speaks, or None where it speaks none of them. Read more
Source§

fn render_view_options(&self, settings: &[EngineSetting<'_>]) -> Option<String>

The clause a view’s settings are written in, between its name and AS — PostgreSQL’s WITH (security_barrier = true) — or None where none of settings is this engine’s, which is the default. Read more
Source§

fn render_join_options(&self, settings: &[EngineSetting<'_>]) -> Option<String>

The words a join’s settings are written in, in front of its join keyword — ClickHouse’s GLOBAL ANY — or None where none of settings is this engine’s, which is the default.
Source§

fn table_function_form(&self) -> TableFunctionForm

Which table-valued-function grammar this engine speaks, and — where it has none — the words it refuses in. Read more
Source§

fn render_procedure(&self, routine: &RoutineSpec) -> Option<String>

Spell a whole stored procedure in this engine’s own grammar — the method ProcedureForm::Custom promises. Read more
Source§

fn render_scalar_function(&self, routine: &RoutineSpec) -> Option<String>

Spell a whole scalar function in this engine’s own grammar — the method ScalarFunctionForm::Custom promises. Read more
Source§

fn render_table_function(&self, routine: &RoutineSpec) -> Option<String>

Spell a whole table-valued function in this engine’s own grammar — the method TableFunctionForm::Custom promises. Read more
Source§

fn render_current_date(&self) -> String

Platform’s CURRENT_DATE expression. Read more
Source§

fn render_boolean_literal(&self, value: bool) -> String

Render a boolean literal. Read more
Source§

fn render_single_row_aggregate( &self, expression: &str, kind: AggregableKind, ) -> Option<String>

Collapse a subquery that selects AT MOST ONE ROW into an aggregate, for the engines that will not accept an unaggregated correlated scalar. Read more
Source§

fn render_any_value(&self, expression: &str) -> String

Take any one value of expression from a group, for the engines that cannot group on the column itself. Read more
Source§

fn median_aggregate_form(&self) -> Option<&'static str>

The AGGREGATE median this engine has for expression, or None when it has none. Read more
Source§

fn render_date_literal(&self, date: &str) -> String

Render a date literal. Read more
Source§

fn render_timestamp_literal(&self, ts: &str) -> String

Render a timestamp literal. Read more
Source§

fn render_interval_literal(&self, interval: &str) -> String

Render an interval literal. Read more
Source§

fn concat_operator(&self) -> &'static str

Render the string concatenation operator. Read more
Source§

fn render_nan_literal(&self, _dt: &DataType) -> String

Render a NaN literal for a floating-point type. Read more
Source§

fn render_infinity_literal(&self, _positive: bool, _dt: &DataType) -> String

Render an infinity literal for a floating-point type. Read more
Source§

fn ifnull_function_name(&self) -> &'static str

Render the NULL-coalescing function name. Read more
Source§

fn render_iif(&self, cond: &str, then_val: &str, else_val: &str) -> String

Render an IIF expression (or CASE WHEN equivalent). Read more
Source§

fn render_date_trunc(&self, field: &str, expr: &str) -> String

Render a DATE_TRUNC expression. Read more
Source§

fn render_date_extract(&self, field: &str, column: &str) -> String

One part of a date or a timestamp, as a whole number. Read more
Source§

fn render_try_cast(&self, expr: &str, target: &DataType) -> String

Render a TRY_CAST expression. Read more
Source§

fn render_named_parameter(&self, name: &str) -> String

Render a named parameter placeholder. Read more
Source§

fn merge_not_matched_keyword(&self) -> &'static str

Keyword emitted for MERGE NOT MATCHED branch. Read more
Source§

fn supports_merge_not_matched_by_source(&self) -> bool

Whether MERGE supports WHEN NOT MATCHED BY SOURCE.
Source§

fn merge_supported(&self) -> bool

Whether this platform takes a MERGE statement. Read more
Source§

fn merge_supports_schema_evolution_keyword(&self) -> bool

Whether WITH SCHEMA EVOLUTION is supported for MERGE.
Source§

fn merge_supports_table_hints(&self) -> bool

Whether table hints are supported in MERGE target.
Source§

fn merge_uses_output_clause(&self) -> bool

Whether OUTPUT clause should be used for MERGE result projection.
Source§

fn merge_supports_returning_clause(&self) -> bool

Whether RETURNING clause is supported for MERGE.
Source§

fn longest_script_line(&self) -> Option<usize>

The longest line this engine’s own client reads intact from a script file, or None where it reads any line. Read more
Source§

fn render_relation_alias(&self, relation: &str, alias: &str) -> String

How this engine writes a short name for a relation. Read more
Source§

fn is_reserved_word(&self, word: &str) -> bool

Whether this engine reserves word, so a name spelled that way has to be quoted to be read as a name. Read more
Source§

fn render_alias(&self, alias: &str) -> String

A short name Razeri gives a column or a relation inside one statement, written so this engine reads it as a name. Read more
Source§

fn render_ddl_within_routine_body(&self, statement: &str) -> String

How a statement that changes the shape of the warehouse is written inside a routine’s body. Read more
Source§

fn render_empty_table(&self, relation: &str) -> String

How this engine empties a table and keeps it. Read more
Source§

fn merge_target_accepts_alias(&self) -> bool

Whether this engine lets a MERGE target carry an alias. Read more
Source§

fn render_merge_on(&self, condition: &str) -> String

How this engine writes the condition a MERGE matches rows on. Read more
Source§

fn merge_source_requires_inlined_ctes(&self) -> bool

Whether this engine refuses a WITH clause in front of MERGE. Read more
Source§

fn insert_accepts_leading_ctes(&self) -> bool

Whether a WITH clause parses in front of this engine’s INSERT. Read more
Source§

fn supports_sql_function_ddl(&self) -> bool

Whether this engine can be given a function by CREATE FUNCTION. Read more
Source§

fn scalar_function_body_is_expression(&self) -> bool

Whether a scalar function’s body is a bare expression. Read more
Source§

fn scalar_function_names_are_schema_qualified(&self) -> bool

Whether a scalar function belongs to a schema. Read more
Source§

fn scalar_function_call_requires_schema(&self) -> bool

Whether an unqualified scalar-function call resolves. Read more
Source§

fn render_procedure_call(&self, qualified_name: &str) -> String

How this engine invokes a stored procedure, as a whole statement. Read more
Source§

fn schema_separator(&self) -> &'static str

The schema separator for qualified names. Read more
Source§

fn statement_separator(&self) -> &'static str

The statement separator for scripts. Read more
Source§

fn supports_compound_assignment(&self) -> bool

Whether the platform supports compound assignment operators (e.g., col += value). Read more
Source§

fn supports_update_from(&self) -> bool

Whether UPDATE supports FROM clause for join-based updates. Read more
Source§

fn update_from_takes_a_source_naming_the_targets_columns(&self) -> bool

Whether an UPDATE … FROM takes a joined source whose columns carry the target’s own names, under an unqualified SET: UPDATE t SET v = source.v FROM (SELECT k, v FROM s) source WHERE t.k = source.k. Read more
Source§

fn render_refresh_statistics(&self, table: &str) -> Option<String>

The statement that tells this engine’s planner what a table now holds, after Razeri wrote it in bulk, or None where the engine needs none. Read more
Source§

fn uses_alter_table_update(&self) -> bool

Whether the platform uses ALTER TABLE … UPDATE syntax (ClickHouse mutations).
Source§

fn mutation_reads_only_its_own_rows(&self) -> bool

Whether a mutation on this platform can read only the row it is mutating. Read more
Source§

fn render_procedure_variable_reference(&self, name: &str) -> String

The spelling a SQL statement inside a generated procedure body reads a declared local variable by. Read more
Source§

fn render_procedure_query_into_variable( &self, variable: &str, query: &str, ) -> String

The statement that binds one query’s answer to a declared local. Read more
Source§

fn render_procedure_raise( &self, message: &str, error_code: Option<i32>, ) -> String

The statement that stops a procedure body with an error of its own. Read more
Source§

fn render_procedure_log( &self, level: ProcedureLogLevel, message: &str, ) -> Option<String>

The statement that writes a message where an operator can read it. Read more
Source§

fn render_discarded_scalar(&self, expression: &str, alias: &str) -> String

The statement a generated load asks a scalar question with and throws the answer away. Read more
Source§

fn render_inline_clock_binding( &self, name: &str, moment: &str, ) -> InlineClockBinding

How a script with no stored procedures binds the load’s clock once — same rule as Self::render_procedure_variable_reference, on the engines where a load ships as a flat statement list rather than a procedure body. Read more
Source§

fn update_supports_top_clause(&self) -> bool

Whether UPDATE supports TOP(n) clause (SqlServer).
Source§

fn update_supports_table_hints(&self) -> bool

Whether UPDATE supports table hints (e.g., WITH (NOLOCK)) (SqlServer).
Source§

fn update_uses_output_clause(&self) -> bool

Whether UPDATE uses OUTPUT clause positioned before FROM (SqlServer). Read more
Source§

fn update_supports_returning(&self) -> bool

Whether UPDATE supports a RETURNING clause at the end of the statement. Read more
Source§

fn insert_uses_output_clause(&self) -> bool

Whether INSERT uses OUTPUT clause positioned before VALUES/SELECT (SqlServer). Read more
Source§

fn insert_supports_returning(&self) -> bool

Whether INSERT supports RETURNING at the end (PostgreSQL, CitusDB).
Source§

fn insert_supports_table_hints(&self) -> bool

Whether INSERT supports table hints (e.g., WITH (TABLOCK)) (SqlServer).
Source§

fn supports_insert_overwrite(&self) -> bool

Whether INSERT OVERWRITE is supported (Snowflake, Databricks).
Source§

fn supports_on_conflict(&self) -> bool

Whether INSERT … ON CONFLICT is supported (PostgreSQL, CitusDB).
Source§

fn supports_overriding_clause(&self) -> bool

Whether OVERRIDING SYSTEM/USER VALUE clause is supported (PostgreSQL).
Source§

fn returning_clause_keyword(&self) -> &'static str

The keyword for returning data from DML: “OUTPUT” (SqlServer) or “RETURNING” (others).
Source§

fn supports_returning_into(&self) -> bool

Whether OUTPUT … INTO is supported (SqlServer).
Source§

fn supports_multi_table_insert(&self) -> bool

Whether multi-table INSERT (INSERT ALL) is supported (Snowflake).
Source§

fn render_security_mode(&self, is_definer: bool) -> &'static str

Render the security mode clause for function/procedure definitions. Read more
Source§

fn render_function_parameter_name(&self, name: &str) -> String

Render a function parameter name. Read more
Source§

fn render_function_parameter_nullable( &self, _nullable: bool, ) -> Option<&'static str>

Render explicit nullability for a function parameter, if the platform requires it. Read more
Source§

fn render_function_parameter_default(&self, value: &str) -> String

Render the default-value clause for a function parameter. Read more
Source§

fn render_function_column_name(&self, name: &str) -> String

Render a column name inside a table-valued function definition. Read more
Source§

fn render_time_partition_expr(&self, column: &str, granularity: &str) -> String

Render a time partition expression for a column and granularity. Read more
Source§

fn render_partition_clause(&self, expr: &str) -> String

Render a DDL partition clause wrapping the expression list. Read more
Source§

fn render_generated_column(&self, name: &str, expr: &str) -> String

Render a generated column declaration. Read more
Source§

fn supports_window_frame_exclude(&self) -> bool

Whether the platform supports the EXCLUDE clause in window frame specifications. Read more
Source§

fn supports_window_frame_groups(&self) -> bool

Whether the platform supports the GROUPS frame mode in window functions. Read more
Source§

fn supports_named_windows(&self) -> bool

Whether the platform supports named windows (WINDOW clause). Read more
Source§

fn uses_hash_temp_table_prefix(&self) -> bool

Whether the platform uses a # prefix for session-scoped temporary table names. Read more
Source§

fn supports_table_variables(&self) -> bool

Whether the platform supports DECLARE @name TABLE (...) table variables. Read more
Source§

fn render_create_temp_table_keyword(&self) -> &'static str

The full CREATE keyword for session-scoped temporary tables. Read more
Source§

fn supports_transient_tables(&self) -> bool

Whether the platform supports transient tables (e.g. CREATE TRANSIENT TABLE). Read more
Source§

fn supports_on_commit_drop(&self) -> bool

Whether the platform supports ON COMMIT DROP for transaction-scoped temp tables. Read more
Source§

fn render_table_suffix(&self, table: &TableSuffixRequest<'_>) -> Option<String>

The clause written after a table’s column list, or None on an engine whose CREATE TABLE is complete at the closing parenthesis. Read more
Source§

fn sorting_key_refuses_nullable_columns(&self) -> bool

Whether this platform’s table sorting key refuses nullable columns. Read more
Source§

fn requires_primary_key_in_create_table(&self) -> bool

Whether the platform requires a primary key on every table. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.