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