use super::{
AccessControlSyntax, AggregateCallSyntax, CallSyntax, CaretOperator, Casing,
ColumnDefinitionSyntax, CommentSyntax, ConstraintSyntax, CreateTableClauseSyntax,
DUCKDB_BYTE_CLASSES, DoubleAmpersand, ExistenceGuards, ExpressionSyntax, FeatureSet,
GroupingSyntax, IdentifierSyntax, IndexAlterSyntax, JoinSyntax, Keyword, KeywordOperators,
KeywordSet, MaintenanceSyntax, MutationSyntax, NullOrdering, NumericLiteralSyntax,
OperatorSyntax, ParameterSyntax, PipeOperator, PredicateSyntax, QueryTailSyntax,
RESERVED_BARE_ALIAS, RESERVED_COLUMN_NAME, RESERVED_FUNCTION_NAME, RESERVED_SET_VALUE_WORDS,
RESERVED_TYPE_NAME, STANDARD_IDENTIFIER_QUOTES, SelectSyntax, SessionVariableSyntax,
ShowSyntax, StatementDdlGates, StringFuncForms, StringLiteralSyntax, TableExpressionSyntax,
TableFactorSyntax, TargetSpelling, TransactionSyntax, TypeNameSyntax, UtilitySyntax,
ViewSequenceClauseSyntax,
};
use crate::precedence::{
Assoc, BindingPower, BindingPowerTable, IS_PREDICATE_BELOW_COMPARISON,
STANDARD_SET_OPERATION_BINDING_POWERS,
};
pub const DUCKDB_QUALIFY_RESERVATION: KeywordSet = KeywordSet::from_keywords(&[Keyword::Qualify]);
pub const DUCKDB_PIVOT_RESERVATION: KeywordSet =
KeywordSet::from_keywords(&[Keyword::Pivot, Keyword::Unpivot]);
pub const DUCKDB_NONSTANDARD_JOIN_RESERVATION: KeywordSet =
KeywordSet::from_keywords(&[Keyword::Asof, Keyword::Positional]);
pub const DUCKDB_SEMI_ANTI_JOIN_RESERVATION: KeywordSet =
KeywordSet::from_keywords(&[Keyword::Semi, Keyword::Anti]);
pub const DUCKDB_UNRESERVED_CARVEOUT: KeywordSet =
KeywordSet::from_keywords(&[Keyword::Grant, Keyword::User]);
pub const DUCKDB_ORDINARY_SPECIAL_VALUE_NAMES: KeywordSet = KeywordSet::from_keywords(&[
Keyword::CurrentCatalog,
Keyword::CurrentDate,
Keyword::CurrentRole,
Keyword::CurrentSchema,
Keyword::CurrentTime,
Keyword::CurrentTimestamp,
Keyword::CurrentUser,
Keyword::Localtime,
Keyword::Localtimestamp,
Keyword::SessionUser,
Keyword::SystemUser,
]);
pub const DUCKDB_UNRESERVED_BARE_ALIAS_RESERVATION: KeywordSet =
KeywordSet::from_keywords(&[Keyword::Grant, Keyword::User]);
pub const DUCKDB_RESERVED_COLUMN_NAME: KeywordSet = RESERVED_COLUMN_NAME
.difference(DUCKDB_UNRESERVED_CARVEOUT)
.difference(DUCKDB_ORDINARY_SPECIAL_VALUE_NAMES)
.union(DUCKDB_QUALIFY_RESERVATION)
.union(DUCKDB_PIVOT_RESERVATION)
.union(DUCKDB_NONSTANDARD_JOIN_RESERVATION)
.union(DUCKDB_SEMI_ANTI_JOIN_RESERVATION);
pub const DUCKDB_RESERVED_FUNCTION_NAME: KeywordSet = RESERVED_FUNCTION_NAME
.difference(DUCKDB_UNRESERVED_CARVEOUT)
.difference(DUCKDB_ORDINARY_SPECIAL_VALUE_NAMES)
.union(DUCKDB_QUALIFY_RESERVATION)
.union(DUCKDB_PIVOT_RESERVATION)
.union(DUCKDB_SEMI_ANTI_JOIN_RESERVATION);
pub const DUCKDB_RESERVED_TYPE_NAME: KeywordSet = RESERVED_TYPE_NAME
.difference(DUCKDB_UNRESERVED_CARVEOUT)
.difference(DUCKDB_ORDINARY_SPECIAL_VALUE_NAMES)
.union(DUCKDB_QUALIFY_RESERVATION)
.union(DUCKDB_PIVOT_RESERVATION);
pub const DUCKDB_RESERVED_SET_VALUE_WORDS: KeywordSet = RESERVED_SET_VALUE_WORDS
.difference(DUCKDB_UNRESERVED_CARVEOUT)
.difference(DUCKDB_ORDINARY_SPECIAL_VALUE_NAMES)
.union(DUCKDB_QUALIFY_RESERVATION)
.union(DUCKDB_PIVOT_RESERVATION);
pub const DUCKDB_RESERVED_BARE_ALIAS: KeywordSet = RESERVED_BARE_ALIAS
.difference(DUCKDB_ORDINARY_SPECIAL_VALUE_NAMES)
.union(DUCKDB_UNRESERVED_BARE_ALIAS_RESERVATION)
.union(DUCKDB_QUALIFY_RESERVATION)
.union(DUCKDB_PIVOT_RESERVATION)
.union(DUCKDB_NONSTANDARD_JOIN_RESERVATION)
.union(DUCKDB_SEMI_ANTI_JOIN_RESERVATION);
impl NumericLiteralSyntax {
pub const DUCKDB: Self = Self {
hex_integers: true,
octal_integers: true,
binary_integers: true,
underscore_separators: true,
radix_leading_underscore: false,
money_literals: false,
reject_trailing_junk: false,
};
}
impl PredicateSyntax {
pub const DUCKDB: Self = Self {
unparenthesized_in_list: true,
overlaps_period_predicate: false,
pattern_match_quantifier: false,
between_symmetric: false,
is_normalized: false,
null_test_two_word_postfix: true,
is_distinct_from: true,
like: true,
ilike: true,
similar_to: true,
empty_in_list: false,
};
}
pub const DUCKDB_BINDING_POWERS: BindingPowerTable = BindingPowerTable {
or: BindingPower {
left: 10,
right: 11,
assoc: Assoc::Left,
},
xor: BindingPower {
left: 15,
right: 16,
assoc: Assoc::Left,
},
and: BindingPower {
left: 20,
right: 21,
assoc: Assoc::Left,
},
comparison: BindingPower {
left: 40,
right: 41,
assoc: Assoc::NonAssoc,
},
range_predicate_override: None,
is_predicate_override: Some(IS_PREDICATE_BELOW_COMPARISON),
double_equals: BindingPower {
left: 45,
right: 46,
assoc: Assoc::Left,
},
additive: BindingPower {
left: 50,
right: 51,
assoc: Assoc::Left,
},
multiplicative: BindingPower {
left: 60,
right: 61,
assoc: Assoc::Left,
},
exponent: BindingPower {
left: 65,
right: 66,
assoc: Assoc::Left,
},
string_concat: BindingPower {
left: 45,
right: 46,
assoc: Assoc::Left,
},
any_operator: BindingPower {
left: 45,
right: 46,
assoc: Assoc::Left,
},
json_get: BindingPower {
left: 4,
right: 5,
assoc: Assoc::Left,
},
bitwise_or: BindingPower {
left: 45,
right: 46,
assoc: Assoc::Left,
},
bitwise_and: BindingPower {
left: 45,
right: 46,
assoc: Assoc::Left,
},
bitwise_shift: BindingPower {
left: 45,
right: 46,
assoc: Assoc::Left,
},
bitwise_xor: BindingPower {
left: 45,
right: 46,
assoc: Assoc::Left,
},
prefix_not: 30,
prefix_sign: 80,
prefix_bitwise_not: 46,
at_time_zone: BindingPower {
left: 70,
right: 71,
assoc: Assoc::Left,
},
collate: BindingPower {
left: 74,
right: 75,
assoc: Assoc::Left,
},
subscript: BindingPower {
left: 84,
right: 85,
assoc: Assoc::Left,
},
typecast: BindingPower {
left: 88,
right: 89,
assoc: Assoc::Left,
},
field_selection: BindingPower {
left: 92,
right: 93,
assoc: Assoc::Left,
},
};
impl SelectSyntax {
pub const DUCKDB: Self = Self {
empty_target_list: false,
qualify: true,
union_by_name: true,
from_first: true,
explicit_table: true,
wildcard_modifiers: true,
qualified_wildcard_alias: true,
values_rows_require_equal_arity: true,
alias_string_literals: true,
bare_alias_string_literals: false,
trailing_comma: true,
prefix_colon_alias: true,
distinct_on: true,
select_into: true,
wildcard_replace: false,
intersect_all: true,
except_all: true,
parenthesized_query_operands: true,
values_row_constructor: true,
as_alias_rejects_reserved: false,
lateral_view_clause: false,
connect_by_clause: false,
};
}
impl QueryTailSyntax {
pub const DUCKDB: Self = Self {
locking_clauses: false,
key_lock_strengths: false,
stacked_locking_clauses: false,
using_sample: true,
limit_percent: true,
with_ties_requires_order_by: false,
fetch_first: true,
limit_offset_comma: false,
leading_offset: true,
limit_expressions: true,
pipe_syntax: false,
limit_by_clause: false,
settings_clause: false,
format_clause: false,
for_xml_json_clause: false,
};
}
impl GroupingSyntax {
pub const DUCKDB: Self = Self {
group_by_all: true,
group_by_set_quantifier: false,
order_by_all: true,
grouping_sets: true,
with_rollup: false,
order_by_using: true,
};
}
impl ExpressionSyntax {
pub const DUCKDB: Self = Self {
collection_literals: true,
slice_step: true,
positional_column: true,
lambda_keyword: true,
field_wildcard: false,
multidim_array_literals: false,
semi_structured_access: false,
relaxed_interval_syntax: true,
typecast_operator: true,
subscript: true,
collate: true,
at_time_zone: true,
array_constructor: true,
row_constructor: true,
struct_constructor: false,
field_selection: true,
typed_string_literals: true,
typed_interval_literal: true,
mysql_interval_operator: false,
};
}
impl OperatorSyntax {
pub const DUCKDB: Self = Self {
lambda_expressions: true,
double_equals: true,
integer_divide_slash: true,
starts_with_operator: true,
jsonb_operators: false,
custom_operators: true,
postfix_operators: true,
null_test_postfix: true,
quantified_arbitrary_operator: false,
operator_construct: true,
containment_operators: true,
json_arrow_operators: true,
is_general_equality: false,
truth_value_tests: true,
null_safe_equals: false,
bitwise_operators: true,
quantified_comparisons: true,
quantified_comparison_lists: true,
};
}
impl CallSyntax {
pub const DUCKDB: Self = Self {
columns_expression: true,
try_cast: true,
extract_string_field: true,
method_chaining: true,
variadic_argument: true,
sqljson_constructors_require_argument: false,
sqljson_expression_functions: false,
xml_expression_functions: false,
merge_action_function: false,
named_argument: true,
utc_special_functions: false,
extract_from_syntax: true,
restricted_cast_targets: false,
convert_function: false,
};
}
impl StringFuncForms {
pub const DUCKDB: Self = Self {
substring_similar: false,
overlay_requires_placing: true,
collation_for_expression: false,
substring_from_for: true,
substring_leading_for: true,
substring_plain_call_requires_2_or_3_args: false,
substr_from_for: false,
position_in: true,
position_asymmetric_operands: false,
overlay_placing: true,
trim_from: true,
trim_list_syntax: true,
ceil_to_field: false,
floor_to_field: false,
match_against: false,
};
}
impl AggregateCallSyntax {
pub const DUCKDB: Self = Self {
null_treatment: true,
standalone_argument_order_by: true,
filter_optional_where: true,
group_concat_separator: false,
within_group: true,
aggregate_filter: true,
aggregate_args_require_adjacent_paren: false,
aggregate_calls_reject_empty_arguments: false,
over_requires_windowable_function: false,
window_function_tail: false,
};
}
impl TypeNameSyntax {
pub const DUCKDB: Self = Self {
composite_types: true,
enum_type: true,
empty_type_parens: true,
signed_type_modifier: false,
string_type_modifiers: true,
extended_scalar_type_names: false,
set_type: false,
numeric_modifiers: false,
integer_display_width: false,
varchar_requires_length: false,
zoned_temporal_types: true,
character_set_annotation: false,
nullable_type: false,
low_cardinality_type: false,
fixed_string_type: false,
datetime64_type: false,
nested_type: false,
bit_width_integer_names: false,
liberal_type_names: false,
angle_bracket_types: false,
};
}
impl TableExpressionSyntax {
pub const DUCKDB: Self = Self {
string_literal_aliases: true,
only: true,
table_sample: true,
parenthesized_joins: true,
table_alias_column_lists: true,
join_using_alias: true,
index_hints: false,
table_hints: false,
partition_selection: false,
base_table_alias_column_lists: true,
aliased_parenthesized_join: true,
bare_table_alias_is_bare_label: false,
table_version: false,
table_json_path: false,
indexed_by: false,
prefix_colon_alias: true,
};
}
impl JoinSyntax {
pub const DUCKDB: Self = Self {
asof_join: true,
positional_join: true,
semi_anti_join: true,
sided_semi_anti_join: false,
apply_join: false,
recursive_search_cycle: false,
recursive_union_rejects_order_limit: true,
recursive_using_key: true,
stacked_join_qualifiers: true,
full_outer_join: true,
natural_cross_join: false,
straight_join: false,
};
}
impl TableFactorSyntax {
pub const DUCKDB: Self = Self {
pivot: true,
unpivot: true,
show_ref: true,
from_values: true,
json_table: false,
xml_table: false,
lateral: true,
table_functions: true,
rows_from: true,
unnest: true,
unnest_with_offset: false,
table_function_ordinality: true,
special_function_table_source: true,
table_expr_factor: false,
pivot_value_sources: false,
match_recognize: false,
open_json: false,
};
}
impl UtilitySyntax {
pub const DUCKDB: Self = Self {
pragma: true,
use_statement: true,
use_qualified_name: true,
use_string_literal_name: true,
prepared_statements: true,
prepare_typed_parameters: false,
call: true,
attach: true,
load_bare_name: true,
reset_scope: true,
detach_if_exists: true,
do_statement: false,
export_import_database: true,
update_extensions: true,
copy: true,
copy_into: false,
stage_references: false,
comment_on: true,
comment_if_exists: false,
kill: false,
handler_statements: false,
plugin_component_statements: false,
shutdown: false,
restart: false,
clone: false,
import_table: false,
help_statement: false,
binlog: false,
key_cache_statements: false,
prepared_statements_from: false,
call_bare_name: false,
load_extension: true,
load_data: false,
do_expression_list: false,
lock_tables: false,
lock_instance: false,
rename_statement: false,
signal_diagnostics: false,
flush: false,
purge_binary_logs: false,
replication_statements: false,
};
}
impl TransactionSyntax {
pub const DUCKDB: Self = Self {
start_transaction: true,
start_transaction_block_optional: true,
transaction_work_keyword: true,
begin_transaction_keyword: true,
commit_transaction_keyword: true,
rollback_transaction_keyword: true,
transaction_name: false,
begin_transaction_modes: true,
transaction_savepoints: false,
set_transaction: false,
transaction_isolation_mode: false,
transaction_access_mode: true,
transaction_deferrable_mode: false,
start_transaction_isolation_mode: false,
start_transaction_deferrable_mode: false,
start_transaction_consistent_snapshot: false,
transaction_multiple_modes: false,
transaction_modes_require_commas: false,
transaction_modes_reject_duplicates: false,
abort_transaction_alias: true,
end_transaction_alias: true,
transaction_release: false,
transaction_chain: false,
release_savepoint_keyword_optional: true,
begin_transaction_mode: false,
xa_transactions: false,
};
}
impl ShowSyntax {
pub const DUCKDB: Self = Self {
describe_summarize: true,
show_tables: true,
describe: false,
session_statements: true,
set_value_reserved_words: DUCKDB_RESERVED_SET_VALUE_WORDS,
set_value_on_keyword: false,
set_value_null_keyword: true,
show_columns: false,
show_create_table: false,
show_functions: false,
show_routine_status: false,
show_verbose: false,
show_admin: false,
};
}
impl MaintenanceSyntax {
pub const DUCKDB: Self = Self {
checkpoint_database: true,
vacuum_analyze: true,
analyze: true,
analyze_columns: true,
vacuum: false,
reindex: false,
checkpoint: true,
table_maintenance: false,
};
}
impl AccessControlSyntax {
pub const DUCKDB: Self = Self {
alter_role_rename: true,
access_control: true,
access_control_extended_objects: true,
user_role_management: false,
access_control_account_grants: false,
};
}
impl FeatureSet {
pub const DUCKDB: Self = Self {
identifier_casing: Casing::Lower,
identifier_quotes: STANDARD_IDENTIFIER_QUOTES,
default_null_ordering: NullOrdering::NullsLast,
reserved_column_name: DUCKDB_RESERVED_COLUMN_NAME,
reserved_function_name: DUCKDB_RESERVED_FUNCTION_NAME,
reserved_type_name: DUCKDB_RESERVED_TYPE_NAME,
reserved_bare_alias: DUCKDB_RESERVED_BARE_ALIAS,
reserved_as_label: KeywordSet::EMPTY,
catalog_qualified_names: true,
byte_classes: DUCKDB_BYTE_CLASSES,
binding_powers: DUCKDB_BINDING_POWERS,
set_operation_powers: STANDARD_SET_OPERATION_BINDING_POWERS,
string_literals: StringLiteralSyntax::POSTGRES,
numeric_literals: NumericLiteralSyntax::DUCKDB,
parameters: ParameterSyntax {
anonymous_question: true,
positional_dollar: true,
positional_dollar_large: true,
named_colon: false,
named_at: false,
named_dollar: false,
numbered_question: false,
},
session_variables: SessionVariableSyntax::ANSI,
identifier_syntax: IdentifierSyntax {
non_ascii: super::NonAsciiIdentifierSyntax::Any,
dollar_in_identifiers: true,
string_literal_identifiers: false,
string_literal_table_names: true,
empty_quoted_identifiers: false,
},
table_expressions: TableExpressionSyntax::DUCKDB,
join_syntax: JoinSyntax::DUCKDB,
table_factor_syntax: TableFactorSyntax::DUCKDB,
expression_syntax: ExpressionSyntax::DUCKDB,
operator_syntax: OperatorSyntax::DUCKDB,
call_syntax: CallSyntax::DUCKDB,
string_func_forms: StringFuncForms::DUCKDB,
aggregate_call_syntax: AggregateCallSyntax::DUCKDB,
predicate_syntax: PredicateSyntax::DUCKDB,
pipe_operator: PipeOperator::StringConcat,
double_ampersand: DoubleAmpersand::Overlaps,
keyword_operators: KeywordOperators::DuckDb,
caret_operator: CaretOperator::Exponent,
hash_bitwise_xor: false,
comment_syntax: CommentSyntax::POSTGRES,
mutation_syntax: MutationSyntax {
data_modifying_ctes: false,
merge_insert_overriding: false,
merge_update_set_star: true,
merge_insert_star_by_name: true,
merge_error_action: true,
or_conflict_action: true,
insert_column_matching: true,
update_tuple_value_row_arity: true,
update_set_qualified_column: false,
insert_ignore: false,
insert_overwrite: false,
returning: true,
on_conflict: true,
on_duplicate_key_update: false,
multi_column_assignment: true,
where_current_of: true,
merge: true,
replace_into: false,
insert_set: false,
update_delete_tails: false,
joined_update_delete: false,
delete_using: true,
update_from: true,
delete_using_target_alias: true,
cte_before_insert: true,
cte_before_merge: true,
merge_when_not_matched_by: true,
merge_insert_default_values: true,
merge_insert_multirow: false,
},
statement_ddl_gates: StatementDdlGates {
colocation_groups: false,
create_trigger: false,
create_macro: true,
create_secret: true,
create_type: true,
create_virtual_table: false,
create_sequence: true,
databases: false,
schema_elements: false,
schemas: true,
drop_database: false,
materialized_views: true,
routines: true,
or_replace: true,
create_or_replace_table: true,
compound_statements: false,
extension_ddl: false,
transform_ddl: false,
alter_system: false,
tablespace_ddl: false,
logfile_group_ddl: false,
alter_database: true,
alter_database_options: false,
server_definition: false,
alter_instance: false,
spatial_reference_system: false,
resource_group: false,
alter_sequence: true,
alter_object_set_schema: true,
},
view_sequence_clause_syntax: ViewSequenceClauseSyntax {
create_sequence_cache: false,
materialized_view_to: false,
temporary_views: true,
recursive_views: true,
view_definition_options: false,
},
create_table_clause_syntax: CreateTableClauseSyntax {
declarative_partitioning: false,
table_inheritance: false,
like_source_table: false,
table_access_method: false,
without_oids: false,
typed_tables: false,
create_table_as_execute: false,
table_options: false,
without_rowid_table_option: false,
strict_table_option: false,
storage_parameters: true,
on_commit: true,
create_table_as_with_data: true,
statement_level_table_like: false,
unlogged_tables: true,
},
column_definition_syntax: ColumnDefinitionSyntax {
column_default_requires_b_expr: false,
column_storage: false,
generated_column_shorthand: true,
typeless_generated_columns: true,
column_conflict_resolution_clause: false,
typeless_column_definitions: false,
joined_autoincrement_attribute: false,
inline_primary_key_ordering: false,
named_column_collate_constraint: false,
identity_columns: true,
compact_identity_columns: false,
default_expression_requires_parens: false,
column_collation: true,
},
constraint_syntax: ConstraintSyntax {
exclusion_constraints: false,
index_constraint_parameters: false,
referential_action_cascade_set: false,
check_constraint_subqueries: false,
deferrable_constraints: true,
named_inline_non_check_constraints: true,
bare_constraint_name: false,
constraint_no_inherit_not_valid: true,
constraint_column_collate_order: false,
},
index_alter_syntax: IndexAlterSyntax {
alter_table_multiple_actions: false,
alter_nested_column_paths: true,
alter_table_set_options: true,
index_storage_parameters: true,
rename_constraint: true,
drop_primary_key: false,
alter_column_add_identity: false,
drop_behavior: true,
index_drop_on_table: false,
index_concurrently: true,
index_using_method: true,
partial_index: true,
index_if_not_exists: true,
index_nulls_order: true,
alter_table_extended: true,
alter_existence_guards: true,
alter_column_set_data_type: true,
routine_arg_types: true,
routine_arg_defaults: true,
routine_arg_modes: true,
routine_language_string: true,
},
existence_guards: ExistenceGuards::POSTGRES,
select_syntax: SelectSyntax::DUCKDB,
query_tail_syntax: QueryTailSyntax::DUCKDB,
grouping_syntax: GroupingSyntax::DUCKDB,
utility_syntax: UtilitySyntax::DUCKDB,
transaction_syntax: TransactionSyntax::DUCKDB,
show_syntax: ShowSyntax::DUCKDB,
maintenance_syntax: MaintenanceSyntax::DUCKDB,
access_control_syntax: AccessControlSyntax::DUCKDB,
type_name_syntax: TypeNameSyntax::DUCKDB,
target_spelling: TargetSpelling::Postgres,
};
}
pub const DUCKDB: FeatureSet = FeatureSet::DUCKDB;
const _: () = assert!(FeatureSet::DUCKDB.is_lexically_consistent());
const _: () = assert!(FeatureSet::DUCKDB.has_satisfied_feature_dependencies());
const _: () = assert!(FeatureSet::DUCKDB.has_no_grammar_conflict());
#[cfg(test)]
mod tests {
use super::*;
use crate::ast::{BinaryOperator, EqualsSpelling};
use crate::precedence::STANDARD_BINDING_POWERS;
#[test]
fn duckdb_is_postgres_plus_the_measured_deltas() {
let pg = FeatureSet::POSTGRES;
let duck = FeatureSet::DUCKDB;
assert_eq!(duck.numeric_literals, NumericLiteralSyntax::DUCKDB);
assert_eq!(duck.select_syntax, SelectSyntax::DUCKDB);
assert_eq!(duck.expression_syntax, ExpressionSyntax::DUCKDB);
assert_eq!(duck.table_expressions, TableExpressionSyntax::DUCKDB);
assert_eq!(duck.call_syntax, CallSyntax::DUCKDB);
assert_eq!(duck.type_name_syntax, TypeNameSyntax::DUCKDB);
assert_ne!(duck.numeric_literals, pg.numeric_literals);
assert_ne!(duck.select_syntax, pg.select_syntax);
assert_ne!(duck.expression_syntax, pg.expression_syntax);
assert_ne!(duck.table_expressions, pg.table_expressions);
assert_ne!(duck.call_syntax, pg.call_syntax);
assert_ne!(duck.type_name_syntax, pg.type_name_syntax);
assert_eq!(duck.binding_powers, DUCKDB_BINDING_POWERS);
assert_ne!(duck.numeric_literals, pg.numeric_literals);
assert_ne!(duck.select_syntax, pg.select_syntax);
assert_ne!(duck.expression_syntax, pg.expression_syntax);
assert_ne!(duck.binding_powers, pg.binding_powers);
assert_eq!(duck.reserved_column_name, DUCKDB_RESERVED_COLUMN_NAME);
assert_eq!(duck.reserved_function_name, DUCKDB_RESERVED_FUNCTION_NAME);
assert_eq!(duck.reserved_type_name, DUCKDB_RESERVED_TYPE_NAME);
assert_eq!(duck.reserved_bare_alias, DUCKDB_RESERVED_BARE_ALIAS);
assert_eq!(duck.utility_syntax, UtilitySyntax::DUCKDB);
assert_eq!(
duck.utility_syntax,
UtilitySyntax {
pragma: true,
use_statement: true,
use_qualified_name: true,
use_string_literal_name: true,
call: true,
attach: true,
load_bare_name: true,
reset_scope: true,
detach_if_exists: true,
export_import_database: true,
update_extensions: true,
do_statement: false,
prepare_typed_parameters: false,
..pg.utility_syntax
},
);
assert_eq!(duck.transaction_syntax, TransactionSyntax::DUCKDB);
assert_eq!(
duck.transaction_syntax,
TransactionSyntax {
start_transaction_block_optional: true,
transaction_savepoints: false,
set_transaction: false,
transaction_isolation_mode: false,
transaction_deferrable_mode: false,
start_transaction_isolation_mode: false,
start_transaction_deferrable_mode: false,
transaction_multiple_modes: false,
abort_transaction_alias: true,
end_transaction_alias: true,
transaction_chain: false,
..pg.transaction_syntax
},
);
assert_eq!(
duck.maintenance_syntax,
MaintenanceSyntax {
checkpoint_database: true,
vacuum_analyze: true,
analyze: true,
analyze_columns: true,
..pg.maintenance_syntax
},
);
assert_eq!(
duck.show_syntax,
ShowSyntax {
show_tables: true,
describe_summarize: true,
set_value_on_keyword: false,
set_value_null_keyword: true,
set_value_reserved_words: DUCKDB_RESERVED_SET_VALUE_WORDS,
..pg.show_syntax
},
);
assert!(duck.utility_syntax.pragma && !pg.utility_syntax.pragma);
assert!(duck.utility_syntax.use_statement && !pg.utility_syntax.use_statement);
assert!(duck.utility_syntax.prepared_statements && pg.utility_syntax.prepared_statements);
assert!(
!duck.utility_syntax.prepare_typed_parameters
&& pg.utility_syntax.prepare_typed_parameters
);
assert!(duck.utility_syntax.call && !pg.utility_syntax.call);
assert!(duck.utility_syntax.attach && !pg.utility_syntax.attach);
assert!(duck.maintenance_syntax.checkpoint && pg.maintenance_syntax.checkpoint);
assert!(duck.utility_syntax.load_extension && pg.utility_syntax.load_extension);
assert!(
duck.maintenance_syntax.checkpoint_database
&& !pg.maintenance_syntax.checkpoint_database
);
assert!(duck.utility_syntax.load_bare_name && !pg.utility_syntax.load_bare_name);
assert!(duck.utility_syntax.reset_scope && !pg.utility_syntax.reset_scope);
assert!(duck.utility_syntax.detach_if_exists && !pg.utility_syntax.detach_if_exists);
assert!(duck.show_syntax.show_tables && !pg.show_syntax.show_tables);
assert!(duck.show_syntax.describe_summarize && !pg.show_syntax.describe_summarize);
assert!(duck.utility_syntax.update_extensions && !pg.utility_syntax.update_extensions);
assert!(!duck.utility_syntax.do_statement && pg.utility_syntax.do_statement);
assert_eq!(duck.string_literals, pg.string_literals);
assert!(duck.parameters.anonymous_question);
assert!(!pg.parameters.anonymous_question);
assert_eq!(
ParameterSyntax {
anonymous_question: false,
..duck.parameters
},
pg.parameters,
);
assert!(!duck.mutation_syntax.data_modifying_ctes);
assert!(pg.mutation_syntax.data_modifying_ctes);
assert!(!duck.mutation_syntax.merge_insert_overriding);
assert!(pg.mutation_syntax.merge_insert_overriding);
assert!(duck.mutation_syntax.merge_update_set_star);
assert!(duck.mutation_syntax.merge_insert_star_by_name);
assert!(duck.mutation_syntax.merge_error_action);
assert!(!pg.mutation_syntax.merge_update_set_star);
assert!(duck.mutation_syntax.merge_when_not_matched_by);
assert!(duck.mutation_syntax.merge_insert_default_values);
assert!(!duck.mutation_syntax.update_set_qualified_column);
assert!(pg.mutation_syntax.update_set_qualified_column);
assert_eq!(
MutationSyntax {
data_modifying_ctes: true,
merge_insert_overriding: true,
merge_update_set_star: false,
merge_insert_star_by_name: false,
merge_error_action: false,
insert_column_matching: false,
or_conflict_action: false,
update_tuple_value_row_arity: false,
update_set_qualified_column: true,
..duck.mutation_syntax
},
pg.mutation_syntax,
);
assert!(duck.statement_ddl_gates.create_macro);
assert!(duck.statement_ddl_gates.create_or_replace_table);
assert!(duck.statement_ddl_gates.create_secret);
assert!(duck.statement_ddl_gates.create_type);
assert!(!pg.statement_ddl_gates.create_macro);
assert!(!pg.statement_ddl_gates.create_or_replace_table);
assert!(!pg.statement_ddl_gates.create_secret);
assert!(!pg.statement_ddl_gates.create_type);
assert!(!duck.column_definition_syntax.column_default_requires_b_expr);
assert!(pg.column_definition_syntax.column_default_requires_b_expr);
assert!(!duck.create_table_clause_syntax.declarative_partitioning);
assert!(pg.create_table_clause_syntax.declarative_partitioning);
assert!(!duck.create_table_clause_syntax.table_inheritance);
assert!(pg.create_table_clause_syntax.table_inheritance);
assert!(!duck.create_table_clause_syntax.like_source_table);
assert!(pg.create_table_clause_syntax.like_source_table);
assert!(duck.column_definition_syntax.column_collation);
assert!(duck.create_table_clause_syntax.unlogged_tables);
assert!(!duck.column_definition_syntax.column_storage);
assert!(pg.column_definition_syntax.column_storage);
assert!(!duck.create_table_clause_syntax.table_access_method);
assert!(pg.create_table_clause_syntax.table_access_method);
assert!(!duck.create_table_clause_syntax.without_oids);
assert!(pg.create_table_clause_syntax.without_oids);
assert!(!duck.create_table_clause_syntax.typed_tables);
assert!(pg.create_table_clause_syntax.typed_tables);
assert!(!duck.statement_ddl_gates.schema_elements);
assert!(pg.statement_ddl_gates.schema_elements);
assert!(!duck.statement_ddl_gates.databases);
assert!(pg.statement_ddl_gates.databases);
assert!(!duck.statement_ddl_gates.extension_ddl);
assert!(pg.statement_ddl_gates.extension_ddl);
assert!(!duck.statement_ddl_gates.transform_ddl);
assert!(pg.statement_ddl_gates.transform_ddl);
assert!(!duck.statement_ddl_gates.alter_system);
assert!(pg.statement_ddl_gates.alter_system);
assert_eq!(
StatementDdlGates {
create_macro: false,
create_secret: false,
create_type: false,
create_or_replace_table: false,
schema_elements: true,
databases: true,
extension_ddl: true,
transform_ddl: true,
alter_system: true,
tablespace_ddl: false,
logfile_group_ddl: false,
alter_database: false,
alter_sequence: false,
alter_object_set_schema: false,
..duck.statement_ddl_gates
},
pg.statement_ddl_gates,
);
assert_eq!(
CreateTableClauseSyntax {
declarative_partitioning: true,
table_inheritance: true,
like_source_table: true,
table_access_method: true,
without_oids: true,
typed_tables: true,
create_table_as_execute: true,
..duck.create_table_clause_syntax
},
pg.create_table_clause_syntax,
);
assert_eq!(
ColumnDefinitionSyntax {
column_default_requires_b_expr: true,
column_storage: true,
generated_column_shorthand: false,
typeless_generated_columns: false,
..duck.column_definition_syntax
},
pg.column_definition_syntax,
);
assert!(!duck.constraint_syntax.referential_action_cascade_set);
assert!(pg.constraint_syntax.referential_action_cascade_set);
assert!(!duck.constraint_syntax.check_constraint_subqueries);
assert!(pg.constraint_syntax.check_constraint_subqueries);
assert_eq!(
ConstraintSyntax {
exclusion_constraints: true,
index_constraint_parameters: true,
referential_action_cascade_set: true,
check_constraint_subqueries: true,
..duck.constraint_syntax
},
pg.constraint_syntax,
);
assert!(!duck.index_alter_syntax.alter_table_multiple_actions);
assert!(pg.index_alter_syntax.alter_table_multiple_actions);
assert!(duck.index_alter_syntax.alter_nested_column_paths);
assert!(!pg.index_alter_syntax.alter_nested_column_paths);
assert_eq!(
IndexAlterSyntax {
alter_table_multiple_actions: true,
alter_nested_column_paths: false,
..duck.index_alter_syntax
},
pg.index_alter_syntax,
);
assert_eq!(duck.target_spelling, pg.target_spelling);
assert_eq!(duck.identifier_casing, pg.identifier_casing);
}
#[test]
fn duckdb_reranks_the_arrow_and_double_equals_tokens() {
use crate::precedence::Side;
let duck = DUCKDB_BINDING_POWERS;
let arrow = duck.binary(&BinaryOperator::JsonGet);
assert!(arrow.left < duck.or.left, "`->` is looser than OR");
assert_eq!(arrow.assoc, Assoc::Left, "`x -> y -> z` groups left");
let double_eq = duck.binary(&BinaryOperator::Eq(EqualsSpelling::Double));
assert_eq!(
double_eq, duck.any_operator,
"`==` rides the generic-Op rank"
);
assert_eq!(double_eq.assoc, Assoc::Left, "`a == b == c` groups left");
assert!(
duck.comparison.left < double_eq.left,
"`==` binds tighter than the comparisons"
);
assert!(
double_eq.left < duck.additive.left,
"`==` binds looser than additive"
);
for untouched in [
BinaryOperator::Eq(EqualsSpelling::Single),
BinaryOperator::JsonGetText,
BinaryOperator::Contains,
BinaryOperator::ContainedBy,
] {
assert_eq!(
duck.binary(&untouched),
STANDARD_BINDING_POWERS.binary(&untouched),
);
}
assert!(!crate::precedence::needs_parens_between(
arrow,
duck.comparison,
Side::Right,
));
}
#[test]
fn duckdb_reserves_qualify_in_every_identifier_position() {
for (duck_set, shared) in [
(DUCKDB_RESERVED_COLUMN_NAME, RESERVED_COLUMN_NAME),
(DUCKDB_RESERVED_FUNCTION_NAME, RESERVED_FUNCTION_NAME),
(DUCKDB_RESERVED_TYPE_NAME, RESERVED_TYPE_NAME),
(DUCKDB_RESERVED_BARE_ALIAS, RESERVED_BARE_ALIAS),
] {
assert!(duck_set.contains(Keyword::Qualify));
assert!(!shared.contains(Keyword::Qualify));
}
assert_eq!(
DUCKDB_RESERVED_FUNCTION_NAME,
RESERVED_FUNCTION_NAME
.difference(DUCKDB_UNRESERVED_CARVEOUT)
.difference(DUCKDB_ORDINARY_SPECIAL_VALUE_NAMES)
.union(DUCKDB_QUALIFY_RESERVATION)
.union(DUCKDB_PIVOT_RESERVATION)
.union(DUCKDB_SEMI_ANTI_JOIN_RESERVATION)
);
assert_eq!(
DUCKDB_RESERVED_TYPE_NAME,
RESERVED_TYPE_NAME
.difference(DUCKDB_UNRESERVED_CARVEOUT)
.difference(DUCKDB_ORDINARY_SPECIAL_VALUE_NAMES)
.union(DUCKDB_QUALIFY_RESERVATION)
.union(DUCKDB_PIVOT_RESERVATION)
);
}
#[test]
fn duckdb_carves_its_unreserved_words_out_of_postgres_reservation() {
for keyword in [Keyword::Grant, Keyword::User] {
assert!(DUCKDB_UNRESERVED_CARVEOUT.contains(keyword));
assert!(!DUCKDB_RESERVED_COLUMN_NAME.contains(keyword));
assert!(!DUCKDB_RESERVED_FUNCTION_NAME.contains(keyword));
assert!(!DUCKDB_RESERVED_TYPE_NAME.contains(keyword));
assert!(!DUCKDB_RESERVED_SET_VALUE_WORDS.contains(keyword));
assert!(DUCKDB_RESERVED_BARE_ALIAS.contains(keyword));
}
}
#[test]
fn duckdb_special_value_names_are_ordinary_identifiers() {
for keyword in [
Keyword::CurrentCatalog,
Keyword::CurrentDate,
Keyword::CurrentRole,
Keyword::CurrentSchema,
Keyword::CurrentTime,
Keyword::CurrentTimestamp,
Keyword::CurrentUser,
Keyword::Localtime,
Keyword::Localtimestamp,
Keyword::SessionUser,
Keyword::SystemUser,
] {
assert!(DUCKDB_ORDINARY_SPECIAL_VALUE_NAMES.contains(keyword));
assert!(!DUCKDB_RESERVED_COLUMN_NAME.contains(keyword));
assert!(!DUCKDB_RESERVED_FUNCTION_NAME.contains(keyword));
assert!(!DUCKDB_RESERVED_TYPE_NAME.contains(keyword));
assert!(!DUCKDB_RESERVED_BARE_ALIAS.contains(keyword));
assert!(!DUCKDB_RESERVED_SET_VALUE_WORDS.contains(keyword));
}
}
#[test]
fn duckdb_reserves_pivot_and_unpivot_in_every_identifier_position() {
for kw in [Keyword::Pivot, Keyword::Unpivot] {
for (duck_set, shared) in [
(DUCKDB_RESERVED_COLUMN_NAME, RESERVED_COLUMN_NAME),
(DUCKDB_RESERVED_FUNCTION_NAME, RESERVED_FUNCTION_NAME),
(DUCKDB_RESERVED_TYPE_NAME, RESERVED_TYPE_NAME),
(DUCKDB_RESERVED_BARE_ALIAS, RESERVED_BARE_ALIAS),
] {
assert!(duck_set.contains(kw));
assert!(!shared.contains(kw));
}
}
}
#[test]
fn duckdb_reserves_the_join_words_as_colid_and_bare_alias_only() {
for kw in [Keyword::Asof, Keyword::Positional] {
assert!(DUCKDB_RESERVED_COLUMN_NAME.contains(kw));
assert!(DUCKDB_RESERVED_BARE_ALIAS.contains(kw));
assert!(!DUCKDB_RESERVED_FUNCTION_NAME.contains(kw));
assert!(!DUCKDB_RESERVED_TYPE_NAME.contains(kw));
for shared in [
RESERVED_COLUMN_NAME,
RESERVED_FUNCTION_NAME,
RESERVED_TYPE_NAME,
RESERVED_BARE_ALIAS,
] {
assert!(!shared.contains(kw));
}
}
assert_eq!(
DUCKDB_RESERVED_COLUMN_NAME,
RESERVED_COLUMN_NAME
.difference(DUCKDB_UNRESERVED_CARVEOUT)
.difference(DUCKDB_ORDINARY_SPECIAL_VALUE_NAMES)
.union(DUCKDB_QUALIFY_RESERVATION)
.union(DUCKDB_PIVOT_RESERVATION)
.union(DUCKDB_NONSTANDARD_JOIN_RESERVATION)
.union(DUCKDB_SEMI_ANTI_JOIN_RESERVATION)
);
assert_eq!(
DUCKDB_RESERVED_BARE_ALIAS,
RESERVED_BARE_ALIAS
.difference(DUCKDB_ORDINARY_SPECIAL_VALUE_NAMES)
.union(DUCKDB_UNRESERVED_BARE_ALIAS_RESERVATION)
.union(DUCKDB_QUALIFY_RESERVATION)
.union(DUCKDB_PIVOT_RESERVATION)
.union(DUCKDB_NONSTANDARD_JOIN_RESERVATION)
.union(DUCKDB_SEMI_ANTI_JOIN_RESERVATION)
);
}
#[test]
fn duckdb_reserves_semi_and_anti_as_colid_bare_alias_and_function() {
for kw in [Keyword::Semi, Keyword::Anti] {
assert!(DUCKDB_RESERVED_COLUMN_NAME.contains(kw));
assert!(DUCKDB_RESERVED_BARE_ALIAS.contains(kw));
assert!(DUCKDB_RESERVED_FUNCTION_NAME.contains(kw));
assert!(!DUCKDB_RESERVED_TYPE_NAME.contains(kw));
for shared in [
RESERVED_COLUMN_NAME,
RESERVED_FUNCTION_NAME,
RESERVED_TYPE_NAME,
RESERVED_BARE_ALIAS,
] {
assert!(!shared.contains(kw));
}
}
}
#[test]
fn duckdb_expression_deltas_are_additive_over_postgres() {
let (duck_expr, pg_expr) = (ExpressionSyntax::DUCKDB, ExpressionSyntax::POSTGRES);
let (duck_op, pg_op) = (OperatorSyntax::DUCKDB, OperatorSyntax::POSTGRES);
let (duck_call, pg_call) = (CallSyntax::DUCKDB, CallSyntax::POSTGRES);
let (duck_sf, pg_sf) = (StringFuncForms::DUCKDB, StringFuncForms::POSTGRES);
let (duck_ag, pg_ag) = (AggregateCallSyntax::DUCKDB, AggregateCallSyntax::POSTGRES);
assert!(duck_expr.collection_literals);
assert!(!pg_expr.collection_literals);
assert!(duck_expr.positional_column);
assert!(!pg_expr.positional_column);
assert!(duck_expr.lambda_keyword);
assert!(!pg_expr.lambda_keyword);
assert!(duck_expr.relaxed_interval_syntax);
assert!(!pg_expr.relaxed_interval_syntax);
assert!(duck_op.lambda_expressions);
assert!(!pg_op.lambda_expressions);
assert!(duck_op.double_equals);
assert!(!pg_op.double_equals);
assert!(duck_op.integer_divide_slash);
assert!(!pg_op.integer_divide_slash);
assert!(duck_call.columns_expression);
assert!(!pg_call.columns_expression);
assert!(duck_call.try_cast);
assert!(!pg_call.try_cast);
assert!(
duck_op.json_arrow_operators,
"lambda `->` rides the JSON-arrow lexeme"
);
assert!(pg_expr.field_wildcard);
assert!(!duck_expr.field_wildcard);
assert!(pg_expr.multidim_array_literals);
assert!(!duck_expr.multidim_array_literals);
assert_eq!(
duck_expr,
ExpressionSyntax {
collection_literals: true,
slice_step: true,
positional_column: true,
lambda_keyword: true,
relaxed_interval_syntax: true,
field_wildcard: false,
multidim_array_literals: false,
..pg_expr
},
);
assert!(pg_op.jsonb_operators);
assert!(!duck_op.jsonb_operators);
assert!(pg_op.custom_operators);
assert!(duck_op.custom_operators);
assert_eq!(FeatureSet::DUCKDB.caret_operator, CaretOperator::Exponent);
assert_eq!(
FeatureSet::DUCKDB.caret_operator,
FeatureSet::POSTGRES.caret_operator
);
assert!(pg_op.quantified_arbitrary_operator);
assert!(!duck_op.quantified_arbitrary_operator);
assert!(!pg_op.postfix_operators);
assert!(duck_op.postfix_operators);
assert_eq!(
duck_op,
OperatorSyntax {
lambda_expressions: true,
double_equals: true,
integer_divide_slash: true,
starts_with_operator: true,
jsonb_operators: false,
quantified_arbitrary_operator: false,
postfix_operators: true,
..pg_op
},
);
assert!(pg_call.sqljson_constructors_require_argument);
assert!(!duck_call.sqljson_constructors_require_argument);
assert!(pg_call.sqljson_expression_functions);
assert!(!duck_call.sqljson_expression_functions);
assert!(pg_call.xml_expression_functions);
assert!(!duck_call.xml_expression_functions);
assert!(pg_sf.substring_similar);
assert!(!duck_sf.substring_similar);
assert!(!pg_sf.overlay_requires_placing);
assert!(duck_sf.overlay_requires_placing);
assert_eq!(
duck_call,
CallSyntax {
columns_expression: true,
try_cast: true,
extract_string_field: true,
method_chaining: true,
sqljson_constructors_require_argument: false,
sqljson_expression_functions: false,
xml_expression_functions: false,
merge_action_function: false,
..pg_call
},
);
assert_eq!(
duck_ag,
AggregateCallSyntax {
null_treatment: true,
standalone_argument_order_by: true,
filter_optional_where: true,
..pg_ag
},
);
assert_eq!(
duck_sf,
StringFuncForms {
substring_similar: false,
overlay_requires_placing: true,
collation_for_expression: false,
..pg_sf
},
);
}
#[test]
fn duckdb_numeric_surface_relaxes_postgres_trailing_junk_reject() {
let (duck, pg) = (NumericLiteralSyntax::DUCKDB, NumericLiteralSyntax::POSTGRES);
assert!(duck.hex_integers && duck.octal_integers && duck.binary_integers);
assert!(duck.underscore_separators);
assert!(!duck.money_literals);
assert_eq!(duck.hex_integers, pg.hex_integers);
assert_eq!(duck.octal_integers, pg.octal_integers);
assert_eq!(duck.binary_integers, pg.binary_integers);
assert_eq!(duck.underscore_separators, pg.underscore_separators);
assert!(pg.reject_trailing_junk && !duck.reject_trailing_junk);
}
#[test]
fn duckdb_select_surface_is_postgres_modulo_the_documented_deltas() {
let (duck, pg) = (SelectSyntax::DUCKDB, SelectSyntax::POSTGRES);
let (duck_g, pg_g) = (GroupingSyntax::DUCKDB, GroupingSyntax::POSTGRES);
let (duck_q, pg_q) = (QueryTailSyntax::DUCKDB, QueryTailSyntax::POSTGRES);
assert!(!duck.empty_target_list);
assert!(pg.empty_target_list);
assert!(duck.qualify);
assert!(!pg.qualify);
assert!(duck_g.group_by_all && duck_g.order_by_all);
assert!(!pg_g.group_by_all && !pg_g.order_by_all);
assert!(duck.from_first);
assert!(!pg.from_first);
assert!(!duck_q.locking_clauses);
assert!(pg_q.locking_clauses);
assert!(!duck_q.key_lock_strengths && !duck_q.stacked_locking_clauses);
assert!(pg_q.key_lock_strengths && pg_q.stacked_locking_clauses);
assert!(duck.union_by_name);
assert!(!pg.union_by_name);
assert!(duck.wildcard_modifiers);
assert!(!pg.wildcard_modifiers);
assert!(duck.values_rows_require_equal_arity);
assert!(!pg.values_rows_require_equal_arity);
assert!(duck_q.limit_percent);
assert!(!pg_q.limit_percent);
assert!(duck.alias_string_literals);
assert!(!pg.alias_string_literals);
assert_eq!(
duck,
SelectSyntax {
empty_target_list: false,
qualify: true,
from_first: true,
explicit_table: true,
union_by_name: true,
wildcard_modifiers: true,
values_rows_require_equal_arity: true,
alias_string_literals: true,
bare_alias_string_literals: false,
trailing_comma: true,
prefix_colon_alias: true,
..pg
},
);
assert_eq!(
duck_g,
GroupingSyntax {
group_by_all: true,
group_by_set_quantifier: false,
order_by_all: true,
..pg_g
},
);
assert_eq!(
duck_q,
QueryTailSyntax {
locking_clauses: false,
key_lock_strengths: false,
stacked_locking_clauses: false,
using_sample: true,
limit_percent: true,
with_ties_requires_order_by: false,
..pg_q
},
);
}
#[test]
fn duckdb_closed_delta_axes_vs_postgres() {
crate::dialect::closed_delta::assert_closed_delta(
&FeatureSet::POSTGRES,
&FeatureSet::DUCKDB,
&[
"reserved_column_name",
"reserved_function_name",
"reserved_type_name",
"reserved_bare_alias",
"byte_classes",
"binding_powers",
"numeric_literals",
"parameters",
"identifier_syntax",
"table_expressions",
"join_syntax",
"table_factor_syntax",
"expression_syntax",
"operator_syntax",
"call_syntax",
"string_func_forms",
"aggregate_call_syntax",
"predicate_syntax",
"double_ampersand",
"keyword_operators",
"hash_bitwise_xor",
"mutation_syntax",
"statement_ddl_gates",
"view_sequence_clause_syntax",
"create_table_clause_syntax",
"column_definition_syntax",
"constraint_syntax",
"index_alter_syntax",
"select_syntax",
"query_tail_syntax",
"grouping_syntax",
"utility_syntax",
"transaction_syntax",
"show_syntax",
"maintenance_syntax",
"type_name_syntax",
],
);
}
}