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