Skip to main content

squonk_ast/dialect/
feature_set_generated.rs

1// SPDX-License-Identifier: MIT
2// Copyright (c) 2026 Moderately AI Inc.
3
4//! @generated by the `squonk-sourcegen` xtask — do not edit by hand.
5//!
6//! `FeatureDelta`, `FeatureSet::with`, and the
7//! `Feature` / `FeatureMetadata` registry, generated from the hand-written
8//! `FeatureSet` struct in `crates/squonk-ast/src/dialect/mod.rs` plus the
9//! `FEATURE_FIELDS` annotation in `crates/squonk-sourcegen/src/feature_set.rs`
10//! (drift gate; dialect-as-data). Regenerate after changing a
11//! `FeatureSet` field: `cargo run -p squonk-sourcegen`.
12
13#![allow(clippy::all)]
14
15use crate::dialect::*;
16use crate::precedence::{BindingPowerTable, SetOperationBindingPowerTable};
17/// Explicit customizations applied to a base [`FeatureSet`].
18///
19/// Applied by [`FeatureSet::with`] (unchecked) or [`FeatureSet::try_with`], which
20/// returns the first [`LexicalConflict`] a delta would introduce; see
21/// [`FeatureSet::lexical_conflict`] for the shared-trigger hazards a delta can create.
22#[derive(Clone, Copy, Debug, PartialEq, Eq)]
23pub struct FeatureDelta {
24    /// Override for the `identifier_casing` dialect-data dimension; `None` preserves the base value.
25    pub identifier_casing: Option<Casing>,
26    /// Override for the `identifier_quote` dialect-data dimension; `None` preserves the base value.
27    pub identifier_quotes: Option<&'static [IdentifierQuote]>,
28    /// Override for the `default_null_ordering` dialect-data dimension; `None` preserves the base value.
29    pub default_null_ordering: Option<NullOrdering>,
30    /// Override for the `reserved_column_name` dialect-data dimension; `None` preserves the base value.
31    pub reserved_column_name: Option<KeywordSet>,
32    /// Override for the `reserved_function_name` dialect-data dimension; `None` preserves the base value.
33    pub reserved_function_name: Option<KeywordSet>,
34    /// Override for the `reserved_type_name` dialect-data dimension; `None` preserves the base value.
35    pub reserved_type_name: Option<KeywordSet>,
36    /// Override for the `reserved_bare_alias` dialect-data dimension; `None` preserves the base value.
37    pub reserved_bare_alias: Option<KeywordSet>,
38    /// Override for the `reserved_as_label` dialect-data dimension; `None` preserves the base value.
39    pub reserved_as_label: Option<KeywordSet>,
40    /// Override for the `catalog_qualified_names` dialect-data dimension; `None` preserves the base value.
41    pub catalog_qualified_names: Option<bool>,
42    /// Override for the `byte_classes` dialect-data dimension; `None` preserves the base value.
43    pub byte_classes: Option<ByteClasses>,
44    /// Override for the `binding_powers` dialect-data dimension; `None` preserves the base value.
45    pub binding_powers: Option<BindingPowerTable>,
46    /// Override for the `set_operation_powers` dialect-data dimension; `None` preserves the base value.
47    pub set_operation_powers: Option<SetOperationBindingPowerTable>,
48    /// Override for the `string_literals` dialect-data dimension; `None` preserves the base value.
49    pub string_literals: Option<StringLiteralSyntax>,
50    /// Override for the `numeric_literals` dialect-data dimension; `None` preserves the base value.
51    pub numeric_literals: Option<NumericLiteralSyntax>,
52    /// Override for the `parameters` dialect-data dimension; `None` preserves the base value.
53    pub parameters: Option<ParameterSyntax>,
54    /// Override for the `session_variables` dialect-data dimension; `None` preserves the base value.
55    pub session_variables: Option<SessionVariableSyntax>,
56    /// Override for the `identifier_syntax` dialect-data dimension; `None` preserves the base value.
57    pub identifier_syntax: Option<IdentifierSyntax>,
58    /// Override for the `table_expressions` dialect-data dimension; `None` preserves the base value.
59    pub table_expressions: Option<TableExpressionSyntax>,
60    /// Override for the `join_syntax` dialect-data dimension; `None` preserves the base value.
61    pub join_syntax: Option<JoinSyntax>,
62    /// Override for the `table_factor_syntax` dialect-data dimension; `None` preserves the base value.
63    pub table_factor_syntax: Option<TableFactorSyntax>,
64    /// Override for the `expression_syntax` dialect-data dimension; `None` preserves the base value.
65    pub expression_syntax: Option<ExpressionSyntax>,
66    /// Override for the `operator_syntax` dialect-data dimension; `None` preserves the base value.
67    pub operator_syntax: Option<OperatorSyntax>,
68    /// Override for the `call_syntax` dialect-data dimension; `None` preserves the base value.
69    pub call_syntax: Option<CallSyntax>,
70    /// Override for the `string_func_forms` dialect-data dimension; `None` preserves the base value.
71    pub string_func_forms: Option<StringFuncForms>,
72    /// Override for the `aggregate_call_syntax` dialect-data dimension; `None` preserves the base value.
73    pub aggregate_call_syntax: Option<AggregateCallSyntax>,
74    /// Override for the `predicate_syntax` dialect-data dimension; `None` preserves the base value.
75    pub predicate_syntax: Option<PredicateSyntax>,
76    /// Override for the `pipe_operator` dialect-data dimension; `None` preserves the base value.
77    pub pipe_operator: Option<PipeOperator>,
78    /// Override for the `double_ampersand` dialect-data dimension; `None` preserves the base value.
79    pub double_ampersand: Option<DoubleAmpersand>,
80    /// Override for the `keyword_operators` dialect-data dimension; `None` preserves the base value.
81    pub keyword_operators: Option<KeywordOperators>,
82    /// Override for the `caret_operator` dialect-data dimension; `None` preserves the base value.
83    pub caret_operator: Option<CaretOperator>,
84    /// Override for the `hash_bitwise_xor` dialect-data dimension; `None` preserves the base value.
85    pub hash_bitwise_xor: Option<bool>,
86    /// Override for the `comment_syntax` dialect-data dimension; `None` preserves the base value.
87    pub comment_syntax: Option<CommentSyntax>,
88    /// Override for the `mutation_syntax` dialect-data dimension; `None` preserves the base value.
89    pub mutation_syntax: Option<MutationSyntax>,
90    /// Override for the `statement_ddl_gates` dialect-data dimension; `None` preserves the base value.
91    pub statement_ddl_gates: Option<StatementDdlGates>,
92    /// Override for the `create_table_clause_syntax` dialect-data dimension; `None` preserves the base value.
93    pub create_table_clause_syntax: Option<CreateTableClauseSyntax>,
94    /// Override for the `column_definition_syntax` dialect-data dimension; `None` preserves the base value.
95    pub column_definition_syntax: Option<ColumnDefinitionSyntax>,
96    /// Override for the `constraint_syntax` dialect-data dimension; `None` preserves the base value.
97    pub constraint_syntax: Option<ConstraintSyntax>,
98    /// Override for the `index_alter_syntax` dialect-data dimension; `None` preserves the base value.
99    pub index_alter_syntax: Option<IndexAlterSyntax>,
100    /// Override for the `existence_guards` dialect-data dimension; `None` preserves the base value.
101    pub existence_guards: Option<ExistenceGuards>,
102    /// Override for the `select_syntax` dialect-data dimension; `None` preserves the base value.
103    pub select_syntax: Option<SelectSyntax>,
104    /// Override for the `query_tail_syntax` dialect-data dimension; `None` preserves the base value.
105    pub query_tail_syntax: Option<QueryTailSyntax>,
106    /// Override for the `grouping_syntax` dialect-data dimension; `None` preserves the base value.
107    pub grouping_syntax: Option<GroupingSyntax>,
108    /// Override for the `utility_syntax` dialect-data dimension; `None` preserves the base value.
109    pub utility_syntax: Option<UtilitySyntax>,
110    /// Override for the `show_syntax` dialect-data dimension; `None` preserves the base value.
111    pub show_syntax: Option<ShowSyntax>,
112    /// Override for the `maintenance_syntax` dialect-data dimension; `None` preserves the base value.
113    pub maintenance_syntax: Option<MaintenanceSyntax>,
114    /// Override for the `access_control_syntax` dialect-data dimension; `None` preserves the base value.
115    pub access_control_syntax: Option<AccessControlSyntax>,
116    /// Override for the `type_name_syntax` dialect-data dimension; `None` preserves the base value.
117    pub type_name_syntax: Option<TypeNameSyntax>,
118    /// Override for the `target_spelling` dialect-data dimension; `None` preserves the base value.
119    pub target_spelling: Option<TargetSpelling>,
120}
121impl FeatureDelta {
122    /// No changes from the base feature set.
123    pub const EMPTY: Self = Self {
124        identifier_casing: None,
125        identifier_quotes: None,
126        default_null_ordering: None,
127        reserved_column_name: None,
128        reserved_function_name: None,
129        reserved_type_name: None,
130        reserved_bare_alias: None,
131        reserved_as_label: None,
132        catalog_qualified_names: None,
133        byte_classes: None,
134        binding_powers: None,
135        set_operation_powers: None,
136        string_literals: None,
137        numeric_literals: None,
138        parameters: None,
139        session_variables: None,
140        identifier_syntax: None,
141        table_expressions: None,
142        join_syntax: None,
143        table_factor_syntax: None,
144        expression_syntax: None,
145        operator_syntax: None,
146        call_syntax: None,
147        string_func_forms: None,
148        aggregate_call_syntax: None,
149        predicate_syntax: None,
150        pipe_operator: None,
151        double_ampersand: None,
152        keyword_operators: None,
153        caret_operator: None,
154        hash_bitwise_xor: None,
155        comment_syntax: None,
156        mutation_syntax: None,
157        statement_ddl_gates: None,
158        create_table_clause_syntax: None,
159        column_definition_syntax: None,
160        constraint_syntax: None,
161        index_alter_syntax: None,
162        existence_guards: None,
163        select_syntax: None,
164        query_tail_syntax: None,
165        grouping_syntax: None,
166        utility_syntax: None,
167        show_syntax: None,
168        maintenance_syntax: None,
169        access_control_syntax: None,
170        type_name_syntax: None,
171        target_spelling: None,
172    };
173    /// Override the `identifier_casing` dialect-data dimension.
174    pub const fn identifier_casing(mut self, value: Casing) -> Self {
175        self.identifier_casing = Some(value);
176        self
177    }
178    /// Override the `identifier_quotes` dialect-data dimension.
179    pub const fn identifier_quotes(mut self, value: &'static [IdentifierQuote]) -> Self {
180        self.identifier_quotes = Some(value);
181        self
182    }
183    /// Override the `default_null_ordering` dialect-data dimension.
184    pub const fn default_null_ordering(mut self, value: NullOrdering) -> Self {
185        self.default_null_ordering = Some(value);
186        self
187    }
188    /// Override the `reserved_column_name` dialect-data dimension.
189    pub const fn reserved_column_name(mut self, value: KeywordSet) -> Self {
190        self.reserved_column_name = Some(value);
191        self
192    }
193    /// Override the `reserved_function_name` dialect-data dimension.
194    pub const fn reserved_function_name(mut self, value: KeywordSet) -> Self {
195        self.reserved_function_name = Some(value);
196        self
197    }
198    /// Override the `reserved_type_name` dialect-data dimension.
199    pub const fn reserved_type_name(mut self, value: KeywordSet) -> Self {
200        self.reserved_type_name = Some(value);
201        self
202    }
203    /// Override the `reserved_bare_alias` dialect-data dimension.
204    pub const fn reserved_bare_alias(mut self, value: KeywordSet) -> Self {
205        self.reserved_bare_alias = Some(value);
206        self
207    }
208    /// Override the `reserved_as_label` dialect-data dimension.
209    pub const fn reserved_as_label(mut self, value: KeywordSet) -> Self {
210        self.reserved_as_label = Some(value);
211        self
212    }
213    /// Override the `catalog_qualified_names` dialect-data dimension.
214    pub const fn catalog_qualified_names(mut self, value: bool) -> Self {
215        self.catalog_qualified_names = Some(value);
216        self
217    }
218    /// Override the `byte_classes` dialect-data dimension.
219    pub const fn byte_classes(mut self, value: ByteClasses) -> Self {
220        self.byte_classes = Some(value);
221        self
222    }
223    /// Override the `binding_powers` dialect-data dimension.
224    pub const fn binding_powers(mut self, value: BindingPowerTable) -> Self {
225        self.binding_powers = Some(value);
226        self
227    }
228    /// Override the `set_operation_powers` dialect-data dimension.
229    pub const fn set_operation_powers(mut self, value: SetOperationBindingPowerTable) -> Self {
230        self.set_operation_powers = Some(value);
231        self
232    }
233    /// Override the `string_literals` dialect-data dimension.
234    pub const fn string_literals(mut self, value: StringLiteralSyntax) -> Self {
235        self.string_literals = Some(value);
236        self
237    }
238    /// Override the `numeric_literals` dialect-data dimension.
239    pub const fn numeric_literals(mut self, value: NumericLiteralSyntax) -> Self {
240        self.numeric_literals = Some(value);
241        self
242    }
243    /// Override the `parameters` dialect-data dimension.
244    pub const fn parameters(mut self, value: ParameterSyntax) -> Self {
245        self.parameters = Some(value);
246        self
247    }
248    /// Override the `session_variables` dialect-data dimension.
249    pub const fn session_variables(mut self, value: SessionVariableSyntax) -> Self {
250        self.session_variables = Some(value);
251        self
252    }
253    /// Override the `identifier_syntax` dialect-data dimension.
254    pub const fn identifier_syntax(mut self, value: IdentifierSyntax) -> Self {
255        self.identifier_syntax = Some(value);
256        self
257    }
258    /// Override the `table_expressions` dialect-data dimension.
259    pub const fn table_expressions(mut self, value: TableExpressionSyntax) -> Self {
260        self.table_expressions = Some(value);
261        self
262    }
263    /// Override the `join_syntax` dialect-data dimension.
264    pub const fn join_syntax(mut self, value: JoinSyntax) -> Self {
265        self.join_syntax = Some(value);
266        self
267    }
268    /// Override the `table_factor_syntax` dialect-data dimension.
269    pub const fn table_factor_syntax(mut self, value: TableFactorSyntax) -> Self {
270        self.table_factor_syntax = Some(value);
271        self
272    }
273    /// Override the `expression_syntax` dialect-data dimension.
274    pub const fn expression_syntax(mut self, value: ExpressionSyntax) -> Self {
275        self.expression_syntax = Some(value);
276        self
277    }
278    /// Override the `operator_syntax` dialect-data dimension.
279    pub const fn operator_syntax(mut self, value: OperatorSyntax) -> Self {
280        self.operator_syntax = Some(value);
281        self
282    }
283    /// Override the `call_syntax` dialect-data dimension.
284    pub const fn call_syntax(mut self, value: CallSyntax) -> Self {
285        self.call_syntax = Some(value);
286        self
287    }
288    /// Override the `string_func_forms` dialect-data dimension.
289    pub const fn string_func_forms(mut self, value: StringFuncForms) -> Self {
290        self.string_func_forms = Some(value);
291        self
292    }
293    /// Override the `aggregate_call_syntax` dialect-data dimension.
294    pub const fn aggregate_call_syntax(mut self, value: AggregateCallSyntax) -> Self {
295        self.aggregate_call_syntax = Some(value);
296        self
297    }
298    /// Override the `predicate_syntax` dialect-data dimension.
299    pub const fn predicate_syntax(mut self, value: PredicateSyntax) -> Self {
300        self.predicate_syntax = Some(value);
301        self
302    }
303    /// Override the `pipe_operator` dialect-data dimension.
304    pub const fn pipe_operator(mut self, value: PipeOperator) -> Self {
305        self.pipe_operator = Some(value);
306        self
307    }
308    /// Override the `double_ampersand` dialect-data dimension.
309    pub const fn double_ampersand(mut self, value: DoubleAmpersand) -> Self {
310        self.double_ampersand = Some(value);
311        self
312    }
313    /// Override the `keyword_operators` dialect-data dimension.
314    pub const fn keyword_operators(mut self, value: KeywordOperators) -> Self {
315        self.keyword_operators = Some(value);
316        self
317    }
318    /// Override the `caret_operator` dialect-data dimension.
319    pub const fn caret_operator(mut self, value: CaretOperator) -> Self {
320        self.caret_operator = Some(value);
321        self
322    }
323    /// Override the `hash_bitwise_xor` dialect-data dimension.
324    pub const fn hash_bitwise_xor(mut self, value: bool) -> Self {
325        self.hash_bitwise_xor = Some(value);
326        self
327    }
328    /// Override the `comment_syntax` dialect-data dimension.
329    pub const fn comment_syntax(mut self, value: CommentSyntax) -> Self {
330        self.comment_syntax = Some(value);
331        self
332    }
333    /// Override the `mutation_syntax` dialect-data dimension.
334    pub const fn mutation_syntax(mut self, value: MutationSyntax) -> Self {
335        self.mutation_syntax = Some(value);
336        self
337    }
338    /// Override the `statement_ddl_gates` dialect-data dimension.
339    pub const fn statement_ddl_gates(mut self, value: StatementDdlGates) -> Self {
340        self.statement_ddl_gates = Some(value);
341        self
342    }
343    /// Override the `create_table_clause_syntax` dialect-data dimension.
344    pub const fn create_table_clause_syntax(mut self, value: CreateTableClauseSyntax) -> Self {
345        self.create_table_clause_syntax = Some(value);
346        self
347    }
348    /// Override the `column_definition_syntax` dialect-data dimension.
349    pub const fn column_definition_syntax(mut self, value: ColumnDefinitionSyntax) -> Self {
350        self.column_definition_syntax = Some(value);
351        self
352    }
353    /// Override the `constraint_syntax` dialect-data dimension.
354    pub const fn constraint_syntax(mut self, value: ConstraintSyntax) -> Self {
355        self.constraint_syntax = Some(value);
356        self
357    }
358    /// Override the `index_alter_syntax` dialect-data dimension.
359    pub const fn index_alter_syntax(mut self, value: IndexAlterSyntax) -> Self {
360        self.index_alter_syntax = Some(value);
361        self
362    }
363    /// Override the `existence_guards` dialect-data dimension.
364    pub const fn existence_guards(mut self, value: ExistenceGuards) -> Self {
365        self.existence_guards = Some(value);
366        self
367    }
368    /// Override the `select_syntax` dialect-data dimension.
369    pub const fn select_syntax(mut self, value: SelectSyntax) -> Self {
370        self.select_syntax = Some(value);
371        self
372    }
373    /// Override the `query_tail_syntax` dialect-data dimension.
374    pub const fn query_tail_syntax(mut self, value: QueryTailSyntax) -> Self {
375        self.query_tail_syntax = Some(value);
376        self
377    }
378    /// Override the `grouping_syntax` dialect-data dimension.
379    pub const fn grouping_syntax(mut self, value: GroupingSyntax) -> Self {
380        self.grouping_syntax = Some(value);
381        self
382    }
383    /// Override the `utility_syntax` dialect-data dimension.
384    pub const fn utility_syntax(mut self, value: UtilitySyntax) -> Self {
385        self.utility_syntax = Some(value);
386        self
387    }
388    /// Override the `show_syntax` dialect-data dimension.
389    pub const fn show_syntax(mut self, value: ShowSyntax) -> Self {
390        self.show_syntax = Some(value);
391        self
392    }
393    /// Override the `maintenance_syntax` dialect-data dimension.
394    pub const fn maintenance_syntax(mut self, value: MaintenanceSyntax) -> Self {
395        self.maintenance_syntax = Some(value);
396        self
397    }
398    /// Override the `access_control_syntax` dialect-data dimension.
399    pub const fn access_control_syntax(mut self, value: AccessControlSyntax) -> Self {
400        self.access_control_syntax = Some(value);
401        self
402    }
403    /// Override the `type_name_syntax` dialect-data dimension.
404    pub const fn type_name_syntax(mut self, value: TypeNameSyntax) -> Self {
405        self.type_name_syntax = Some(value);
406        self
407    }
408    /// Override the `target_spelling` dialect-data dimension.
409    pub const fn target_spelling(mut self, value: TargetSpelling) -> Self {
410        self.target_spelling = Some(value);
411        self
412    }
413}
414impl Default for FeatureDelta {
415    fn default() -> Self {
416        Self::EMPTY
417    }
418}
419impl FeatureSet {
420    /// Return a custom dialect data value by applying `delta` to this base.
421    pub const fn with(&self, delta: FeatureDelta) -> Self {
422        Self {
423            identifier_casing: match delta.identifier_casing {
424                Some(value) => value,
425                None => self.identifier_casing,
426            },
427            identifier_quotes: match delta.identifier_quotes {
428                Some(value) => value,
429                None => self.identifier_quotes,
430            },
431            default_null_ordering: match delta.default_null_ordering {
432                Some(value) => value,
433                None => self.default_null_ordering,
434            },
435            reserved_column_name: match delta.reserved_column_name {
436                Some(value) => value,
437                None => self.reserved_column_name,
438            },
439            reserved_function_name: match delta.reserved_function_name {
440                Some(value) => value,
441                None => self.reserved_function_name,
442            },
443            reserved_type_name: match delta.reserved_type_name {
444                Some(value) => value,
445                None => self.reserved_type_name,
446            },
447            reserved_bare_alias: match delta.reserved_bare_alias {
448                Some(value) => value,
449                None => self.reserved_bare_alias,
450            },
451            reserved_as_label: match delta.reserved_as_label {
452                Some(value) => value,
453                None => self.reserved_as_label,
454            },
455            catalog_qualified_names: match delta.catalog_qualified_names {
456                Some(value) => value,
457                None => self.catalog_qualified_names,
458            },
459            byte_classes: match delta.byte_classes {
460                Some(value) => value,
461                None => self.byte_classes,
462            },
463            binding_powers: match delta.binding_powers {
464                Some(value) => value,
465                None => self.binding_powers,
466            },
467            set_operation_powers: match delta.set_operation_powers {
468                Some(value) => value,
469                None => self.set_operation_powers,
470            },
471            string_literals: match delta.string_literals {
472                Some(value) => value,
473                None => self.string_literals,
474            },
475            numeric_literals: match delta.numeric_literals {
476                Some(value) => value,
477                None => self.numeric_literals,
478            },
479            parameters: match delta.parameters {
480                Some(value) => value,
481                None => self.parameters,
482            },
483            session_variables: match delta.session_variables {
484                Some(value) => value,
485                None => self.session_variables,
486            },
487            identifier_syntax: match delta.identifier_syntax {
488                Some(value) => value,
489                None => self.identifier_syntax,
490            },
491            table_expressions: match delta.table_expressions {
492                Some(value) => value,
493                None => self.table_expressions,
494            },
495            join_syntax: match delta.join_syntax {
496                Some(value) => value,
497                None => self.join_syntax,
498            },
499            table_factor_syntax: match delta.table_factor_syntax {
500                Some(value) => value,
501                None => self.table_factor_syntax,
502            },
503            expression_syntax: match delta.expression_syntax {
504                Some(value) => value,
505                None => self.expression_syntax,
506            },
507            operator_syntax: match delta.operator_syntax {
508                Some(value) => value,
509                None => self.operator_syntax,
510            },
511            call_syntax: match delta.call_syntax {
512                Some(value) => value,
513                None => self.call_syntax,
514            },
515            string_func_forms: match delta.string_func_forms {
516                Some(value) => value,
517                None => self.string_func_forms,
518            },
519            aggregate_call_syntax: match delta.aggregate_call_syntax {
520                Some(value) => value,
521                None => self.aggregate_call_syntax,
522            },
523            predicate_syntax: match delta.predicate_syntax {
524                Some(value) => value,
525                None => self.predicate_syntax,
526            },
527            pipe_operator: match delta.pipe_operator {
528                Some(value) => value,
529                None => self.pipe_operator,
530            },
531            double_ampersand: match delta.double_ampersand {
532                Some(value) => value,
533                None => self.double_ampersand,
534            },
535            keyword_operators: match delta.keyword_operators {
536                Some(value) => value,
537                None => self.keyword_operators,
538            },
539            caret_operator: match delta.caret_operator {
540                Some(value) => value,
541                None => self.caret_operator,
542            },
543            hash_bitwise_xor: match delta.hash_bitwise_xor {
544                Some(value) => value,
545                None => self.hash_bitwise_xor,
546            },
547            comment_syntax: match delta.comment_syntax {
548                Some(value) => value,
549                None => self.comment_syntax,
550            },
551            mutation_syntax: match delta.mutation_syntax {
552                Some(value) => value,
553                None => self.mutation_syntax,
554            },
555            statement_ddl_gates: match delta.statement_ddl_gates {
556                Some(value) => value,
557                None => self.statement_ddl_gates,
558            },
559            create_table_clause_syntax: match delta.create_table_clause_syntax {
560                Some(value) => value,
561                None => self.create_table_clause_syntax,
562            },
563            column_definition_syntax: match delta.column_definition_syntax {
564                Some(value) => value,
565                None => self.column_definition_syntax,
566            },
567            constraint_syntax: match delta.constraint_syntax {
568                Some(value) => value,
569                None => self.constraint_syntax,
570            },
571            index_alter_syntax: match delta.index_alter_syntax {
572                Some(value) => value,
573                None => self.index_alter_syntax,
574            },
575            existence_guards: match delta.existence_guards {
576                Some(value) => value,
577                None => self.existence_guards,
578            },
579            select_syntax: match delta.select_syntax {
580                Some(value) => value,
581                None => self.select_syntax,
582            },
583            query_tail_syntax: match delta.query_tail_syntax {
584                Some(value) => value,
585                None => self.query_tail_syntax,
586            },
587            grouping_syntax: match delta.grouping_syntax {
588                Some(value) => value,
589                None => self.grouping_syntax,
590            },
591            utility_syntax: match delta.utility_syntax {
592                Some(value) => value,
593                None => self.utility_syntax,
594            },
595            show_syntax: match delta.show_syntax {
596                Some(value) => value,
597                None => self.show_syntax,
598            },
599            maintenance_syntax: match delta.maintenance_syntax {
600                Some(value) => value,
601                None => self.maintenance_syntax,
602            },
603            access_control_syntax: match delta.access_control_syntax {
604                Some(value) => value,
605                None => self.access_control_syntax,
606            },
607            type_name_syntax: match delta.type_name_syntax {
608                Some(value) => value,
609                None => self.type_name_syntax,
610            },
611            target_spelling: match delta.target_spelling {
612                Some(value) => value,
613                None => self.target_spelling,
614            },
615        }
616    }
617}
618/// Enumerable dialect data fields for the coverage matrix.
619#[derive(Clone, Copy, Debug, PartialEq, Eq)]
620pub enum Feature {
621    /// The `identifier_casing` dialect-data dimension.
622    IdentifierCasing,
623    /// The `identifier_quote` dialect-data dimension.
624    IdentifierQuote,
625    /// The `default_null_ordering` dialect-data dimension.
626    DefaultNullOrdering,
627    /// The `reserved_column_name` dialect-data dimension.
628    ReservedColumnName,
629    /// The `reserved_function_name` dialect-data dimension.
630    ReservedFunctionName,
631    /// The `reserved_type_name` dialect-data dimension.
632    ReservedTypeName,
633    /// The `reserved_bare_alias` dialect-data dimension.
634    ReservedBareAlias,
635    /// The `reserved_as_label` dialect-data dimension.
636    ReservedAsLabel,
637    /// The `catalog_qualified_names` dialect-data dimension.
638    CatalogQualifiedNames,
639    /// The `byte_classes` dialect-data dimension.
640    ByteClasses,
641    /// The `binding_powers` dialect-data dimension.
642    BindingPowers,
643    /// The `set_operation_powers` dialect-data dimension.
644    SetOperationPowers,
645    /// The `string_literals` dialect-data dimension.
646    StringLiterals,
647    /// The `numeric_literals` dialect-data dimension.
648    NumericLiterals,
649    /// The `parameters` dialect-data dimension.
650    Parameters,
651    /// The `session_variables` dialect-data dimension.
652    SessionVariables,
653    /// The `identifier_syntax` dialect-data dimension.
654    IdentifierSyntax,
655    /// The `table_expressions` dialect-data dimension.
656    TableExpressions,
657    /// The `join_syntax` dialect-data dimension.
658    JoinSyntax,
659    /// The `table_factor_syntax` dialect-data dimension.
660    TableFactorSyntax,
661    /// The `expression_syntax` dialect-data dimension.
662    ExpressionSyntax,
663    /// The `operator_syntax` dialect-data dimension.
664    OperatorSyntax,
665    /// The `call_syntax` dialect-data dimension.
666    CallSyntax,
667    /// The `string_func_forms` dialect-data dimension.
668    StringFuncForms,
669    /// The `aggregate_call_syntax` dialect-data dimension.
670    AggregateCallSyntax,
671    /// The `predicate_syntax` dialect-data dimension.
672    PredicateSyntax,
673    /// The `pipe_operator` dialect-data dimension.
674    PipeOperator,
675    /// The `double_ampersand` dialect-data dimension.
676    DoubleAmpersand,
677    /// The `keyword_operators` dialect-data dimension.
678    KeywordOperators,
679    /// The `caret_operator` dialect-data dimension.
680    CaretOperator,
681    /// The `hash_bitwise_xor` dialect-data dimension.
682    HashBitwiseXor,
683    /// The `comment_syntax` dialect-data dimension.
684    CommentSyntax,
685    /// The `mutation_syntax` dialect-data dimension.
686    MutationSyntax,
687    /// The `statement_ddl_gates` dialect-data dimension.
688    StatementDdlGates,
689    /// The `create_table_clause_syntax` dialect-data dimension.
690    CreateTableClauseSyntax,
691    /// The `column_definition_syntax` dialect-data dimension.
692    ColumnDefinitionSyntax,
693    /// The `constraint_syntax` dialect-data dimension.
694    ConstraintSyntax,
695    /// The `index_alter_syntax` dialect-data dimension.
696    IndexAlterSyntax,
697    /// The `existence_guards` dialect-data dimension.
698    ExistenceGuards,
699    /// The `select_syntax` dialect-data dimension.
700    SelectSyntax,
701    /// The `query_tail_syntax` dialect-data dimension.
702    QueryTailSyntax,
703    /// The `grouping_syntax` dialect-data dimension.
704    GroupingSyntax,
705    /// The `utility_syntax` dialect-data dimension.
706    UtilitySyntax,
707    /// The `show_syntax` dialect-data dimension.
708    ShowSyntax,
709    /// The `maintenance_syntax` dialect-data dimension.
710    MaintenanceSyntax,
711    /// The `access_control_syntax` dialect-data dimension.
712    AccessControlSyntax,
713    /// The `type_name_syntax` dialect-data dimension.
714    TypeNameSyntax,
715    /// The `target_spelling` dialect-data dimension.
716    TargetSpelling,
717}
718impl Feature {
719    /// Features in stable coverage-matrix order; `Feature::ALL[d] as usize == d`.
720    pub const ALL: [Self; 48] = [
721        Self::IdentifierCasing,
722        Self::IdentifierQuote,
723        Self::DefaultNullOrdering,
724        Self::ReservedColumnName,
725        Self::ReservedFunctionName,
726        Self::ReservedTypeName,
727        Self::ReservedBareAlias,
728        Self::ReservedAsLabel,
729        Self::CatalogQualifiedNames,
730        Self::ByteClasses,
731        Self::BindingPowers,
732        Self::SetOperationPowers,
733        Self::StringLiterals,
734        Self::NumericLiterals,
735        Self::Parameters,
736        Self::SessionVariables,
737        Self::IdentifierSyntax,
738        Self::TableExpressions,
739        Self::JoinSyntax,
740        Self::TableFactorSyntax,
741        Self::ExpressionSyntax,
742        Self::OperatorSyntax,
743        Self::CallSyntax,
744        Self::StringFuncForms,
745        Self::AggregateCallSyntax,
746        Self::PredicateSyntax,
747        Self::PipeOperator,
748        Self::DoubleAmpersand,
749        Self::KeywordOperators,
750        Self::CaretOperator,
751        Self::HashBitwiseXor,
752        Self::CommentSyntax,
753        Self::MutationSyntax,
754        Self::StatementDdlGates,
755        Self::CreateTableClauseSyntax,
756        Self::ColumnDefinitionSyntax,
757        Self::ConstraintSyntax,
758        Self::IndexAlterSyntax,
759        Self::ExistenceGuards,
760        Self::SelectSyntax,
761        Self::QueryTailSyntax,
762        Self::GroupingSyntax,
763        Self::UtilitySyntax,
764        Self::ShowSyntax,
765        Self::MaintenanceSyntax,
766        Self::AccessControlSyntax,
767        Self::TypeNameSyntax,
768        Self::TargetSpelling,
769    ];
770    /// Stable machine-readable feature id.
771    pub const fn id(&self) -> &'static str {
772        match self {
773            Self::IdentifierCasing => "identifier_casing",
774            Self::IdentifierQuote => "identifier_quote",
775            Self::DefaultNullOrdering => "default_null_ordering",
776            Self::ReservedColumnName => "reserved_column_name",
777            Self::ReservedFunctionName => "reserved_function_name",
778            Self::ReservedTypeName => "reserved_type_name",
779            Self::ReservedBareAlias => "reserved_bare_alias",
780            Self::ReservedAsLabel => "reserved_as_label",
781            Self::CatalogQualifiedNames => "catalog_qualified_names",
782            Self::ByteClasses => "byte_classes",
783            Self::BindingPowers => "binding_powers",
784            Self::SetOperationPowers => "set_operation_powers",
785            Self::StringLiterals => "string_literals",
786            Self::NumericLiterals => "numeric_literals",
787            Self::Parameters => "parameters",
788            Self::SessionVariables => "session_variables",
789            Self::IdentifierSyntax => "identifier_syntax",
790            Self::TableExpressions => "table_expressions",
791            Self::JoinSyntax => "join_syntax",
792            Self::TableFactorSyntax => "table_factor_syntax",
793            Self::ExpressionSyntax => "expression_syntax",
794            Self::OperatorSyntax => "operator_syntax",
795            Self::CallSyntax => "call_syntax",
796            Self::StringFuncForms => "string_func_forms",
797            Self::AggregateCallSyntax => "aggregate_call_syntax",
798            Self::PredicateSyntax => "predicate_syntax",
799            Self::PipeOperator => "pipe_operator",
800            Self::DoubleAmpersand => "double_ampersand",
801            Self::KeywordOperators => "keyword_operators",
802            Self::CaretOperator => "caret_operator",
803            Self::HashBitwiseXor => "hash_bitwise_xor",
804            Self::CommentSyntax => "comment_syntax",
805            Self::MutationSyntax => "mutation_syntax",
806            Self::StatementDdlGates => "statement_ddl_gates",
807            Self::CreateTableClauseSyntax => "create_table_clause_syntax",
808            Self::ColumnDefinitionSyntax => "column_definition_syntax",
809            Self::ConstraintSyntax => "constraint_syntax",
810            Self::IndexAlterSyntax => "index_alter_syntax",
811            Self::ExistenceGuards => "existence_guards",
812            Self::SelectSyntax => "select_syntax",
813            Self::QueryTailSyntax => "query_tail_syntax",
814            Self::GroupingSyntax => "grouping_syntax",
815            Self::UtilitySyntax => "utility_syntax",
816            Self::ShowSyntax => "show_syntax",
817            Self::MaintenanceSyntax => "maintenance_syntax",
818            Self::AccessControlSyntax => "access_control_syntax",
819            Self::TypeNameSyntax => "type_name_syntax",
820            Self::TargetSpelling => "target_spelling",
821        }
822    }
823    /// Current maturity of this feature metadata entry.
824    pub const fn maturity(&self) -> Maturity {
825        Maturity::Stable
826    }
827    /// Whether an "enable everything" preset should include this feature; `false`
828    /// marks a negative-polarity feature kept out of max-feature unions. See
829    /// [`FeatureMetadata::ideally_enabled`].
830    pub const fn ideally_enabled(&self) -> bool {
831        true
832    }
833    /// The SQL:2016 feature id this dialect-data field anchors to 1:1, when it does.
834    ///
835    /// Aggregate knobs whose sub-features map individually and pure parser mechanisms
836    /// return `None`; their standard anchors live as rows in `STANDARD_FEATURE_CATALOG`.
837    pub const fn iso_id(&self) -> Option<&'static str> {
838        match self {
839            Self::IdentifierQuote => Some("E031-01"),
840            Self::PredicateSyntax => Some("E021-08"),
841            Self::PipeOperator => Some("E021-07"),
842            _ => None,
843        }
844    }
845    /// Full metadata entry for coverage enumeration.
846    pub const fn metadata(&self) -> FeatureMetadata {
847        FeatureMetadata {
848            feature: *self,
849            id: self.id(),
850            iso_id: self.iso_id(),
851            ideally_enabled: self.ideally_enabled(),
852            maturity: self.maturity(),
853        }
854    }
855}
856/// All self-described dialect data fields.
857pub const FEATURES: &[Feature] = &Feature::ALL;
858/// All self-described dialect data fields with stable metadata.
859pub const FEATURE_METADATA: &[FeatureMetadata] = &[
860    Feature::IdentifierCasing.metadata(),
861    Feature::IdentifierQuote.metadata(),
862    Feature::DefaultNullOrdering.metadata(),
863    Feature::ReservedColumnName.metadata(),
864    Feature::ReservedFunctionName.metadata(),
865    Feature::ReservedTypeName.metadata(),
866    Feature::ReservedBareAlias.metadata(),
867    Feature::ReservedAsLabel.metadata(),
868    Feature::CatalogQualifiedNames.metadata(),
869    Feature::ByteClasses.metadata(),
870    Feature::BindingPowers.metadata(),
871    Feature::SetOperationPowers.metadata(),
872    Feature::StringLiterals.metadata(),
873    Feature::NumericLiterals.metadata(),
874    Feature::Parameters.metadata(),
875    Feature::SessionVariables.metadata(),
876    Feature::IdentifierSyntax.metadata(),
877    Feature::TableExpressions.metadata(),
878    Feature::JoinSyntax.metadata(),
879    Feature::TableFactorSyntax.metadata(),
880    Feature::ExpressionSyntax.metadata(),
881    Feature::OperatorSyntax.metadata(),
882    Feature::CallSyntax.metadata(),
883    Feature::StringFuncForms.metadata(),
884    Feature::AggregateCallSyntax.metadata(),
885    Feature::PredicateSyntax.metadata(),
886    Feature::PipeOperator.metadata(),
887    Feature::DoubleAmpersand.metadata(),
888    Feature::KeywordOperators.metadata(),
889    Feature::CaretOperator.metadata(),
890    Feature::HashBitwiseXor.metadata(),
891    Feature::CommentSyntax.metadata(),
892    Feature::MutationSyntax.metadata(),
893    Feature::StatementDdlGates.metadata(),
894    Feature::CreateTableClauseSyntax.metadata(),
895    Feature::ColumnDefinitionSyntax.metadata(),
896    Feature::ConstraintSyntax.metadata(),
897    Feature::IndexAlterSyntax.metadata(),
898    Feature::ExistenceGuards.metadata(),
899    Feature::SelectSyntax.metadata(),
900    Feature::QueryTailSyntax.metadata(),
901    Feature::GroupingSyntax.metadata(),
902    Feature::UtilitySyntax.metadata(),
903    Feature::ShowSyntax.metadata(),
904    Feature::MaintenanceSyntax.metadata(),
905    Feature::AccessControlSyntax.metadata(),
906    Feature::TypeNameSyntax.metadata(),
907    Feature::TargetSpelling.metadata(),
908];