pub struct GeneratorConfig {Show 110 fields
pub pretty: bool,
pub indent: String,
pub max_text_width: usize,
pub identifier_quote: char,
pub identifier_quote_style: IdentifierQuoteStyle,
pub uppercase_keywords: bool,
pub normalize_identifiers: bool,
pub dialect: Option<DialectType>,
pub normalize_functions: NormalizeFunctions,
pub string_escape: char,
pub case_sensitive_identifiers: bool,
pub identifiers_can_start_with_digit: bool,
pub always_quote_identifiers: bool,
pub null_ordering_supported: bool,
pub ignore_nulls_in_func: bool,
pub nvl2_supported: bool,
pub limit_fetch_style: LimitFetchStyle,
pub limit_is_top: bool,
pub limit_only_literals: bool,
pub single_string_interval: bool,
pub interval_allows_plural_form: bool,
pub cte_recursive_keyword_required: bool,
pub values_as_table: bool,
pub wrap_derived_values: bool,
pub tablesample_seed_keyword: &'static str,
pub tablesample_requires_parens: bool,
pub tablesample_size_is_rows: bool,
pub tablesample_keywords: &'static str,
pub tablesample_with_method: bool,
pub alias_post_tablesample: bool,
pub aggregate_filter_supported: bool,
pub multi_arg_distinct: bool,
pub quantified_no_paren_space: bool,
pub supports_median: bool,
pub supports_select_into: bool,
pub locking_reads_supported: bool,
pub rename_table_with_db: bool,
pub semi_anti_join_with_side: bool,
pub supports_table_alias_columns: bool,
pub join_hints: bool,
pub table_hints: bool,
pub query_hints: bool,
pub query_hint_sep: &'static str,
pub supports_column_join_marks: bool,
pub index_using_no_space: bool,
pub supports_unlogged_tables: bool,
pub supports_create_table_like: bool,
pub like_property_inside_schema: bool,
pub alter_table_include_column_keyword: bool,
pub supports_table_copy: bool,
pub alter_set_type: &'static str,
pub alter_set_wrapped: bool,
pub tz_to_with_time_zone: bool,
pub supports_convert_timezone: bool,
pub json_type_required_for_extraction: bool,
pub json_path_bracketed_key_supported: bool,
pub json_path_single_quote_escape: bool,
pub quote_json_path: bool,
pub json_key_value_pair_sep: &'static str,
pub copy_params_are_wrapped: bool,
pub copy_params_eq_required: bool,
pub copy_has_into_keyword: bool,
pub supports_window_exclude: bool,
pub unnest_with_ordinality: bool,
pub lowercase_window_frame_keywords: bool,
pub normalize_window_frame_between: bool,
pub array_concat_is_var_len: bool,
pub array_size_dim_required: Option<bool>,
pub can_implement_array_any: bool,
pub array_size_name: &'static str,
pub supports_between_flags: bool,
pub is_bool_allowed: bool,
pub ensure_bools: bool,
pub extract_allows_quotes: bool,
pub normalize_extract_date_parts: bool,
pub try_supported: bool,
pub supports_uescape: bool,
pub supports_to_number: bool,
pub supports_single_arg_concat: bool,
pub last_day_supports_date_part: bool,
pub supports_exploding_projections: bool,
pub supports_unix_seconds: bool,
pub supports_like_quantifiers: bool,
pub supports_decode_case: bool,
pub set_op_modifiers: bool,
pub update_statement_supports_from: bool,
pub collate_is_func: bool,
pub duplicate_key_update_with_set: bool,
pub insert_overwrite: &'static str,
pub returning_end: bool,
pub matched_by_source: bool,
pub create_function_return_as: bool,
pub parameter_default_equals: bool,
pub computed_column_with_type: bool,
pub unpivot_aliases_are_identifiers: bool,
pub star_except: &'static str,
pub hex_func: &'static str,
pub with_properties_prefix: &'static str,
pub pad_fill_pattern_is_required: bool,
pub index_on: &'static str,
pub groupings_sep: &'static str,
pub struct_delimiter: (&'static str, &'static str),
pub struct_curly_brace_notation: bool,
pub array_bracket_only: bool,
pub struct_field_sep: &'static str,
pub except_intersect_support_all_clause: bool,
pub parameter_token: &'static str,
pub named_placeholder_token: &'static str,
pub data_type_specifiers_allowed: bool,
pub schema_comment_with_eq: bool,
}Expand description
Configuration for the SQL Generator.
This is a comprehensive port of the Python sqlglot Generator class attributes.
It controls every aspect of SQL output: formatting, quoting, dialect-specific
syntax, feature support flags, and more.
Most users should start from GeneratorConfig::default() and override only the
fields they need. Dialect-specific presets are applied automatically when
dialect is set via the higher-level transpilation API.
§Key fields
| Field | Default | Purpose |
|---|---|---|
dialect | None | Target SQL dialect (e.g. PostgreSQL, MySQL, BigQuery) |
pretty | false | Enable multi-line, indented output |
indent | " " | Indentation string used when pretty is true |
max_text_width | 80 | Soft line-width limit for pretty-printing |
normalize_functions | Upper | Function name casing (Upper, Lower, None) |
identifier_quote_style | "…" | Quote characters for identifiers |
uppercase_keywords | true | Whether SQL keywords are upper-cased |
Fields§
§pretty: boolPretty print with indentation
indent: StringIndentation string (default 2 spaces)
max_text_width: usizeMaximum text width before wrapping (default 80)
identifier_quote: charQuote identifier style (deprecated, use identifier_quote_style instead)
identifier_quote_style: IdentifierQuoteStyleIdentifier quote style with separate start/end characters
uppercase_keywords: boolUppercase keywords
normalize_identifiers: boolNormalize identifiers to lowercase when generating
dialect: Option<DialectType>Dialect type for dialect-specific generation
normalize_functions: NormalizeFunctionsHow to output function names (UPPER, lower, or as-is)
string_escape: charString escape character
case_sensitive_identifiers: boolWhether identifiers are case-sensitive
identifiers_can_start_with_digit: boolWhether unquoted identifiers can start with a digit
always_quote_identifiers: boolWhether to always quote identifiers regardless of reserved keyword status Used by dialects like Athena/Presto that prefer quoted identifiers
null_ordering_supported: boolWhether null ordering (NULLS FIRST/LAST) is supported in ORDER BY True: Full Support, false: No support
ignore_nulls_in_func: boolWhether ignore nulls is inside the agg or outside FIRST(x IGNORE NULLS) OVER vs FIRST(x) IGNORE NULLS OVER
nvl2_supported: boolWhether the NVL2 function is supported
limit_fetch_style: LimitFetchStyleHow to output LIMIT clauses
limit_is_top: boolWhether to generate the limit as TOP
limit_only_literals: boolWhether limit and fetch allows expressions or just literals
single_string_interval: boolWhether INTERVAL uses single quoted string (‘1 day’ vs 1 DAY)
interval_allows_plural_form: boolWhether the plural form of date parts (e.g., “days”) is supported in INTERVALs
cte_recursive_keyword_required: boolWhether WITH RECURSIVE keyword is required (vs just WITH for recursive CTEs)
values_as_table: boolWhether VALUES can be used as a table source
wrap_derived_values: boolWrap derived values in parens (standard but Spark doesn’t support)
tablesample_seed_keyword: &'static strKeyword for TABLESAMPLE seed: “SEED” or “REPEATABLE”
tablesample_requires_parens: boolWhether parentheses are required around the table sample’s expression
tablesample_size_is_rows: boolWhether a table sample clause’s size needs to be followed by ROWS keyword
tablesample_keywords: &'static strThe keyword(s) to use when generating a sample clause
tablesample_with_method: boolWhether the TABLESAMPLE clause supports a method name, like BERNOULLI
alias_post_tablesample: boolWhether the table alias comes after tablesample (Oracle, Hive)
aggregate_filter_supported: boolWhether aggregate FILTER (WHERE …) is supported
multi_arg_distinct: boolWhether DISTINCT can be followed by multiple args in an AggFunc
quantified_no_paren_space: boolWhether ANY/ALL quantifiers have no space before (: ANY( vs ANY (
supports_median: boolWhether MEDIAN(expr) is supported; if not, generates PERCENTILE_CONT
supports_select_into: boolWhether SELECT … INTO is supported
locking_reads_supported: boolWhether locking reads (SELECT … FOR UPDATE/SHARE) are supported
rename_table_with_db: boolWhether a table is allowed to be renamed with a db
semi_anti_join_with_side: boolWhether JOIN sides (LEFT, RIGHT) are supported with SEMI/ANTI join kinds
supports_table_alias_columns: boolWhether named columns are allowed in table aliases
join_hints: boolWhether join hints should be generated
table_hints: boolWhether table hints should be generated
query_hints: boolWhether query hints should be generated
query_hint_sep: &'static strWhat kind of separator to use for query hints
supports_column_join_marks: boolWhether Oracle-style (+) join markers are supported (Oracle, Exasol)
index_using_no_space: boolWhether CREATE INDEX USING method should have no space before column parens
true: USING btree(col), false: USING btree (col)
supports_unlogged_tables: boolWhether UNLOGGED tables can be created
supports_create_table_like: boolWhether CREATE TABLE LIKE statement is supported
like_property_inside_schema: boolWhether the LikeProperty needs to be inside the schema clause
alter_table_include_column_keyword: boolWhether the word COLUMN is included when adding a column with ALTER TABLE
supports_table_copy: boolWhether CREATE TABLE .. COPY .. is supported (false = CLONE instead)
alter_set_type: &'static strThe syntax to use when altering the type of a column
alter_set_wrapped: boolWhether to wrap
tz_to_with_time_zone: boolWhether TIMESTAMP WITH TIME ZONE is used (vs TIMESTAMPTZ)
supports_convert_timezone: boolWhether CONVERT_TIMEZONE() is supported
json_type_required_for_extraction: boolWhether the JSON extraction operators expect a value of type JSON
json_path_bracketed_key_supported: boolWhether bracketed keys like [“foo”] are supported in JSON paths
json_path_single_quote_escape: boolWhether to escape keys using single quotes in JSON paths
quote_json_path: boolWhether to quote the generated expression of JsonPath
json_key_value_pair_sep: &'static strWhat delimiter to use for separating JSON key/value pairs
copy_params_are_wrapped: boolWhether parameters from COPY statement are wrapped in parentheses
copy_params_eq_required: boolWhether values of params are set with “=” token or empty space
copy_has_into_keyword: boolWhether COPY statement has INTO keyword
supports_window_exclude: boolWhether EXCLUDE in window specification is supported
unnest_with_ordinality: boolUNNEST WITH ORDINALITY (presto) instead of UNNEST WITH OFFSET (bigquery)
lowercase_window_frame_keywords: boolWhether window frame keywords (ROWS/RANGE/GROUPS, PRECEDING/FOLLOWING) should be lowercase Exasol uses lowercase for these specific keywords
normalize_window_frame_between: boolWhether to normalize single-bound window frames to BETWEEN form e.g., ROWS 1 PRECEDING → ROWS BETWEEN 1 PRECEDING AND CURRENT ROW
array_concat_is_var_len: boolWhether ARRAY_CONCAT can be generated with varlen args
array_size_dim_required: Option<bool>Whether exp.ArraySize should generate the dimension arg too None -> Doesn’t support, false -> optional, true -> required
can_implement_array_any: boolWhether any(f(x) for x in array) can be implemented
array_size_name: &'static strFunction used for array size
supports_between_flags: boolWhether SYMMETRIC and ASYMMETRIC flags are supported with BETWEEN
is_bool_allowed: boolWhether comparing against booleans (e.g. x IS TRUE) is supported
ensure_bools: boolWhether conditions require booleans WHERE x = 0 vs WHERE x
extract_allows_quotes: boolWhether to generate an unquoted value for EXTRACT’s date part argument
normalize_extract_date_parts: boolWhether to normalize date parts in EXTRACT
try_supported: boolWhether the conditional TRY(expression) function is supported
supports_uescape: boolWhether the UESCAPE syntax in unicode strings is supported
supports_to_number: boolWhether the function TO_NUMBER is supported
supports_single_arg_concat: boolWhether CONCAT requires >1 arguments
last_day_supports_date_part: boolWhether LAST_DAY function supports a date part argument
supports_exploding_projections: boolWhether a projection can explode into multiple rows
supports_unix_seconds: boolWhether UNIX_SECONDS(timestamp) is supported
supports_like_quantifiers: boolWhether LIKE and ILIKE support quantifiers such as LIKE ANY/ALL/SOME
supports_decode_case: boolWhether multi-argument DECODE(…) function is supported
set_op_modifiers: boolWhether set op modifiers apply to the outer set op or select
update_statement_supports_from: boolWhether FROM is supported in UPDATE statements
collate_is_func: boolWhether COLLATE is a function instead of a binary operator
duplicate_key_update_with_set: boolWhether to include “SET” keyword in “INSERT … ON DUPLICATE KEY UPDATE”
insert_overwrite: &'static strINSERT OVERWRITE TABLE x override
returning_end: boolWhether to generate INSERT INTO … RETURNING or INSERT INTO RETURNING …
matched_by_source: boolWhether MERGE … WHEN MATCHED BY SOURCE is allowed
create_function_return_as: boolWhether create function uses an AS before the RETURN
parameter_default_equals: boolWhether to use = instead of DEFAULT for parameter defaults (TSQL style)
computed_column_with_type: boolWhether to include the type of a computed column in the CREATE DDL
unpivot_aliases_are_identifiers: boolWhether UNPIVOT aliases are Identifiers (false means they’re Literals)
star_except: &'static strThe keyword to use when generating a star projection with excluded columns
hex_func: &'static strThe HEX function name
with_properties_prefix: &'static strThe keywords to use when prefixing WITH based properties
pad_fill_pattern_is_required: boolWhether the text pattern/fill (3rd) parameter of RPAD()/LPAD() is optional
index_on: &'static strThe string used for creating an index on a table
groupings_sep: &'static strThe separator for grouping sets and rollups
struct_delimiter: (&'static str, &'static str)Delimiters for STRUCT type
struct_curly_brace_notation: boolWhether Struct expressions use curly brace notation: {‘key’: value} (DuckDB)
array_bracket_only: boolWhether Array expressions omit the ARRAY keyword: [1, 2] instead of ARRAY[1, 2]
struct_field_sep: &'static strSeparator between struct field name and type (“: “ for Hive, “ “ for others)
except_intersect_support_all_clause: boolWhether EXCEPT and INTERSECT operations can return duplicates
parameter_token: &'static strParameter token character (@ for TSQL, $ for PostgreSQL)
named_placeholder_token: &'static strNamed placeholder token (: for most, % for PostgreSQL)
data_type_specifiers_allowed: boolWhether data types support additional specifiers like CHAR or BYTE (oracle)
schema_comment_with_eq: boolWhether schema comments use = sign (COMMENT=‘value’ vs COMMENT ‘value’)
StarRocks and Doris use naked COMMENT syntax without =
Trait Implementations§
Source§impl Clone for GeneratorConfig
impl Clone for GeneratorConfig
Source§fn clone(&self) -> GeneratorConfig
fn clone(&self) -> GeneratorConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more