From 6b56ded36f6550b79e33f0879bc1ebc04698e253 Mon Sep 17 00:00:00 2001 From: Steve Dignam Date: Sat, 31 May 2025 00:28:28 -0400 Subject: [PATCH] parser: fix more pg test suite errors part 3 unnamed function path types now work correctly when they're not named --- crates/squawk_lexer/src/lib.rs | 13 +- ...wk_lexer__tests__dollar_strings_part2.snap | 11 + .../src/generated/syntax_kind.rs | 3 +- crates/squawk_parser/src/grammar.rs | 256 +++++---- .../tests/data/ok/create_function.sql | 6 + .../data/regression_suite/alter_table.sql | 8 +- .../regression_suite/collate.icu.utf8.sql | 2 +- .../regression_suite/collate.linux.utf8.sql | 2 +- .../tests/data/regression_suite/stats.sql | 12 +- .../snapshots/tests__alter_aggregate_ok.snap | 26 +- .../snapshots/tests__alter_domain_ok.snap | 8 +- .../snapshots/tests__alter_extension_ok.snap | 10 +- .../snapshots/tests__alter_function_ok.snap | 5 +- .../tests__alter_operator_family_ok.snap | 15 +- .../snapshots/tests__alter_procedure_ok.snap | 5 +- .../snapshots/tests__alter_table_err.snap | 57 +- .../snapshots/tests__alter_table_ok.snap | 32 +- .../snapshots/tests__alter_table_pg17_ok.snap | 1 - .../tests/snapshots/tests__comment_ok.snap | 15 +- .../snapshots/tests__create_aggregate_ok.snap | 46 +- .../snapshots/tests__create_cast_ok.snap | 5 +- .../snapshots/tests__create_domain_ok.snap | 13 +- .../tests__create_foreign_table_ok.snap | 7 +- .../snapshots/tests__create_function_ok.snap | 153 ++++- .../tests__create_operator_class_ok.snap | 15 +- .../snapshots/tests__create_table_err.snap | 1 - .../snapshots/tests__create_table_ok.snap | 101 ++-- .../snapshots/tests__drop_aggregate_ok.snap | 21 +- .../snapshots/tests__drop_function_ok.snap | 10 +- .../snapshots/tests__drop_procedure_ok.snap | 10 +- .../snapshots/tests__drop_routine_ok.snap | 10 +- .../tests/snapshots/tests__misc_ok.snap | 10 +- .../tests__regression_alter_table.snap | 140 ----- .../tests__regression_btree_index.snap | 34 -- .../tests__regression_collate.icu.utf8.snap | 20 - .../tests__regression_collate.linux.utf8.snap | 19 - .../tests__regression_constraints.snap | 542 ------------------ .../tests__regression_create_index.snap | 12 - .../tests__regression_create_table_like.snap | 25 - .../snapshots/tests__regression_domain.snap | 13 - .../tests__regression_drop_if_exists.snap | 10 - .../tests__regression_foreign_key.snap | 68 --- .../tests__regression_generated_virtual.snap | 23 - .../snapshots/tests__regression_inherit.snap | 274 --------- .../snapshots/tests__regression_matview.snap | 9 - .../snapshots/tests__regression_misc.snap | 18 - .../tests__regression_namespace.snap | 3 - .../tests__regression_object_address.snap | 18 - .../snapshots/tests__regression_oidjoins.snap | 7 - .../tests__regression_partition_join.snap | 6 - .../snapshots/tests__regression_plpgsql.snap | 476 +-------------- .../tests__regression_privileges.snap | 12 - .../tests__regression_rowsecurity.snap | 3 - .../tests__regression_select_into.snap | 24 - .../tests__regression_sqljson_jsontable.snap | 1 - .../tests__regression_sqljson_queryfuncs.snap | 1 - .../snapshots/tests__regression_stats.snap | 41 +- .../tests__regression_suite_errors.snap | 41 +- .../tests__regression_tablespace.snap | 16 - .../snapshots/tests__regression_temp.snap | 20 - .../tests/snapshots/tests__reindex_ok.snap | 48 +- .../snapshots/tests__security_label_ok.snap | 20 +- crates/squawk_parser/tests/tests.rs | 5 +- .../squawk_syntax/src/ast/generated/nodes.rs | 179 +++--- crates/squawk_syntax/src/postgresql.ungram | 27 +- ...st__alter_aggregate_params_validation.snap | 10 +- ...t__create_aggregate_params_validation.snap | 10 +- ...est__drop_aggregate_params_validation.snap | 20 +- s/lint | 2 +- 69 files changed, 789 insertions(+), 2297 deletions(-) create mode 100644 crates/squawk_lexer/src/snapshots/squawk_lexer__tests__dollar_strings_part2.snap delete mode 100644 crates/squawk_parser/tests/snapshots/tests__regression_alter_table.snap delete mode 100644 crates/squawk_parser/tests/snapshots/tests__regression_btree_index.snap delete mode 100644 crates/squawk_parser/tests/snapshots/tests__regression_collate.icu.utf8.snap delete mode 100644 crates/squawk_parser/tests/snapshots/tests__regression_collate.linux.utf8.snap delete mode 100644 crates/squawk_parser/tests/snapshots/tests__regression_constraints.snap delete mode 100644 crates/squawk_parser/tests/snapshots/tests__regression_generated_virtual.snap delete mode 100644 crates/squawk_parser/tests/snapshots/tests__regression_matview.snap delete mode 100644 crates/squawk_parser/tests/snapshots/tests__regression_object_address.snap delete mode 100644 crates/squawk_parser/tests/snapshots/tests__regression_oidjoins.snap delete mode 100644 crates/squawk_parser/tests/snapshots/tests__regression_partition_join.snap delete mode 100644 crates/squawk_parser/tests/snapshots/tests__regression_select_into.snap delete mode 100644 crates/squawk_parser/tests/snapshots/tests__regression_tablespace.snap delete mode 100644 crates/squawk_parser/tests/snapshots/tests__regression_temp.snap diff --git a/crates/squawk_lexer/src/lib.rs b/crates/squawk_lexer/src/lib.rs index 5850bae2..2de421f2 100644 --- a/crates/squawk_lexer/src/lib.rs +++ b/crates/squawk_lexer/src/lib.rs @@ -389,6 +389,7 @@ impl Cursor<'_> { } } + // we have a dollar quoted string deliminated with `$$` if start.is_empty() { loop { self.eat_while(|c| c != '$'); @@ -428,9 +429,9 @@ impl Cursor<'_> { } // closing '$' - if self.first() == '$' { + let terminated = match_count == start.len(); + if self.first() == '$' && terminated { self.bump(); - let terminated = match_count == start.len(); return TokenKind::Literal { kind: LiteralKind::DollarQuotedString { terminated }, }; @@ -586,6 +587,14 @@ $foo$hello$world$bar$ "#)) } + #[test] + fn dollar_strings_part2() { + assert_debug_snapshot!(lex(r#" +DO $doblock$ +end +$doblock$;"#)) + } + #[test] fn dollar_quote_mismatch_tags_simple() { assert_debug_snapshot!(lex(r#" diff --git a/crates/squawk_lexer/src/snapshots/squawk_lexer__tests__dollar_strings_part2.snap b/crates/squawk_lexer/src/snapshots/squawk_lexer__tests__dollar_strings_part2.snap new file mode 100644 index 00000000..7f926b9e --- /dev/null +++ b/crates/squawk_lexer/src/snapshots/squawk_lexer__tests__dollar_strings_part2.snap @@ -0,0 +1,11 @@ +--- +source: crates/squawk_lexer/src/lib.rs +expression: "lex(r#\"\nDO $doblock$\nend\n$doblock$;\"#)" +--- +[ + "\n" @ Whitespace, + "DO" @ Ident, + " " @ Whitespace, + "$doblock$\nend\n$doblock$" @ Literal { kind: DollarQuotedString { terminated: true } }, + ";" @ Semi, +] diff --git a/crates/squawk_parser/src/generated/syntax_kind.rs b/crates/squawk_parser/src/generated/syntax_kind.rs index 29d8c8a7..99efa1fe 100644 --- a/crates/squawk_parser/src/generated/syntax_kind.rs +++ b/crates/squawk_parser/src/generated/syntax_kind.rs @@ -630,7 +630,6 @@ pub enum SyntaxKind { CONSTRAINT_INCLUDE_CLAUSE, CONSTRAINT_INDEX_METHOD, CONSTRAINT_INDEX_TABLESPACE, - CONSTRAINT_OPTION_LIST, CONSTRAINT_STORAGE_PARAMS, CONSTRAINT_WHERE_CLAUSE, COPY, @@ -748,6 +747,7 @@ pub enum SyntaxKind { ENABLE_RLS, ENABLE_RULE, ENABLE_TRIGGER, + ENFORCED, EXCLUDE_CONSTRAINT, EXECUTE, EXPLAIN, @@ -817,6 +817,7 @@ pub enum SyntaxKind { NOTIFY, NOT_DEFERRABLE, NOT_DEFERRABLE_CONSTRAINT_OPTION, + NOT_ENFORCED, NOT_ILIKE, NOT_IN, NOT_LIKE, diff --git a/crates/squawk_parser/src/grammar.rs b/crates/squawk_parser/src/grammar.rs index 95ae19dd..b76fd8a3 100644 --- a/crates/squawk_parser/src/grammar.rs +++ b/crates/squawk_parser/src/grammar.rs @@ -1431,8 +1431,12 @@ fn opt_path(p: &mut Parser<'_>, kind: SyntaxKind) -> Option { Some(path_for_qualifier(p, qual, kind)) } +fn opt_path_name(p: &mut Parser<'_>) -> Option { + opt_path(p, NAME) +} + fn path_name(p: &mut Parser<'_>) { - if opt_path(p, NAME).is_none() { + if opt_path_name(p).is_none() { p.error("expected path name"); } } @@ -3240,7 +3244,7 @@ fn opt_column_constraint(p: &mut Parser<'_>) -> Option { } match opt_constraint_inner(p) { Some(kind) => { - opt_constraint_options(p); + opt_constraint_option_list(p); Some(m.complete(p, kind)) } None => { @@ -3283,9 +3287,7 @@ fn opt_constraint_inner(p: &mut Parser<'_>) -> Option { p.error("expected expression"); } p.expect(R_PAREN); - if p.eat(NO_KW) { - p.expect(INHERIT_KW); - } + opt_no_inherit(p); CHECK_CONSTRAINT } DEFAULT_KW => { @@ -3306,9 +3308,7 @@ fn opt_constraint_inner(p: &mut Parser<'_>) -> Option { p.error("expected an expression"); } p.expect(R_PAREN); - if !p.eat(STORED_KW) && !p.eat(VIRTUAL_KW) { - p.error("expected STORED or VIRTUAL"); - } + opt_virtual_or_stored(p); GENERATED_CONSTRAINT // { ALWAYS | BY DEFAULT } AS IDENTITY [ ( sequence_options ) ] } else if p.at(ALWAYS_KW) || p.at(BY_KW) { @@ -3323,9 +3323,7 @@ fn opt_constraint_inner(p: &mut Parser<'_>) -> Option { p.error("expected an expression"); } p.expect(R_PAREN); - if !p.eat(STORED_KW) && !p.eat(VIRTUAL_KW) { - p.error("expected STORED or VIRTUAL"); - } + opt_virtual_or_stored(p); } else { p.expect(IDENTITY_KW); opt_sequence_options(p); @@ -3379,6 +3377,21 @@ fn opt_constraint_inner(p: &mut Parser<'_>) -> Option { Some(kind) } +fn opt_virtual_or_stored(p: &mut Parser<'_>) { + let _ = p.eat(STORED_KW) || p.eat(VIRTUAL_KW); +} + +fn opt_no_inherit(p: &mut Parser<'_>) { + let m = p.start(); + if p.eat(NO_KW) { + if p.eat(INHERIT_KW) { + m.complete(p, NO_INHERIT); + } + } else { + m.abandon(p); + } +} + // [ ON DELETE referential_action ] // [ ON UPDATE referential_action ] fn foreign_key_actions(p: &mut Parser<'_>) { @@ -3501,6 +3514,7 @@ const TABLE_CONSTRAINT_FIRST: TokenSet = TokenSet::new(&[ PRIMARY_KW, EXCLUDE_KW, FOREIGN_KW, + NOT_KW, ]); // and table_constraint is: @@ -3533,9 +3547,6 @@ fn table_constraint(p: &mut Parser<'_>) -> CompletedMarker { p.error("expected expr"); } p.expect(R_PAREN); - if p.eat(NO_KW) { - p.expect(INHERIT_KW); - } CHECK_CONSTRAINT } // UNIQUE [ NULLS [ NOT ] DISTINCT ] ( column_name [, ... ] ) index_parameters @@ -3608,6 +3619,12 @@ fn table_constraint(p: &mut Parser<'_>) -> CompletedMarker { } EXCLUDE_CONSTRAINT } + NOT_KW => { + p.bump(NOT_KW); + p.expect(NULL_KW); + name_ref(p); + NOT_NULL_CONSTRAINT + } // FOREIGN KEY ( column_name [, ... ] ) REFERENCES reftable [ ( refcolumn [, ... ] ) ] // [ MATCH FULL | MATCH PARTIAL | MATCH SIMPLE ] [ ON DELETE referential_action ] [ ON UPDATE referential_action ] } _ => { @@ -3641,8 +3658,9 @@ fn table_constraint(p: &mut Parser<'_>) -> CompletedMarker { FOREIGN_KEY_CONSTRAINT } }; - opt_constraint_options(p); - m.complete(p, kind) + let cm = m.complete(p, kind); + opt_constraint_option_list(p); + cm } fn opt_without_overlaps(p: &mut Parser<'_>) { @@ -3651,68 +3669,61 @@ fn opt_without_overlaps(p: &mut Parser<'_>) { } } -fn opt_deferrable_constraint_option(p: &mut Parser<'_>) -> Option { - let m = p.start(); - let kind = match (p.current(), p.nth(1)) { - (DEFERRABLE_KW, _) => { - p.bump(DEFERRABLE_KW); - DEFERRABLE_CONSTRAINT_OPTION - } - (NOT_KW, DEFERRABLE_KW) => { - p.bump(NOT_KW); - p.bump(DEFERRABLE_KW); - NOT_DEFERRABLE_CONSTRAINT_OPTION - } - _ => { - m.abandon(p); - return None; - } - }; - Some(m.complete(p, kind)) -} - -fn opt_initally_constraint_option(p: &mut Parser<'_>) -> Option { - let m = p.start(); - let kind = match (p.current(), p.nth(1)) { - (INITIALLY_KW, DEFERRED_KW) => { - p.bump(INITIALLY_KW); - p.bump(DEFERRED_KW); - INITIALLY_DEFERRED_CONSTRAINT_OPTION - } - (INITIALLY_KW, IMMEDIATE_KW) => { - p.bump(INITIALLY_KW); - p.bump(IMMEDIATE_KW); - INITIALLY_IMMEDIATE_CONSTRAINT_OPTION - } - _ => { - m.abandon(p); - return None; - } - }; - Some(m.complete(p, kind)) -} - // [ NOT DEFERRABLE | [ DEFERRABLE ] [ INITIALLY IMMEDIATE | INITIALLY DEFERRED ] ] -fn opt_constraint_options(p: &mut Parser<'_>) { - let m = p.start(); - let deferrable = opt_deferrable_constraint_option(p); - let initially = opt_initally_constraint_option(p); - - match (deferrable, initially) { - (None, None) => { - m.abandon(p); - return; - } - (Some(deferrable), Some(initially)) => { - if deferrable.kind() == NOT_DEFERRABLE_CONSTRAINT_OPTION - && initially.kind() == INITIALLY_DEFERRED_CONSTRAINT_OPTION - { - p.error("constraint declared INITIALLY DEFERRED must be DEFERRABLE"); +fn opt_constraint_option_list(p: &mut Parser<'_>) { + // TODO: validation for these + while !p.at(EOF) { + let m = p.start(); + let kind = match (p.current(), p.nth(1)) { + (DEFERRABLE_KW, _) => { + p.bump(DEFERRABLE_KW); + DEFERRABLE_CONSTRAINT_OPTION + } + (NOT_KW, DEFERRABLE_KW) => { + p.bump(NOT_KW); + p.bump(DEFERRABLE_KW); + NOT_DEFERRABLE_CONSTRAINT_OPTION + } + (INITIALLY_KW, DEFERRED_KW) => { + p.bump(INITIALLY_KW); + p.bump(DEFERRED_KW); + INITIALLY_DEFERRED_CONSTRAINT_OPTION + } + (INITIALLY_KW, IMMEDIATE_KW) => { + p.bump(INITIALLY_KW); + p.bump(IMMEDIATE_KW); + INITIALLY_IMMEDIATE_CONSTRAINT_OPTION + } + (NOT_KW, VALID_KW) => { + p.bump(NOT_KW); + p.bump(VALID_KW); + NOT_VALID + } + (NO_KW, INHERIT_KW) => { + p.bump(NO_KW); + p.bump(INHERIT_KW); + NO_INHERIT + } + (INHERIT_KW, _) => { + p.bump(INHERIT_KW); + INHERIT + } + (NOT_KW, ENFORCED_KW) => { + p.bump(NOT_KW); + p.bump(ENFORCED_KW); + NOT_ENFORCED + } + (ENFORCED_KW, _) => { + p.bump(ENFORCED_KW); + ENFORCED + } + (_, _) => { + m.abandon(p); + break; } - } - (_, _) => (), + }; + m.complete(p, kind); } - m.complete(p, CONSTRAINT_OPTION_LIST); } const COLUMN_NAME_KEYWORDS: TokenSet = TokenSet::new(&[ @@ -3811,16 +3822,18 @@ fn col_def(p: &mut Parser<'_>, t: ColDefType) -> Option { name_ref(p); match t { ColDefType::WithData => { - type_name(p); - // [ STORAGE { PLAIN | EXTERNAL | EXTENDED | MAIN | DEFAULT } ] - if p.eat(STORAGE_KW) && (p.at(DEFAULT_KW) || p.at(IDENT)) { - p.bump_any(); - } - // [ COMPRESSION compression_method ] - if p.eat(COMPRESSION_KW) && (p.at(DEFAULT_KW) || p.at(IDENT)) { - p.bump_any(); + // TODO: validation to check for missing types + if opt_type_name(p) { + // [ STORAGE { PLAIN | EXTERNAL | EXTENDED | MAIN | DEFAULT } ] + if p.eat(STORAGE_KW) && (p.at(DEFAULT_KW) || p.at(IDENT)) { + p.bump_any(); + } + // [ COMPRESSION compression_method ] + if p.eat(COMPRESSION_KW) && (p.at(DEFAULT_KW) || p.at(IDENT)) { + p.bump_any(); + } + opt_collate(p); } - opt_collate(p); } ColDefType::ColumnNameOnly => { // [ WITH OPTIONS ] @@ -5894,13 +5907,25 @@ fn alter_index(p: &mut Parser<'_>) -> CompletedMarker { ALTER_KW => { p.bump(ALTER_KW); p.eat(COLUMN_KW); - if opt_numeric_literal(p).is_none() { - p.error("expected numeric literal"); + if opt_numeric_literal(p).is_none() && opt_name_ref(p).is_none() { + p.error("expected numeric literal or name"); } p.expect(SET_KW); - p.expect(STATISTICS_KW); - if opt_numeric_literal(p).is_none() { - p.error("expected numeric literal"); + if p.eat(L_PAREN) { + while !p.at(EOF) && !p.at(R_PAREN) { + if !attribute_option(p, AttributeValue::Either) { + break; + } + if !p.eat(COMMA) { + break; + } + } + p.expect(R_PAREN); + } else { + p.expect(STATISTICS_KW); + if opt_numeric_literal(p).is_none() { + p.error("expected numeric literal"); + } } } _ => { @@ -6446,9 +6471,7 @@ fn alter_domain_action(p: &mut Parser<'_>) -> Option { ADD_KW => { p.bump(ADD_KW); domain_constraint(p); - if p.eat(NOT_KW) { - p.expect(VALID_KW); - } + opt_constraint_option_list(p); ADD_CONSTRAINT } RENAME_KW => { @@ -8006,7 +8029,7 @@ fn create_domain(p: &mut Parser<'_>) -> CompletedMarker { let m = p.start(); p.bump(CREATE_KW); p.bump(DOMAIN_KW); - name(p); + path_name(p); p.eat(AS_KW); type_name(p); opt_collate(p); @@ -9240,6 +9263,9 @@ fn drop_collation(p: &mut Parser<'_>) -> CompletedMarker { p.bump(COLLATION_KW); opt_if_exists(p); path_name_ref(p); + while !p.at(EOF) && p.eat(COMMA) { + path_name_ref(p); + } opt_cascade_or_restrict(p); m.complete(p, DROP_COLLATION) } @@ -10732,7 +10758,7 @@ fn reindex(p: &mut Parser<'_>) -> CompletedMarker { } }; p.eat(CONCURRENTLY_KW); - if opt_name(p).is_none() && name_required { + if opt_path_name(p).is_none() && name_required { p.error("expected name"); } m.complete(p, REINDEX) @@ -10839,9 +10865,7 @@ fn prepare(p: &mut Parser<'_>) -> CompletedMarker { ); if let Some(statement) = statement { match statement.kind() { - SELECT | COMPOUND_SELECT | SELECT_INTO | VALUES | INSERT | UPDATE | DELETE | MERGE => { - () - } + SELECT | COMPOUND_SELECT | SELECT_INTO | VALUES | INSERT | UPDATE | DELETE | MERGE => {} kind => { p.error(format!( "expected SELECT, INSERT, UPDATE, DELETE, MERGE, or VALUES statement, got {:?}", @@ -11428,7 +11452,7 @@ fn create_trigger(p: &mut Parser<'_>) -> CompletedMarker { path_name_ref(p); } // [ NOT DEFERRABLE | [ DEFERRABLE ] [ INITIALLY IMMEDIATE | INITIALLY DEFERRED ] ] - opt_constraint_options(p); + opt_constraint_option_list(p); // [ REFERENCING { { OLD | NEW } TABLE [ AS ] transition_relation_name } [ ... ] ] if p.eat(REFERENCING_KW) { while !p.at(EOF) { @@ -11590,7 +11614,7 @@ fn create_schema(p: &mut Parser<'_>) -> CompletedMarker { fn query(p: &mut Parser<'_>) { // TODO: this needs to be more general - if !p.at_ts(SELECT_FIRST) || select(p, None).is_none() { + if (!p.at_ts(SELECT_FIRST) || select(p, None).is_none()) && paren_select(p).is_none() { p.error("expected select stmt") } } @@ -12154,15 +12178,6 @@ const TYPE_FUNC_NAME_KEYWORDS: TokenSet = TokenSet::new(&[ VERBOSE_KW, ]); -fn opt_param_name(p: &mut Parser<'_>) -> bool { - if p.at(IDENT) || p.at_ts(UNRESERVED_KEYWORDS) || p.at_ts(TYPE_FUNC_NAME_KEYWORDS) { - p.bump_any(); - true - } else { - false - } -} - // [ argmode ] [ argname ] argtype [ { DEFAULT | = } default_expr ] // // func_arg: @@ -12175,12 +12190,12 @@ fn param(p: &mut Parser<'_>) { let m = p.start(); // [ argmode ] let param_mode_seen = opt_param_mode(p).is_some(); - let name_or_type = p.start(); // [ argname ] - let maybe_name = opt_param_name(p); + let maybe_name = + p.at(IDENT) || p.at_ts(UNRESERVED_KEYWORDS) || p.at_ts(TYPE_FUNC_NAME_KEYWORDS); if maybe_name { // Could have either parsed a name or a type, we know if it it's a type if: - let at_type = match p.current() { + let at_type = match p.nth(1) { // foo.bar%type // ^ DOT => true, @@ -12198,9 +12213,9 @@ fn param(p: &mut Parser<'_>) { _ => false, }; if at_type { - type_mods(p, name_or_type, true, PATH_TYPE); + type_name(p); } else { - name_or_type.complete(p, NAME); + name(p); if !param_mode_seen { opt_param_mode(p); } @@ -12208,7 +12223,6 @@ fn param(p: &mut Parser<'_>) { type_name(p); } } else { - name_or_type.abandon(p); // argtype type_name(p); } @@ -13104,7 +13118,6 @@ fn alter_table_action(p: &mut Parser<'_>) -> Option { if p.at_ts(TABLE_CONSTRAINT_FIRST) { // at table_constraint or table_constraint_using_index table_constraint(p); - opt_not_valid(p); ADD_CONSTRAINT } else { // [ COLUMN ] [ IF NOT EXISTS ] column_name data_type [ COLLATE collation ] [ column_constraint [ ... ] ] @@ -13258,7 +13271,7 @@ fn alter_table_action(p: &mut Parser<'_>) -> Option { if p.eat(CONSTRAINT_KW) { // name name_ref(p); - opt_constraint_options(p); + opt_constraint_option_list(p); ALTER_CONSTRAINT } else { p.eat(COLUMN_KW); @@ -13282,17 +13295,6 @@ fn alter_table_action(p: &mut Parser<'_>) -> Option { Some(kind) } -fn opt_not_valid(p: &mut Parser<'_>) -> Option { - if p.at(NOT_KW) { - let m = p.start(); - p.bump(NOT_KW); - p.expect(VALID_KW); - Some(m.complete(p, NOT_VALID)) - } else { - None - } -} - // /* Column label --- allowed labels in "AS" clauses. // * This presently includes *all* Postgres keywords. // */ diff --git a/crates/squawk_parser/tests/data/ok/create_function.sql b/crates/squawk_parser/tests/data/ok/create_function.sql index 0928f5f8..d520a5bb 100644 --- a/crates/squawk_parser/tests/data/ok/create_function.sql +++ b/crates/squawk_parser/tests/data/ok/create_function.sql @@ -409,3 +409,9 @@ as '' language sql; create function f (internal, text[], bool) returns void as '' language sql; + +-- path type +create function f (foo.bar.buzz.boo, t.u[], bool) +returns void +as '' language sql; + diff --git a/crates/squawk_parser/tests/data/regression_suite/alter_table.sql b/crates/squawk_parser/tests/data/regression_suite/alter_table.sql index 7e40e399..a269a28d 100644 --- a/crates/squawk_parser/tests/data/regression_suite/alter_table.sql +++ b/crates/squawk_parser/tests/data/regression_suite/alter_table.sql @@ -1024,7 +1024,7 @@ alter table atacc1 drop bar; alter table atacc1 SET WITHOUT OIDS; -- try adding an oid column, should fail (not supported) -alter table atacc1 SET WITH OIDS; +-- alter table atacc1 SET WITH OIDS; -- try dropping the xmin column, should fail alter table atacc1 drop xmin; @@ -1132,15 +1132,15 @@ copy attest to stdout; copy attest(a) to stdout; copy attest("........pg.dropped.1........") to stdout; copy attest from stdin; -10 11 12 +-- 10 11 12 select * from attest; copy attest from stdin; -21 22 +-- 21 22 select * from attest; copy attest(a) from stdin; copy attest("........pg.dropped.1........") from stdin; copy attest(b,c) from stdin; -31 32 +-- 31 32 select * from attest; drop table attest; diff --git a/crates/squawk_parser/tests/data/regression_suite/collate.icu.utf8.sql b/crates/squawk_parser/tests/data/regression_suite/collate.icu.utf8.sql index ce674e32..82bef132 100644 --- a/crates/squawk_parser/tests/data/regression_suite/collate.icu.utf8.sql +++ b/crates/squawk_parser/tests/data/regression_suite/collate.icu.utf8.sql @@ -421,7 +421,7 @@ ALTER COLLATION "en-x-icu" REFRESH VERSION; -- also test for database while we are here SELECT current_database() AS datname ; -ALTER DATABASE :"datname" REFRESH COLLATION VERSION; +ALTER DATABASE "datname" REFRESH COLLATION VERSION; -- dependencies diff --git a/crates/squawk_parser/tests/data/regression_suite/collate.linux.utf8.sql b/crates/squawk_parser/tests/data/regression_suite/collate.linux.utf8.sql index 691305ad..a6c2f94f 100644 --- a/crates/squawk_parser/tests/data/regression_suite/collate.linux.utf8.sql +++ b/crates/squawk_parser/tests/data/regression_suite/collate.linux.utf8.sql @@ -407,7 +407,7 @@ ALTER COLLATION "en_US" REFRESH VERSION; -- also test for database while we are here SELECT current_database() AS datname ; -ALTER DATABASE :"datname" REFRESH COLLATION VERSION; +ALTER DATABASE "datname" REFRESH COLLATION VERSION; -- dependencies diff --git a/crates/squawk_parser/tests/data/regression_suite/stats.sql b/crates/squawk_parser/tests/data/regression_suite/stats.sql index 4daecd9f..9942ffc2 100644 --- a/crates/squawk_parser/tests/data/regression_suite/stats.sql +++ b/crates/squawk_parser/tests/data/regression_suite/stats.sql @@ -393,7 +393,7 @@ SELECT shobj_description(d.oid, 'pg_database') as description_before -- force some stats in pg_shdescription. BEGIN; SELECT current_database() as datname ; -COMMENT ON DATABASE :"datname" IS 'This is a test comment'; +COMMENT ON DATABASE "datname" IS 'This is a test comment'; SELECT pg_stat_force_next_flush(); COMMIT; @@ -405,8 +405,8 @@ SELECT (n_tup_ins + n_tup_upd) > 0 AS has_data FROM pg_stat_all_tables WHERE relid = 'pg_shdescription'::regclass; -- set back comment - COMMENT ON DATABASE :"datname" IS 'description_before'; - COMMENT ON DATABASE :"datname" IS NULL; + COMMENT ON DATABASE "datname" IS 'description_before'; + COMMENT ON DATABASE "datname" IS NULL; ----- -- Test that various stats views are being properly populated @@ -625,13 +625,13 @@ SELECT sum(extends) AS my_io_sum_shared_before_extends WHERE context = 'normal' AND object = 'relation' ; SELECT sum(writes) AS writes, sum(fsyncs) AS fsyncs FROM pg_stat_io - WHERE object = 'relation' ; io_sum_shared_before_ + WHERE object = 'relation' ; -- io_sum_shared_before_ SELECT sum(writes) AS writes, sum(fsyncs) AS fsyncs FROM pg_stat_get_backend_io(pg_backend_pid()) - WHERE object = 'relation' ; my_io_sum_shared_before_ + WHERE object = 'relation' ; -- my_io_sum_shared_before_ SELECT sum(writes) AS writes, sum(fsyncs) AS fsyncs FROM pg_stat_io - WHERE context = 'normal' AND object = 'wal' ; io_sum_wal_normal_before_ + WHERE context = 'normal' AND object = 'wal' ; -- io_sum_wal_normal_before_ CREATE TABLE test_io_shared(a int); INSERT INTO test_io_shared SELECT i FROM generate_series(1,100)i; SELECT pg_stat_force_next_flush(); diff --git a/crates/squawk_parser/tests/snapshots/tests__alter_aggregate_ok.snap b/crates/squawk_parser/tests/snapshots/tests__alter_aggregate_ok.snap index cf9c0700..a2941d32 100644 --- a/crates/squawk_parser/tests/snapshots/tests__alter_aggregate_ok.snap +++ b/crates/squawk_parser/tests/snapshots/tests__alter_aggregate_ok.snap @@ -1,7 +1,6 @@ --- source: crates/squawk_parser/tests/tests.rs input_file: crates/squawk_parser/tests/data/ok/alter_aggregate.sql -snapshot_kind: text --- SOURCE_FILE COMMENT "-- star" @@ -49,7 +48,10 @@ SOURCE_FILE L_PAREN "(" PARAM PATH_TYPE - IDENT "t" + PATH + PATH_SEGMENT + NAME_REF + IDENT "t" R_PAREN ")" WHITESPACE " " SET_KW "set" @@ -126,7 +128,10 @@ SOURCE_FILE L_PAREN "(" PARAM PATH_TYPE - IDENT "x" + PATH + PATH_SEGMENT + NAME_REF + IDENT "x" WHITESPACE " " ORDER_KW "order" WHITESPACE " " @@ -134,7 +139,10 @@ SOURCE_FILE WHITESPACE " " PARAM PATH_TYPE - IDENT "y" + PATH + PATH_SEGMENT + NAME_REF + IDENT "y" R_PAREN ")" WHITESPACE " \n " RENAME_KW "rename" @@ -172,12 +180,18 @@ SOURCE_FILE IN_KW "in" WHITESPACE " " PATH_TYPE - IDENT "t" + PATH + PATH_SEGMENT + NAME_REF + IDENT "t" COMMA "," WHITESPACE " " PARAM PATH_TYPE - IDENT "u" + PATH + PATH_SEGMENT + NAME_REF + IDENT "u" R_PAREN ")" WHITESPACE " \n " SET_KW "set" diff --git a/crates/squawk_parser/tests/snapshots/tests__alter_domain_ok.snap b/crates/squawk_parser/tests/snapshots/tests__alter_domain_ok.snap index 986981ff..3c4fff1e 100644 --- a/crates/squawk_parser/tests/snapshots/tests__alter_domain_ok.snap +++ b/crates/squawk_parser/tests/snapshots/tests__alter_domain_ok.snap @@ -1,7 +1,6 @@ --- source: crates/squawk_parser/tests/tests.rs input_file: crates/squawk_parser/tests/data/ok/alter_domain.sql -snapshot_kind: text --- SOURCE_FILE COMMENT "-- set_default" @@ -150,9 +149,10 @@ SOURCE_FILE INT_NUMBER "0" R_PAREN ")" WHITESPACE " " - NOT_KW "not" - WHITESPACE " " - VALID_KW "valid" + NOT_VALID + NOT_KW "not" + WHITESPACE " " + VALID_KW "valid" SEMICOLON ";" WHITESPACE "\n" ALTER_DOMAIN diff --git a/crates/squawk_parser/tests/snapshots/tests__alter_extension_ok.snap b/crates/squawk_parser/tests/snapshots/tests__alter_extension_ok.snap index a5601199..1951357a 100644 --- a/crates/squawk_parser/tests/snapshots/tests__alter_extension_ok.snap +++ b/crates/squawk_parser/tests/snapshots/tests__alter_extension_ok.snap @@ -145,12 +145,18 @@ SOURCE_FILE WHITESPACE " " PARAM PATH_TYPE - IDENT "b" + PATH + PATH_SEGMENT + NAME_REF + IDENT "b" COMMA "," WHITESPACE " " PARAM PATH_TYPE - IDENT "c" + PATH + PATH_SEGMENT + NAME_REF + IDENT "c" WHITESPACE " " R_PAREN ")" SEMICOLON ";" diff --git a/crates/squawk_parser/tests/snapshots/tests__alter_function_ok.snap b/crates/squawk_parser/tests/snapshots/tests__alter_function_ok.snap index edf628f9..3ad03248 100644 --- a/crates/squawk_parser/tests/snapshots/tests__alter_function_ok.snap +++ b/crates/squawk_parser/tests/snapshots/tests__alter_function_ok.snap @@ -86,7 +86,10 @@ SOURCE_FILE WHITESPACE " " PARAM PATH_TYPE - TEXT_KW "text" + PATH + PATH_SEGMENT + NAME_REF + TEXT_KW "text" R_PAREN ")" WHITESPACE " " FUNC_OPTION_LIST diff --git a/crates/squawk_parser/tests/snapshots/tests__alter_operator_family_ok.snap b/crates/squawk_parser/tests/snapshots/tests__alter_operator_family_ok.snap index c24a7b87..2391f04d 100644 --- a/crates/squawk_parser/tests/snapshots/tests__alter_operator_family_ok.snap +++ b/crates/squawk_parser/tests/snapshots/tests__alter_operator_family_ok.snap @@ -304,7 +304,10 @@ SOURCE_FILE L_PAREN "(" PARAM PATH_TYPE - IDENT "t" + PATH + PATH_SEGMENT + NAME_REF + IDENT "t" R_PAREN ")" SEMICOLON ";" WHITESPACE "\n\n" @@ -357,12 +360,18 @@ SOURCE_FILE L_PAREN "(" PARAM PATH_TYPE - IDENT "a" + PATH + PATH_SEGMENT + NAME_REF + IDENT "a" COMMA "," WHITESPACE " " PARAM PATH_TYPE - IDENT "b" + PATH + PATH_SEGMENT + NAME_REF + IDENT "b" R_PAREN ")" SEMICOLON ";" WHITESPACE "\n\n" diff --git a/crates/squawk_parser/tests/snapshots/tests__alter_procedure_ok.snap b/crates/squawk_parser/tests/snapshots/tests__alter_procedure_ok.snap index 091d18ba..afb142e8 100644 --- a/crates/squawk_parser/tests/snapshots/tests__alter_procedure_ok.snap +++ b/crates/squawk_parser/tests/snapshots/tests__alter_procedure_ok.snap @@ -49,7 +49,10 @@ SOURCE_FILE WHITESPACE " " PARAM PATH_TYPE - TEXT_KW "text" + PATH + PATH_SEGMENT + NAME_REF + TEXT_KW "text" R_PAREN ")" WHITESPACE "\n " RENAME_KW "rename" diff --git a/crates/squawk_parser/tests/snapshots/tests__alter_table_err.snap b/crates/squawk_parser/tests/snapshots/tests__alter_table_err.snap index 25b35d60..9c5faf89 100644 --- a/crates/squawk_parser/tests/snapshots/tests__alter_table_err.snap +++ b/crates/squawk_parser/tests/snapshots/tests__alter_table_err.snap @@ -1,7 +1,6 @@ --- source: crates/squawk_parser/tests/tests.rs input_file: crates/squawk_parser/tests/data/err/alter_table.sql -snapshot_kind: text --- SOURCE_FILE COMMENT "-- missing alter_table" @@ -40,16 +39,15 @@ SOURCE_FILE NAME_REF IDENT "c" WHITESPACE " " - CONSTRAINT_OPTION_LIST - NOT_DEFERRABLE_CONSTRAINT_OPTION - NOT_KW "not" - WHITESPACE " " - DEFERRABLE_KW "deferrable" + NOT_DEFERRABLE_CONSTRAINT_OPTION + NOT_KW "not" WHITESPACE " " - INITIALLY_DEFERRED_CONSTRAINT_OPTION - INITIALLY_KW "initially" - WHITESPACE " " - DEFERRED_KW "deferred" + DEFERRABLE_KW "deferrable" + WHITESPACE " " + INITIALLY_DEFERRED_CONSTRAINT_OPTION + INITIALLY_KW "initially" + WHITESPACE " " + DEFERRED_KW "deferred" SEMICOLON ";" WHITESPACE "\n\n" COMMENT "-- pg 18 only, via: https://www.depesz.com/2025/05/01/waiting-for-postgresql-18-allow-not-null-constraints-to-be-added-as-not-valid/" @@ -73,28 +71,23 @@ SOURCE_FILE ADD_CONSTRAINT ADD_KW "add" WHITESPACE " " - FOREIGN_KEY_CONSTRAINT + NOT_NULL_CONSTRAINT CONSTRAINT_KW "constraint" WHITESPACE " " NAME IDENT "id_not_null" WHITESPACE " " - PATH - PATH_SEGMENT - NAME_REF - NOT_KW "not" - WHITESPACE " " - ERROR - NULL_KW "null" - WHITESPACE " " - ERROR - IDENT "id" - WHITESPACE " " - ERROR - NOT_KW "not" - WHITESPACE " " - ERROR - VALID_KW "valid" + NOT_KW "not" + WHITESPACE " " + NULL_KW "null" + WHITESPACE " " + NAME_REF + IDENT "id" + WHITESPACE " " + NOT_VALID + NOT_KW "not" + WHITESPACE " " + VALID_KW "valid" SEMICOLON ";" WHITESPACE "\n" --- @@ -102,13 +95,3 @@ ERROR@23: expected command, found ADD_KW ERROR@27: expected command, found COLUMN_KW ERROR@34: expected command, found IDENT ERROR@38: expected command, found BOOLEAN_KW -ERROR@134: constraint declared INITIALLY DEFERRED must be DEFERRABLE -ERROR@322: expected FOREIGN_KW -ERROR@322: expected KEY_KW -ERROR@322: expected column list -ERROR@322: expected REFERENCES_KW -ERROR@326: expected SEMICOLON -ERROR@327: expected command, found NULL_KW -ERROR@332: expected command, found IDENT -ERROR@335: expected command, found NOT_KW -ERROR@339: expected command, found VALID_KW diff --git a/crates/squawk_parser/tests/snapshots/tests__alter_table_ok.snap b/crates/squawk_parser/tests/snapshots/tests__alter_table_ok.snap index 0f2e452a..01cc32a4 100644 --- a/crates/squawk_parser/tests/snapshots/tests__alter_table_ok.snap +++ b/crates/squawk_parser/tests/snapshots/tests__alter_table_ok.snap @@ -1,7 +1,6 @@ --- source: crates/squawk_parser/tests/tests.rs input_file: crates/squawk_parser/tests/data/ok/alter_table.sql -snapshot_kind: text --- SOURCE_FILE COMMENT "-- add column" @@ -114,9 +113,8 @@ SOURCE_FILE NAME_REF IDENT "c" WHITESPACE " " - CONSTRAINT_OPTION_LIST - DEFERRABLE_CONSTRAINT_OPTION - DEFERRABLE_KW "deferrable" + DEFERRABLE_CONSTRAINT_OPTION + DEFERRABLE_KW "deferrable" SEMICOLON ";" WHITESPACE "\n" ALTER_TABLE @@ -138,11 +136,10 @@ SOURCE_FILE NAME_REF IDENT "c" WHITESPACE " " - CONSTRAINT_OPTION_LIST - NOT_DEFERRABLE_CONSTRAINT_OPTION - NOT_KW "not" - WHITESPACE " " - DEFERRABLE_KW "deferrable" + NOT_DEFERRABLE_CONSTRAINT_OPTION + NOT_KW "not" + WHITESPACE " " + DEFERRABLE_KW "deferrable" SEMICOLON ";" WHITESPACE "\n" ALTER_TABLE @@ -164,16 +161,15 @@ SOURCE_FILE NAME_REF IDENT "c" WHITESPACE " " - CONSTRAINT_OPTION_LIST - NOT_DEFERRABLE_CONSTRAINT_OPTION - NOT_KW "not" - WHITESPACE " " - DEFERRABLE_KW "deferrable" + NOT_DEFERRABLE_CONSTRAINT_OPTION + NOT_KW "not" WHITESPACE " " - INITIALLY_IMMEDIATE_CONSTRAINT_OPTION - INITIALLY_KW "initially" - WHITESPACE " " - IMMEDIATE_KW "immediate" + DEFERRABLE_KW "deferrable" + WHITESPACE " " + INITIALLY_IMMEDIATE_CONSTRAINT_OPTION + INITIALLY_KW "initially" + WHITESPACE " " + IMMEDIATE_KW "immediate" SEMICOLON ";" WHITESPACE "\n\n\n" COMMENT "-- validate_constraint" diff --git a/crates/squawk_parser/tests/snapshots/tests__alter_table_pg17_ok.snap b/crates/squawk_parser/tests/snapshots/tests__alter_table_pg17_ok.snap index 0aac3d63..282bf825 100644 --- a/crates/squawk_parser/tests/snapshots/tests__alter_table_pg17_ok.snap +++ b/crates/squawk_parser/tests/snapshots/tests__alter_table_pg17_ok.snap @@ -1,7 +1,6 @@ --- source: crates/squawk_parser/tests/tests.rs input_file: crates/squawk_parser/tests/data/ok/alter_table_pg17.sql -snapshot_kind: text --- SOURCE_FILE WHITESPACE "\n" diff --git a/crates/squawk_parser/tests/snapshots/tests__comment_ok.snap b/crates/squawk_parser/tests/snapshots/tests__comment_ok.snap index 505919eb..3fa66f7c 100644 --- a/crates/squawk_parser/tests/snapshots/tests__comment_ok.snap +++ b/crates/squawk_parser/tests/snapshots/tests__comment_ok.snap @@ -110,7 +110,10 @@ SOURCE_FILE WHITESPACE " " PARAM PATH_TYPE - TEXT_KW "text" + PATH + PATH_SEGMENT + NAME_REF + TEXT_KW "text" R_PAREN ")" WHITESPACE " " IS_KW "is" @@ -146,7 +149,10 @@ SOURCE_FILE WHITESPACE " " PARAM PATH_TYPE - TEXT_KW "text" + PATH + PATH_SEGMENT + NAME_REF + TEXT_KW "text" WHITESPACE " " ORDER_KW "order" WHITESPACE " " @@ -505,7 +511,10 @@ SOURCE_FILE WHITESPACE " " PARAM PATH_TYPE - TEXT_KW "text" + PATH + PATH_SEGMENT + NAME_REF + TEXT_KW "text" R_PAREN ")" WHITESPACE " " IS_KW "is" diff --git a/crates/squawk_parser/tests/snapshots/tests__create_aggregate_ok.snap b/crates/squawk_parser/tests/snapshots/tests__create_aggregate_ok.snap index c6dca528..6987257d 100644 --- a/crates/squawk_parser/tests/snapshots/tests__create_aggregate_ok.snap +++ b/crates/squawk_parser/tests/snapshots/tests__create_aggregate_ok.snap @@ -1,7 +1,6 @@ --- source: crates/squawk_parser/tests/tests.rs input_file: crates/squawk_parser/tests/data/ok/create_aggregate.sql -snapshot_kind: text --- SOURCE_FILE COMMENT "-- simple_old_syntax" @@ -370,7 +369,10 @@ SOURCE_FILE L_PAREN "(" PARAM PATH_TYPE - IDENT "t" + PATH + PATH_SEGMENT + NAME_REF + IDENT "t" R_PAREN ")" WHITESPACE " " L_PAREN "(" @@ -440,7 +442,10 @@ SOURCE_FILE WHITESPACE " " PARAM PATH_TYPE - TEXT_KW "text" + PATH + PATH_SEGMENT + NAME_REF + TEXT_KW "text" COMMA "," WHITESPACE " " PARAM @@ -715,7 +720,10 @@ SOURCE_FILE WHITESPACE " " PARAM PATH_TYPE - IDENT "a" + PATH + PATH_SEGMENT + NAME_REF + IDENT "a" COMMA "," WHITESPACE "\n " PARAM @@ -836,7 +844,10 @@ SOURCE_FILE L_PAREN "(" PARAM PATH_TYPE - IDENT "anycompatible" + PATH + PATH_SEGMENT + NAME_REF + IDENT "anycompatible" R_PAREN ")" WHITESPACE "\n" L_PAREN "(" @@ -892,7 +903,10 @@ SOURCE_FILE L_PAREN "(" PARAM PATH_TYPE - IDENT "anynonarray" + PATH + PATH_SEGMENT + NAME_REF + IDENT "anynonarray" R_PAREN ")" WHITESPACE "\n" L_PAREN "(" @@ -955,7 +969,10 @@ SOURCE_FILE L_PAREN "(" PARAM PATH_TYPE - IDENT "float8" + PATH + PATH_SEGMENT + NAME_REF + IDENT "float8" WHITESPACE " " ORDER_KW "ORDER" WHITESPACE " " @@ -963,7 +980,10 @@ SOURCE_FILE WHITESPACE " " PARAM PATH_TYPE - IDENT "anyelement" + PATH + PATH_SEGMENT + NAME_REF + IDENT "anyelement" R_PAREN ")" WHITESPACE "\n" L_PAREN "(" @@ -1026,7 +1046,10 @@ SOURCE_FILE L_PAREN "(" PARAM PATH_TYPE - IDENT "complex" + PATH + PATH_SEGMENT + NAME_REF + IDENT "complex" R_PAREN ")" WHITESPACE "\n" L_PAREN "(" @@ -1127,7 +1150,10 @@ SOURCE_FILE L_PAREN "(" PARAM PATH_TYPE - IDENT "float8" + PATH + PATH_SEGMENT + NAME_REF + IDENT "float8" R_PAREN ")" WHITESPACE "\n" L_PAREN "(" diff --git a/crates/squawk_parser/tests/snapshots/tests__create_cast_ok.snap b/crates/squawk_parser/tests/snapshots/tests__create_cast_ok.snap index 066d7a47..18d5febb 100644 --- a/crates/squawk_parser/tests/snapshots/tests__create_cast_ok.snap +++ b/crates/squawk_parser/tests/snapshots/tests__create_cast_ok.snap @@ -141,7 +141,10 @@ SOURCE_FILE WHITESPACE " " PARAM PATH_TYPE - TEXT_KW "text" + PATH + PATH_SEGMENT + NAME_REF + TEXT_KW "text" R_PAREN ")" WHITESPACE "\n " AS_KW "as" diff --git a/crates/squawk_parser/tests/snapshots/tests__create_domain_ok.snap b/crates/squawk_parser/tests/snapshots/tests__create_domain_ok.snap index a7bca643..2bb01f80 100644 --- a/crates/squawk_parser/tests/snapshots/tests__create_domain_ok.snap +++ b/crates/squawk_parser/tests/snapshots/tests__create_domain_ok.snap @@ -1,7 +1,6 @@ --- source: crates/squawk_parser/tests/tests.rs input_file: crates/squawk_parser/tests/data/ok/create_domain.sql -snapshot_kind: text --- SOURCE_FILE COMMENT "-- simple" @@ -11,8 +10,10 @@ SOURCE_FILE WHITESPACE " " DOMAIN_KW "domain" WHITESPACE " " - NAME - IDENT "d" + PATH + PATH_SEGMENT + NAME + IDENT "d" WHITESPACE " " PATH_TYPE PATH @@ -28,8 +29,10 @@ SOURCE_FILE WHITESPACE " " DOMAIN_KW "domain" WHITESPACE " " - NAME - IDENT "d" + PATH + PATH_SEGMENT + NAME + IDENT "d" WHITESPACE " " AS_KW "as" WHITESPACE " " diff --git a/crates/squawk_parser/tests/snapshots/tests__create_foreign_table_ok.snap b/crates/squawk_parser/tests/snapshots/tests__create_foreign_table_ok.snap index 8e9fd432..fa4a3276 100644 --- a/crates/squawk_parser/tests/snapshots/tests__create_foreign_table_ok.snap +++ b/crates/squawk_parser/tests/snapshots/tests__create_foreign_table_ok.snap @@ -123,9 +123,10 @@ SOURCE_FILE IDENT "b" R_PAREN ")" WHITESPACE " " - NO_KW "no" - WHITESPACE " " - INHERIT_KW "inherit" + NO_INHERIT + NO_KW "no" + WHITESPACE " " + INHERIT_KW "inherit" WHITESPACE "\n " DEFAULT_CONSTRAINT DEFAULT_KW "default" diff --git a/crates/squawk_parser/tests/snapshots/tests__create_function_ok.snap b/crates/squawk_parser/tests/snapshots/tests__create_function_ok.snap index 694e355e..a684c62c 100644 --- a/crates/squawk_parser/tests/snapshots/tests__create_function_ok.snap +++ b/crates/squawk_parser/tests/snapshots/tests__create_function_ok.snap @@ -2079,7 +2079,10 @@ SOURCE_FILE L_PAREN "(" PARAM PATH_TYPE - IDENT "int8" + PATH + PATH_SEGMENT + NAME_REF + IDENT "int8" R_PAREN ")" WHITESPACE "\n" RET_TYPE @@ -2169,7 +2172,10 @@ SOURCE_FILE IN_KW "in" WHITESPACE " " PATH_TYPE - IDENT "int8" + PATH + PATH_SEGMENT + NAME_REF + IDENT "int8" R_PAREN ")" WHITESPACE "\n" RET_TYPE @@ -2210,7 +2216,10 @@ SOURCE_FILE OUT_KW "out" WHITESPACE " " PATH_TYPE - IDENT "int8" + PATH + PATH_SEGMENT + NAME_REF + IDENT "int8" R_PAREN ")" WHITESPACE "\n" RET_TYPE @@ -2253,7 +2262,10 @@ SOURCE_FILE OUT_KW "out" WHITESPACE " " PATH_TYPE - IDENT "int8" + PATH + PATH_SEGMENT + NAME_REF + IDENT "int8" R_PAREN ")" WHITESPACE "\n" RET_TYPE @@ -2294,7 +2306,10 @@ SOURCE_FILE INOUT_KW "inout" WHITESPACE " " PATH_TYPE - IDENT "int8" + PATH + PATH_SEGMENT + NAME_REF + IDENT "int8" R_PAREN ")" WHITESPACE "\n" RET_TYPE @@ -2335,7 +2350,10 @@ SOURCE_FILE VARIADIC_KW "variadic" WHITESPACE " " PATH_TYPE - IDENT "int8" + PATH + PATH_SEGMENT + NAME_REF + IDENT "int8" R_PAREN ")" WHITESPACE "\n" RET_TYPE @@ -2491,7 +2509,10 @@ SOURCE_FILE WHITESPACE " " PARAM PATH_TYPE - IDENT "int4" + PATH + PATH_SEGMENT + NAME_REF + IDENT "int4" R_PAREN ")" WHITESPACE "\n" RET_TYPE @@ -2550,7 +2571,10 @@ SOURCE_FILE WHITESPACE " " PARAM PATH_TYPE - IDENT "int4" + PATH + PATH_SEGMENT + NAME_REF + IDENT "int4" WHITESPACE " " PARAM_DEFAULT EQ "=" @@ -2613,7 +2637,10 @@ SOURCE_FILE WHITESPACE " " PARAM PATH_TYPE - IDENT "int4" + PATH + PATH_SEGMENT + NAME_REF + IDENT "int4" R_PAREN ")" WHITESPACE "\n" RET_TYPE @@ -2875,7 +2902,10 @@ SOURCE_FILE IN_KW "in" WHITESPACE " " PATH_TYPE - IDENT "int8" + PATH + PATH_SEGMENT + NAME_REF + IDENT "int8" R_PAREN ")" WHITESPACE "\n" RET_TYPE @@ -3010,7 +3040,10 @@ SOURCE_FILE L_PAREN "(" PARAM PATH_TYPE - IDENT "int8" + PATH + PATH_SEGMENT + NAME_REF + IDENT "int8" R_PAREN ")" WHITESPACE "\n" RET_TYPE @@ -3051,20 +3084,29 @@ SOURCE_FILE L_PAREN "(" PARAM PATH_TYPE - IDENT "internal" + PATH + PATH_SEGMENT + NAME_REF + IDENT "internal" COMMA "," WHITESPACE " " PARAM ARRAY_TYPE PATH_TYPE - TEXT_KW "text" + PATH + PATH_SEGMENT + NAME_REF + TEXT_KW "text" L_BRACK "[" R_BRACK "]" COMMA "," WHITESPACE " " PARAM PATH_TYPE - IDENT "bool" + PATH + PATH_SEGMENT + NAME_REF + IDENT "bool" R_PAREN ")" WHITESPACE " \n" RET_TYPE @@ -3088,4 +3130,87 @@ SOURCE_FILE WHITESPACE " " SQL_KW "sql" SEMICOLON ";" + WHITESPACE "\n\n" + COMMENT "-- path type" WHITESPACE "\n" + CREATE_FUNCTION + CREATE_KW "create" + WHITESPACE " " + FUNCTION_KW "function" + WHITESPACE " " + PATH + PATH_SEGMENT + NAME + IDENT "f" + WHITESPACE " " + PARAM_LIST + L_PAREN "(" + PARAM + PATH_TYPE + PATH + PATH + PATH + PATH + PATH_SEGMENT + NAME_REF + IDENT "foo" + DOT "." + PATH_SEGMENT + NAME_REF + IDENT "bar" + DOT "." + PATH_SEGMENT + NAME_REF + IDENT "buzz" + DOT "." + PATH_SEGMENT + NAME_REF + IDENT "boo" + COMMA "," + WHITESPACE " " + PARAM + ARRAY_TYPE + PATH_TYPE + PATH + PATH + PATH_SEGMENT + NAME_REF + IDENT "t" + DOT "." + PATH_SEGMENT + NAME_REF + IDENT "u" + L_BRACK "[" + R_BRACK "]" + COMMA "," + WHITESPACE " " + PARAM + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "bool" + R_PAREN ")" + WHITESPACE " \n" + RET_TYPE + RETURNS_KW "returns" + WHITESPACE " " + PATH_TYPE + PATH + PATH_SEGMENT + NAME_REF + IDENT "void" + WHITESPACE "\n" + FUNC_OPTION_LIST + AS_FUNC_OPTION + AS_KW "as" + WHITESPACE " " + LITERAL + STRING "''" + WHITESPACE " " + LANGUAGE_FUNC_OPTION + LANGUAGE_KW "language" + WHITESPACE " " + SQL_KW "sql" + SEMICOLON ";" + WHITESPACE "\n\n" diff --git a/crates/squawk_parser/tests/snapshots/tests__create_operator_class_ok.snap b/crates/squawk_parser/tests/snapshots/tests__create_operator_class_ok.snap index 27cd9c57..210848bf 100644 --- a/crates/squawk_parser/tests/snapshots/tests__create_operator_class_ok.snap +++ b/crates/squawk_parser/tests/snapshots/tests__create_operator_class_ok.snap @@ -260,7 +260,10 @@ SOURCE_FILE WHITESPACE " " PARAM PATH_TYPE - TEXT_KW "text" + PATH + PATH_SEGMENT + NAME_REF + TEXT_KW "text" R_PAREN ")" COMMA "," WHITESPACE "\n " @@ -297,12 +300,18 @@ SOURCE_FILE L_PAREN "(" PARAM PATH_TYPE - TEXT_KW "text" + PATH + PATH_SEGMENT + NAME_REF + TEXT_KW "text" COMMA "," WHITESPACE " " PARAM PATH_TYPE - TEXT_KW "text" + PATH + PATH_SEGMENT + NAME_REF + TEXT_KW "text" R_PAREN ")" SEMICOLON ";" WHITESPACE "\n\n" diff --git a/crates/squawk_parser/tests/snapshots/tests__create_table_err.snap b/crates/squawk_parser/tests/snapshots/tests__create_table_err.snap index db4ae5e5..1588c010 100644 --- a/crates/squawk_parser/tests/snapshots/tests__create_table_err.snap +++ b/crates/squawk_parser/tests/snapshots/tests__create_table_err.snap @@ -409,6 +409,5 @@ SOURCE_FILE WHITESPACE "\n" --- ERROR@39: expected path name -ERROR@99: expected type name ERROR@143: unexpected trailing comma ERROR@201: unexpected trailing comma diff --git a/crates/squawk_parser/tests/snapshots/tests__create_table_ok.snap b/crates/squawk_parser/tests/snapshots/tests__create_table_ok.snap index edd5beaf..3c5eb98c 100644 --- a/crates/squawk_parser/tests/snapshots/tests__create_table_ok.snap +++ b/crates/squawk_parser/tests/snapshots/tests__create_table_ok.snap @@ -1354,9 +1354,10 @@ SOURCE_FILE INT_NUMBER "10" R_PAREN ")" WHITESPACE " " - NO_KW "no" - WHITESPACE " " - INHERIT_KW "inherit" + NO_INHERIT + NO_KW "no" + WHITESPACE " " + INHERIT_KW "inherit" WHITESPACE "\n" R_PAREN ")" SEMICOLON ";" @@ -1400,9 +1401,8 @@ SOURCE_FILE INT_NUMBER "10" R_PAREN ")" WHITESPACE " " - CONSTRAINT_OPTION_LIST - DEFERRABLE_CONSTRAINT_OPTION - DEFERRABLE_KW "deferrable" + DEFERRABLE_CONSTRAINT_OPTION + DEFERRABLE_KW "deferrable" COMMA "," WHITESPACE "\n " COLUMN @@ -1420,11 +1420,10 @@ SOURCE_FILE WHITESPACE " " NULL_KW "null" WHITESPACE " " - CONSTRAINT_OPTION_LIST - NOT_DEFERRABLE_CONSTRAINT_OPTION - NOT_KW "not" - WHITESPACE " " - DEFERRABLE_KW "deferrable" + NOT_DEFERRABLE_CONSTRAINT_OPTION + NOT_KW "not" + WHITESPACE " " + DEFERRABLE_KW "deferrable" COMMA "," WHITESPACE "\n " COLUMN @@ -1442,11 +1441,10 @@ SOURCE_FILE WHITESPACE " " NULL_KW "null" WHITESPACE " " - CONSTRAINT_OPTION_LIST - INITIALLY_DEFERRED_CONSTRAINT_OPTION - INITIALLY_KW "initially" - WHITESPACE " " - DEFERRED_KW "deferred" + INITIALLY_DEFERRED_CONSTRAINT_OPTION + INITIALLY_KW "initially" + WHITESPACE " " + DEFERRED_KW "deferred" COMMA "," WHITESPACE "\n " COLUMN @@ -1464,11 +1462,10 @@ SOURCE_FILE WHITESPACE " " NULL_KW "null" WHITESPACE " " - CONSTRAINT_OPTION_LIST - INITIALLY_IMMEDIATE_CONSTRAINT_OPTION - INITIALLY_KW "initially" - WHITESPACE " " - IMMEDIATE_KW "immediate" + INITIALLY_IMMEDIATE_CONSTRAINT_OPTION + INITIALLY_KW "initially" + WHITESPACE " " + IMMEDIATE_KW "immediate" WHITESPACE "\n" R_PAREN ")" SEMICOLON ";" @@ -1629,7 +1626,8 @@ SOURCE_FILE NAME_REF IDENT "b" R_PAREN ")" - WHITESPACE " " + WHITESPACE " " + NO_INHERIT NO_KW "no" WHITESPACE " " INHERIT_KW "inherit" @@ -1815,15 +1813,14 @@ SOURCE_FILE NAME_REF IDENT "a" R_PAREN ")" + WHITESPACE " " + DEFERRABLE_CONSTRAINT_OPTION + DEFERRABLE_KW "deferrable" + WHITESPACE " " + INITIALLY_DEFERRED_CONSTRAINT_OPTION + INITIALLY_KW "initially" WHITESPACE " " - CONSTRAINT_OPTION_LIST - DEFERRABLE_CONSTRAINT_OPTION - DEFERRABLE_KW "deferrable" - WHITESPACE " " - INITIALLY_DEFERRED_CONSTRAINT_OPTION - INITIALLY_KW "initially" - WHITESPACE " " - DEFERRED_KW "deferred" + DEFERRED_KW "deferred" WHITESPACE "\n" R_PAREN ")" SEMICOLON ";" @@ -2219,10 +2216,9 @@ SOURCE_FILE STRING "'%foo'" WHITESPACE " " R_PAREN ")" - WHITESPACE "\n " - CONSTRAINT_OPTION_LIST - DEFERRABLE_CONSTRAINT_OPTION - DEFERRABLE_KW "deferrable" + WHITESPACE "\n " + DEFERRABLE_CONSTRAINT_OPTION + DEFERRABLE_KW "deferrable" WHITESPACE "\n" R_PAREN ")" SEMICOLON ";" @@ -2364,7 +2360,8 @@ SOURCE_FILE NAME_REF IDENT "b" R_PAREN ")" - WHITESPACE " " + WHITESPACE " " + NO_INHERIT NO_KW "no" WHITESPACE " " INHERIT_KW "inherit" @@ -2549,15 +2546,14 @@ SOURCE_FILE NAME_REF IDENT "a" R_PAREN ")" + WHITESPACE " " + DEFERRABLE_CONSTRAINT_OPTION + DEFERRABLE_KW "deferrable" + WHITESPACE " " + INITIALLY_DEFERRED_CONSTRAINT_OPTION + INITIALLY_KW "initially" WHITESPACE " " - CONSTRAINT_OPTION_LIST - DEFERRABLE_CONSTRAINT_OPTION - DEFERRABLE_KW "deferrable" - WHITESPACE " " - INITIALLY_DEFERRED_CONSTRAINT_OPTION - INITIALLY_KW "initially" - WHITESPACE " " - DEFERRED_KW "deferred" + DEFERRED_KW "deferred" COMMA "," WHITESPACE "\n " CHECK_CONSTRAINT @@ -2579,17 +2575,16 @@ SOURCE_FILE NAME_REF IDENT "o" R_PAREN ")" + WHITESPACE " " + NOT_DEFERRABLE_CONSTRAINT_OPTION + NOT_KW "not" WHITESPACE " " - CONSTRAINT_OPTION_LIST - NOT_DEFERRABLE_CONSTRAINT_OPTION - NOT_KW "not" - WHITESPACE " " - DEFERRABLE_KW "deferrable" - WHITESPACE " " - INITIALLY_IMMEDIATE_CONSTRAINT_OPTION - INITIALLY_KW "initially" - WHITESPACE " " - IMMEDIATE_KW "immediate" + DEFERRABLE_KW "deferrable" + WHITESPACE " " + INITIALLY_IMMEDIATE_CONSTRAINT_OPTION + INITIALLY_KW "initially" + WHITESPACE " " + IMMEDIATE_KW "immediate" WHITESPACE "\n" R_PAREN ")" SEMICOLON ";" diff --git a/crates/squawk_parser/tests/snapshots/tests__drop_aggregate_ok.snap b/crates/squawk_parser/tests/snapshots/tests__drop_aggregate_ok.snap index 884b5247..b33f4ad9 100644 --- a/crates/squawk_parser/tests/snapshots/tests__drop_aggregate_ok.snap +++ b/crates/squawk_parser/tests/snapshots/tests__drop_aggregate_ok.snap @@ -1,7 +1,6 @@ --- source: crates/squawk_parser/tests/tests.rs input_file: crates/squawk_parser/tests/data/ok/drop_aggregate.sql -snapshot_kind: text --- SOURCE_FILE COMMENT "-- simple" @@ -101,7 +100,10 @@ SOURCE_FILE WHITESPACE "\n " PARAM PATH_TYPE - TEXT_KW "text" + PATH + PATH_SEGMENT + NAME_REF + TEXT_KW "text" WHITESPACE "\n " R_PAREN ")" COMMA "," @@ -144,7 +146,10 @@ SOURCE_FILE WHITESPACE "\n " PARAM PATH_TYPE - TEXT_KW "text" + PATH + PATH_SEGMENT + NAME_REF + TEXT_KW "text" COMMA "," WHITESPACE "\n " PARAM @@ -183,7 +188,10 @@ SOURCE_FILE WHITESPACE "\n " PARAM PATH_TYPE - TEXT_KW "text" + PATH + PATH_SEGMENT + NAME_REF + TEXT_KW "text" WHITESPACE "\n" R_PAREN ")" WHITESPACE " " @@ -237,7 +245,10 @@ SOURCE_FILE WHITESPACE "\n " PARAM PATH_TYPE - TEXT_KW "text" + PATH + PATH_SEGMENT + NAME_REF + TEXT_KW "text" WHITESPACE "\n" R_PAREN ")" SEMICOLON ";" diff --git a/crates/squawk_parser/tests/snapshots/tests__drop_function_ok.snap b/crates/squawk_parser/tests/snapshots/tests__drop_function_ok.snap index 001087fb..b942edbe 100644 --- a/crates/squawk_parser/tests/snapshots/tests__drop_function_ok.snap +++ b/crates/squawk_parser/tests/snapshots/tests__drop_function_ok.snap @@ -42,7 +42,10 @@ SOURCE_FILE L_PAREN "(" PARAM PATH_TYPE - TEXT_KW "text" + PATH + PATH_SEGMENT + NAME_REF + TEXT_KW "text" R_PAREN ")" COMMA "," WHITESPACE " " @@ -83,7 +86,10 @@ SOURCE_FILE OUT_KW "out" WHITESPACE " " PATH_TYPE - TEXT_KW "text" + PATH + PATH_SEGMENT + NAME_REF + TEXT_KW "text" R_PAREN ")" WHITESPACE " " CASCADE_KW "cascade" diff --git a/crates/squawk_parser/tests/snapshots/tests__drop_procedure_ok.snap b/crates/squawk_parser/tests/snapshots/tests__drop_procedure_ok.snap index efacf51a..bf493d7e 100644 --- a/crates/squawk_parser/tests/snapshots/tests__drop_procedure_ok.snap +++ b/crates/squawk_parser/tests/snapshots/tests__drop_procedure_ok.snap @@ -42,7 +42,10 @@ SOURCE_FILE L_PAREN "(" PARAM PATH_TYPE - TEXT_KW "text" + PATH + PATH_SEGMENT + NAME_REF + TEXT_KW "text" R_PAREN ")" COMMA "," WHITESPACE " " @@ -83,7 +86,10 @@ SOURCE_FILE OUT_KW "out" WHITESPACE " " PATH_TYPE - TEXT_KW "text" + PATH + PATH_SEGMENT + NAME_REF + TEXT_KW "text" R_PAREN ")" WHITESPACE " " CASCADE_KW "cascade" diff --git a/crates/squawk_parser/tests/snapshots/tests__drop_routine_ok.snap b/crates/squawk_parser/tests/snapshots/tests__drop_routine_ok.snap index 2330e443..67b52a4a 100644 --- a/crates/squawk_parser/tests/snapshots/tests__drop_routine_ok.snap +++ b/crates/squawk_parser/tests/snapshots/tests__drop_routine_ok.snap @@ -42,7 +42,10 @@ SOURCE_FILE L_PAREN "(" PARAM PATH_TYPE - TEXT_KW "text" + PATH + PATH_SEGMENT + NAME_REF + TEXT_KW "text" R_PAREN ")" COMMA "," WHITESPACE " " @@ -83,7 +86,10 @@ SOURCE_FILE OUT_KW "out" WHITESPACE " " PATH_TYPE - TEXT_KW "text" + PATH + PATH_SEGMENT + NAME_REF + TEXT_KW "text" R_PAREN ")" WHITESPACE " " CASCADE_KW "cascade" diff --git a/crates/squawk_parser/tests/snapshots/tests__misc_ok.snap b/crates/squawk_parser/tests/snapshots/tests__misc_ok.snap index 71a77a3e..71f2fe96 100644 --- a/crates/squawk_parser/tests/snapshots/tests__misc_ok.snap +++ b/crates/squawk_parser/tests/snapshots/tests__misc_ok.snap @@ -874,12 +874,18 @@ SOURCE_FILE WHITESPACE " " PARAM PATH_TYPE - IDENT "int4" + PATH + PATH_SEGMENT + NAME_REF + IDENT "int4" COMMA "," WHITESPACE " " PARAM PATH_TYPE - IDENT "int4" + PATH + PATH_SEGMENT + NAME_REF + IDENT "int4" WHITESPACE " " R_PAREN ")" WHITESPACE " " diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_alter_table.snap b/crates/squawk_parser/tests/snapshots/tests__regression_alter_table.snap deleted file mode 100644 index 0288eb8d..00000000 --- a/crates/squawk_parser/tests/snapshots/tests__regression_alter_table.snap +++ /dev/null @@ -1,140 +0,0 @@ ---- -source: crates/squawk_parser/tests/tests.rs -input_file: crates/squawk_parser/tests/data/regression_suite/alter_table.sql ---- -ERROR@12719: expected VALID_KW -ERROR@12719: expected SEMICOLON -ERROR@12720: expected command, found ENFORCED_KW -ERROR@15268: expected R_PAREN -ERROR@15268: expected SEMICOLON -ERROR@15269: expected command, found NOT_KW -ERROR@15273: expected command, found VALID_KW -ERROR@15278: expected command, found R_PAREN -ERROR@33822: expected FOREIGN_KW -ERROR@33822: expected KEY_KW -ERROR@33822: expected column list -ERROR@33822: expected REFERENCES_KW -ERROR@33826: expected SEMICOLON -ERROR@33827: expected command, found NULL_KW -ERROR@33832: expected command, found IDENT -ERROR@33835: expected command, found NOT_KW -ERROR@33839: expected command, found VALID_KW -ERROR@33940: expected FOREIGN_KW -ERROR@33940: expected KEY_KW -ERROR@33940: expected column list -ERROR@33940: expected REFERENCES_KW -ERROR@33944: expected SEMICOLON -ERROR@33945: expected command, found NULL_KW -ERROR@33950: expected command, found IDENT -ERROR@38443: expected L_PAREN -ERROR@38448: expected R_PAREN -ERROR@38448: expected SEMICOLON -ERROR@38449: expected command, found OIDS_KW -ERROR@42440: expected command, found INT_NUMBER -ERROR@42443: expected command, found INT_NUMBER -ERROR@42446: expected command, found INT_NUMBER -ERROR@42495: expected command, found INT_NUMBER -ERROR@42498: expected command, found INT_NUMBER -ERROR@42635: expected command, found INT_NUMBER -ERROR@42638: expected command, found INT_NUMBER -ERROR@43987: expected NULL_KW -ERROR@43987: expected SEMICOLON -ERROR@43988: expected command, found ENFORCED_KW -ERROR@44078: expected NULL_KW -ERROR@44078: expected SEMICOLON -ERROR@44079: expected command, found ENFORCED_KW -ERROR@44088: expected command, found ENFORCED_KW -ERROR@67262: expected type name -ERROR@67262: expected SEMICOLON -ERROR@67262: expected command, found DOT -ERROR@67263: expected command, found IDENT -ERROR@67270: expected command, found INTEGER_KW -ERROR@67278: expected command, found CHECK_KW -ERROR@67284: expected command, found L_PAREN -ERROR@67285: expected command, found VALUE_KW -ERROR@67291: expected command, found R_ANGLE -ERROR@67293: expected command, found INT_NUMBER -ERROR@67294: expected command, found R_PAREN -ERROR@67380: expected R_PAREN -ERROR@67380: expected function option -ERROR@67380: expected SEMICOLON -ERROR@67380: expected command, found DOT -ERROR@67381: expected command, found IDENT -ERROR@67386: expected command, found COMMA -ERROR@67388: expected command, found IDENT -ERROR@67394: expected command, found DOT -ERROR@67395: expected command, found IDENT -ERROR@67400: expected command, found R_PAREN -ERROR@67402: expected command, found RETURNS_KW -ERROR@67410: expected command, found BOOLEAN_KW -ERROR@67418: expected command, found LANGUAGE_KW -ERROR@67427: expected command, found SQL_KW -ERROR@67431: expected command, found AS_KW -ERROR@67434: expected command, found STRING -ERROR@68763: expected R_PAREN -ERROR@68763: expected function option -ERROR@68763: expected SEMICOLON -ERROR@68763: expected command, found DOT -ERROR@68764: expected command, found IDENT -ERROR@68769: expected command, found COMMA -ERROR@68771: expected command, found IDENT -ERROR@68777: expected command, found DOT -ERROR@68778: expected command, found IDENT -ERROR@68783: expected command, found R_PAREN -ERROR@68795: expected EQ -ERROR@71700: expected type name -ERROR@74909: expected FOREIGN_KW -ERROR@74909: expected KEY_KW -ERROR@74909: expected column list -ERROR@74909: expected REFERENCES_KW -ERROR@74913: expected R_PAREN -ERROR@74913: expected SEMICOLON -ERROR@74914: expected command, found NULL_KW -ERROR@74919: expected command, found IDENT -ERROR@74921: expected command, found COMMA -ERROR@74925: expected command, found IDENT -ERROR@74938: expected command, found INT_KW -ERROR@74942: expected command, found CHECK_KW -ERROR@74948: expected command, found L_PAREN -ERROR@74949: expected command, found IDENT -ERROR@74962: expected command, found R_ANGLE -ERROR@74964: expected command, found INT_NUMBER -ERROR@74965: expected command, found R_PAREN -ERROR@74966: expected command, found COMMA -ERROR@74970: expected command, found IDENT -ERROR@74982: expected command, found INT_KW -ERROR@74985: expected command, found COMMA -ERROR@74989: expected command, found CONSTRAINT_KW -ERROR@75000: expected command, found IDENT -ERROR@75016: expected command, found PRIMARY_KW -ERROR@75024: expected command, found KEY_KW -ERROR@75028: expected command, found L_PAREN -ERROR@75029: expected command, found IDENT -ERROR@75031: expected command, found R_PAREN -ERROR@75032: expected command, found R_PAREN -ERROR@86438: expected name -ERROR@86438: expected type name -ERROR@86447: expected SEMICOLON -ERROR@86448: expected command, found IDENT -ERROR@91452: expected R_PAREN -ERROR@91452: expected SEMICOLON -ERROR@91453: expected command, found NO_KW -ERROR@91456: expected command, found INHERIT_KW -ERROR@91463: expected command, found COMMA -ERROR@91466: expected command, found IDENT -ERROR@91468: expected command, found CHAR_KW -ERROR@91472: expected command, found L_PAREN -ERROR@91473: expected command, found INT_NUMBER -ERROR@91474: expected command, found R_PAREN -ERROR@91476: expected command, found COLLATE_KW -ERROR@91484: expected command, found IDENT -ERROR@91487: expected command, found COMMA -ERROR@91490: expected command, found CONSTRAINT_KW -ERROR@91501: expected command, found IDENT -ERROR@91509: expected command, found CHECK_KW -ERROR@91515: expected command, found L_PAREN -ERROR@91516: expected command, found IDENT -ERROR@91518: expected command, found R_ANGLE -ERROR@91520: expected command, found INT_NUMBER -ERROR@91521: expected command, found R_PAREN -ERROR@91523: expected command, found R_PAREN diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_btree_index.snap b/crates/squawk_parser/tests/snapshots/tests__regression_btree_index.snap deleted file mode 100644 index 7d43bc1c..00000000 --- a/crates/squawk_parser/tests/snapshots/tests__regression_btree_index.snap +++ /dev/null @@ -1,34 +0,0 @@ ---- -source: crates/squawk_parser/tests/tests.rs -input_file: crates/squawk_parser/tests/data/regression_suite/btree_index.sql ---- -ERROR@13001: expected numeric literal -ERROR@13001: expected SET_KW -ERROR@13001: expected STATISTICS_KW -ERROR@13001: expected numeric literal -ERROR@13001: expected SEMICOLON -ERROR@13002: expected command, found IDENT -ERROR@13008: expected name -ERROR@13008: expected EQ -ERROR@13008: expected config value, got L_PAREN -ERROR@13008: expected SEMICOLON -ERROR@13009: expected command, found L_PAREN -ERROR@13010: expected command, found IDENT -ERROR@13020: expected command, found EQ -ERROR@13021: expected command, found INT_NUMBER -ERROR@13024: expected command, found R_PAREN -ERROR@13221: expected numeric literal -ERROR@13221: expected SET_KW -ERROR@13221: expected STATISTICS_KW -ERROR@13221: expected numeric literal -ERROR@13221: expected SEMICOLON -ERROR@13222: expected command, found IDENT -ERROR@13228: expected name -ERROR@13228: expected EQ -ERROR@13228: expected config value, got L_PAREN -ERROR@13228: expected SEMICOLON -ERROR@13229: expected command, found L_PAREN -ERROR@13230: expected command, found IDENT -ERROR@13240: expected command, found EQ -ERROR@13241: expected command, found INT_NUMBER -ERROR@13244: expected command, found R_PAREN diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_collate.icu.utf8.snap b/crates/squawk_parser/tests/snapshots/tests__regression_collate.icu.utf8.snap deleted file mode 100644 index 9188d12b..00000000 --- a/crates/squawk_parser/tests/snapshots/tests__regression_collate.icu.utf8.snap +++ /dev/null @@ -1,20 +0,0 @@ ---- -source: crates/squawk_parser/tests/tests.rs -input_file: crates/squawk_parser/tests/data/regression_suite/collate.icu.utf8.sql ---- -ERROR@14369: expected SEMICOLON -ERROR@14369: expected command, found COMMA -ERROR@14371: expected command, found IDENT -ERROR@14382: expected command, found DOT -ERROR@14383: expected command, found IDENT -ERROR@14389: expected command, found COMMA -ERROR@14391: expected command, found IDENT -ERROR@14733: expected name -ERROR@14733: expected SEMICOLON -ERROR@14734: expected command, found COLON -ERROR@14735: expected command, found IDENT -ERROR@14752: expected MATERIALIZED_KW -ERROR@14752: expected VIEW_KW -ERROR@14762: expected SEMICOLON -ERROR@14763: expected command, found VERSION_KW -ERROR@42437: expected STORED or VIRTUAL diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_collate.linux.utf8.snap b/crates/squawk_parser/tests/snapshots/tests__regression_collate.linux.utf8.snap deleted file mode 100644 index 9a02e9b7..00000000 --- a/crates/squawk_parser/tests/snapshots/tests__regression_collate.linux.utf8.snap +++ /dev/null @@ -1,19 +0,0 @@ ---- -source: crates/squawk_parser/tests/tests.rs -input_file: crates/squawk_parser/tests/data/regression_suite/collate.linux.utf8.sql ---- -ERROR@13571: expected SEMICOLON -ERROR@13571: expected command, found COMMA -ERROR@13573: expected command, found IDENT -ERROR@13584: expected command, found DOT -ERROR@13585: expected command, found IDENT -ERROR@13591: expected command, found COMMA -ERROR@13593: expected command, found IDENT -ERROR@13932: expected name -ERROR@13932: expected SEMICOLON -ERROR@13933: expected command, found COLON -ERROR@13934: expected command, found IDENT -ERROR@13951: expected MATERIALIZED_KW -ERROR@13951: expected VIEW_KW -ERROR@13961: expected SEMICOLON -ERROR@13962: expected command, found VERSION_KW diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_constraints.snap b/crates/squawk_parser/tests/snapshots/tests__regression_constraints.snap deleted file mode 100644 index 0a8953fe..00000000 --- a/crates/squawk_parser/tests/snapshots/tests__regression_constraints.snap +++ /dev/null @@ -1,542 +0,0 @@ ---- -source: crates/squawk_parser/tests/tests.rs -input_file: crates/squawk_parser/tests/data/regression_suite/constraints.sql ---- -ERROR@1842: expected R_PAREN -ERROR@1842: expected SEMICOLON -ERROR@1843: expected command, found NOT_KW -ERROR@1847: expected command, found ENFORCED_KW -ERROR@1855: expected command, found R_PAREN -ERROR@2909: expected R_PAREN -ERROR@2909: expected SEMICOLON -ERROR@2910: expected command, found ENFORCED_KW -ERROR@2918: expected command, found COMMA -ERROR@2953: expected command, found CONSTRAINT_KW -ERROR@2964: expected command, found IDENT -ERROR@2982: expected command, found CHECK_KW -ERROR@2988: expected command, found L_PAREN -ERROR@2989: expected command, found IDENT -ERROR@2991: expected command, found PLUS -ERROR@2993: expected command, found IDENT -ERROR@2995: expected command, found EQ -ERROR@2997: expected command, found INT_NUMBER -ERROR@2998: expected command, found R_PAREN -ERROR@3000: expected command, found NOT_KW -ERROR@3004: expected command, found ENFORCED_KW -ERROR@3012: expected command, found R_PAREN -ERROR@15473: expected R_PAREN -ERROR@15473: expected SEMICOLON -ERROR@15474: expected command, found ENFORCED_KW -ERROR@15482: expected command, found R_PAREN -ERROR@15531: expected NULL_KW -ERROR@15531: expected R_PAREN -ERROR@15531: expected SEMICOLON -ERROR@15532: expected command, found ENFORCED_KW -ERROR@15540: expected command, found R_PAREN -ERROR@15599: expected SEMICOLON -ERROR@15600: expected command, found ENFORCED_KW -ERROR@15666: expected SEMICOLON -ERROR@15667: expected command, found NOT_KW -ERROR@15671: expected command, found ENFORCED_KW -ERROR@18286: expected FOREIGN_KW -ERROR@18286: expected KEY_KW -ERROR@18286: expected column list -ERROR@18286: expected REFERENCES_KW -ERROR@18290: expected SEMICOLON -ERROR@18291: expected command, found NULL_KW -ERROR@18296: expected command, found IDENT -ERROR@18951: expected FOREIGN_KW -ERROR@18951: expected KEY_KW -ERROR@18951: expected column list -ERROR@18951: expected REFERENCES_KW -ERROR@18955: expected SEMICOLON -ERROR@18956: expected command, found NULL_KW -ERROR@18961: expected command, found IDENT -ERROR@19390: expected FOREIGN_KW -ERROR@19390: expected KEY_KW -ERROR@19390: expected column list -ERROR@19390: expected REFERENCES_KW -ERROR@19394: expected R_PAREN -ERROR@19394: expected SEMICOLON -ERROR@19395: expected command, found NULL_KW -ERROR@19400: expected command, found IDENT -ERROR@19401: expected command, found R_PAREN -ERROR@19445: expected FOREIGN_KW -ERROR@19445: expected KEY_KW -ERROR@19445: expected column list -ERROR@19445: expected REFERENCES_KW -ERROR@19449: expected R_PAREN -ERROR@19449: expected SEMICOLON -ERROR@19450: expected command, found NULL_KW -ERROR@19455: expected command, found IDENT -ERROR@19456: expected command, found COMMA -ERROR@19458: expected command, found IDENT -ERROR@19460: expected command, found INT_KW -ERROR@19464: expected command, found GENERATED_KW -ERROR@19474: expected command, found BY_KW -ERROR@19477: expected command, found DEFAULT_KW -ERROR@19485: expected command, found AS_KW -ERROR@19488: expected command, found IDENTITY_KW -ERROR@19496: expected command, found R_PAREN -ERROR@19710: expected FOREIGN_KW -ERROR@19710: expected KEY_KW -ERROR@19710: expected column list -ERROR@19710: expected REFERENCES_KW -ERROR@19714: expected R_PAREN -ERROR@19714: expected SEMICOLON -ERROR@19715: expected command, found NULL_KW -ERROR@19720: expected command, found IDENT -ERROR@19721: expected command, found R_PAREN -ERROR@19975: expected R_PAREN -ERROR@19975: expected SEMICOLON -ERROR@19976: expected command, found NO_KW -ERROR@19979: expected command, found INHERIT_KW -ERROR@19987: expected command, found CONSTRAINT_KW -ERROR@19998: expected command, found IDENT -ERROR@20002: expected command, found NOT_KW -ERROR@20006: expected command, found NULL_KW -ERROR@20010: expected command, found R_PAREN -ERROR@20089: expected FOREIGN_KW -ERROR@20089: expected KEY_KW -ERROR@20089: expected column list -ERROR@20089: expected REFERENCES_KW -ERROR@20093: expected R_PAREN -ERROR@20093: expected SEMICOLON -ERROR@20094: expected command, found NULL_KW -ERROR@20099: expected command, found IDENT -ERROR@20101: expected command, found NO_KW -ERROR@20104: expected command, found INHERIT_KW -ERROR@20111: expected command, found R_PAREN -ERROR@20193: expected FOREIGN_KW -ERROR@20193: expected KEY_KW -ERROR@20193: expected column list -ERROR@20193: expected REFERENCES_KW -ERROR@20197: expected R_PAREN -ERROR@20197: expected SEMICOLON -ERROR@20198: expected command, found NULL_KW -ERROR@20203: expected command, found IDENT -ERROR@20204: expected command, found R_PAREN -ERROR@20262: expected FOREIGN_KW -ERROR@20262: expected KEY_KW -ERROR@20262: expected column list -ERROR@20262: expected REFERENCES_KW -ERROR@20266: expected R_PAREN -ERROR@20266: expected SEMICOLON -ERROR@20267: expected command, found NULL_KW -ERROR@20272: expected command, found IDENT -ERROR@20273: expected command, found COMMA -ERROR@20275: expected command, found CONSTRAINT_KW -ERROR@20286: expected command, found IDENT -ERROR@20290: expected command, found NOT_KW -ERROR@20294: expected command, found NULL_KW -ERROR@20299: expected command, found IDENT -ERROR@20300: expected command, found R_PAREN -ERROR@20358: expected FOREIGN_KW -ERROR@20358: expected KEY_KW -ERROR@20358: expected column list -ERROR@20358: expected REFERENCES_KW -ERROR@20362: expected R_PAREN -ERROR@20362: expected SEMICOLON -ERROR@20363: expected command, found NULL_KW -ERROR@20368: expected command, found IDENT -ERROR@20370: expected command, found NO_KW -ERROR@20373: expected command, found INHERIT_KW -ERROR@20380: expected command, found R_PAREN -ERROR@20431: expected R_PAREN -ERROR@20431: expected SEMICOLON -ERROR@20432: expected command, found NO_KW -ERROR@20435: expected command, found INHERIT_KW -ERROR@20442: expected command, found R_PAREN -ERROR@20510: expected FOREIGN_KW -ERROR@20510: expected KEY_KW -ERROR@20510: expected column list -ERROR@20510: expected REFERENCES_KW -ERROR@20514: expected R_PAREN -ERROR@20514: expected SEMICOLON -ERROR@20515: expected command, found NULL_KW -ERROR@20520: expected command, found IDENT -ERROR@20521: expected command, found R_PAREN -ERROR@20596: expected R_PAREN -ERROR@20596: expected SEMICOLON -ERROR@20597: expected command, found NO_KW -ERROR@20600: expected command, found INHERIT_KW -ERROR@20607: expected command, found R_PAREN -ERROR@20655: expected R_PAREN -ERROR@20655: expected SEMICOLON -ERROR@20656: expected command, found NO_KW -ERROR@20659: expected command, found INHERIT_KW -ERROR@20667: expected command, found PRIMARY_KW -ERROR@20675: expected command, found KEY_KW -ERROR@20678: expected command, found R_PAREN -ERROR@20730: expected R_PAREN -ERROR@20730: expected SEMICOLON -ERROR@20731: expected command, found NOT_KW -ERROR@20735: expected command, found NULL_KW -ERROR@20740: expected command, found IDENT -ERROR@20742: expected command, found NO_KW -ERROR@20745: expected command, found INHERIT_KW -ERROR@20752: expected command, found R_PAREN -ERROR@20808: expected R_PAREN -ERROR@20808: expected SEMICOLON -ERROR@20809: expected command, found NOT_KW -ERROR@20813: expected command, found NULL_KW -ERROR@20818: expected command, found IDENT -ERROR@20820: expected command, found NO_KW -ERROR@20823: expected command, found INHERIT_KW -ERROR@20830: expected command, found R_PAREN -ERROR@20918: expected FOREIGN_KW -ERROR@20918: expected KEY_KW -ERROR@20918: expected column list -ERROR@20918: expected REFERENCES_KW -ERROR@20922: expected R_PAREN -ERROR@20922: expected SEMICOLON -ERROR@20923: expected command, found NULL_KW -ERROR@20928: expected command, found IDENT -ERROR@20930: expected command, found NO_KW -ERROR@20933: expected command, found INHERIT_KW -ERROR@20940: expected command, found R_PAREN -ERROR@21021: expected R_PAREN -ERROR@21021: expected SEMICOLON -ERROR@21022: expected command, found NO_KW -ERROR@21025: expected command, found INHERIT_KW -ERROR@21032: expected command, found R_PAREN -ERROR@21112: expected R_PAREN -ERROR@21112: expected SEMICOLON -ERROR@21113: expected command, found NOT_KW -ERROR@21117: expected command, found NULL_KW -ERROR@21122: expected command, found IDENT -ERROR@21124: expected command, found NO_KW -ERROR@21127: expected command, found INHERIT_KW -ERROR@21134: expected command, found R_PAREN -ERROR@21257: expected name -ERROR@21257: expected type name -ERROR@21266: expected SEMICOLON -ERROR@21267: expected command, found IDENT -ERROR@21269: expected command, found NO_KW -ERROR@21272: expected command, found INHERIT_KW -ERROR@21443: expected name -ERROR@21443: expected type name -ERROR@21452: expected SEMICOLON -ERROR@21453: expected command, found IDENT -ERROR@21455: expected command, found NO_KW -ERROR@21458: expected command, found INHERIT_KW -ERROR@21656: expected R_PAREN -ERROR@21656: expected SEMICOLON -ERROR@21657: expected command, found NO_KW -ERROR@21660: expected command, found INHERIT_KW -ERROR@21667: expected command, found R_PAREN -ERROR@21669: expected command, found PARTITION_KW -ERROR@21679: expected command, found BY_KW -ERROR@21682: expected command, found IDENT -ERROR@21687: expected command, found L_PAREN -ERROR@21688: expected command, found IDENT -ERROR@21689: expected command, found R_PAREN -ERROR@21719: expected R_PAREN -ERROR@21719: expected SEMICOLON -ERROR@21720: expected command, found NOT_KW -ERROR@21724: expected command, found NULL_KW -ERROR@21729: expected command, found IDENT -ERROR@21731: expected command, found NO_KW -ERROR@21734: expected command, found INHERIT_KW -ERROR@21741: expected command, found R_PAREN -ERROR@21743: expected command, found PARTITION_KW -ERROR@21753: expected command, found BY_KW -ERROR@21756: expected command, found IDENT -ERROR@21761: expected command, found L_PAREN -ERROR@21762: expected command, found IDENT -ERROR@21763: expected command, found R_PAREN -ERROR@21900: expected FOREIGN_KW -ERROR@21900: expected KEY_KW -ERROR@21900: expected column list -ERROR@21900: expected REFERENCES_KW -ERROR@21904: expected R_PAREN -ERROR@21904: expected SEMICOLON -ERROR@21905: expected command, found NULL_KW -ERROR@21910: expected command, found IDENT -ERROR@21912: expected command, found NO_KW -ERROR@21915: expected command, found INHERIT_KW -ERROR@21922: expected command, found R_PAREN -ERROR@22093: expected FOREIGN_KW -ERROR@22093: expected KEY_KW -ERROR@22093: expected column list -ERROR@22093: expected REFERENCES_KW -ERROR@22097: expected SEMICOLON -ERROR@22098: expected command, found NULL_KW -ERROR@22103: expected command, found IDENT -ERROR@22253: expected FOREIGN_KW -ERROR@22253: expected KEY_KW -ERROR@22253: expected column list -ERROR@22253: expected REFERENCES_KW -ERROR@22257: expected SEMICOLON -ERROR@22258: expected command, found NULL_KW -ERROR@22263: expected command, found IDENT -ERROR@24090: expected R_PAREN -ERROR@24090: expected SEMICOLON -ERROR@24091: expected command, found NO_KW -ERROR@24094: expected command, found INHERIT_KW -ERROR@24101: expected command, found R_PAREN -ERROR@24842: expected R_PAREN -ERROR@24842: expected SEMICOLON -ERROR@24843: expected command, found NOT_KW -ERROR@24847: expected command, found NULL_KW -ERROR@24852: expected command, found IDENT -ERROR@24853: expected command, found R_PAREN -ERROR@25154: expected FOREIGN_KW -ERROR@25154: expected KEY_KW -ERROR@25154: expected column list -ERROR@25154: expected REFERENCES_KW -ERROR@25158: expected R_PAREN -ERROR@25158: expected SEMICOLON -ERROR@25159: expected command, found NULL_KW -ERROR@25164: expected command, found IDENT -ERROR@25165: expected command, found R_PAREN -ERROR@25167: expected command, found INHERITS_KW -ERROR@25176: expected command, found L_PAREN -ERROR@25177: expected command, found IDENT -ERROR@25189: expected command, found R_PAREN -ERROR@26278: expected FOREIGN_KW -ERROR@26278: expected KEY_KW -ERROR@26278: expected column list -ERROR@26278: expected REFERENCES_KW -ERROR@26282: expected SEMICOLON -ERROR@26283: expected command, found NULL_KW -ERROR@26288: expected command, found IDENT -ERROR@26342: expected FOREIGN_KW -ERROR@26342: expected KEY_KW -ERROR@26342: expected column list -ERROR@26342: expected REFERENCES_KW -ERROR@26346: expected SEMICOLON -ERROR@26347: expected command, found NULL_KW -ERROR@26352: expected command, found IDENT -ERROR@26354: expected command, found NOT_KW -ERROR@26358: expected command, found VALID_KW -ERROR@26563: expected FOREIGN_KW -ERROR@26563: expected KEY_KW -ERROR@26563: expected column list -ERROR@26563: expected REFERENCES_KW -ERROR@26567: expected SEMICOLON -ERROR@26568: expected command, found NULL_KW -ERROR@26573: expected command, found IDENT -ERROR@26575: expected command, found NOT_KW -ERROR@26579: expected command, found VALID_KW -ERROR@26585: expected command, found NO_KW -ERROR@26588: expected command, found INHERIT_KW -ERROR@26639: expected FOREIGN_KW -ERROR@26639: expected KEY_KW -ERROR@26639: expected column list -ERROR@26639: expected REFERENCES_KW -ERROR@26643: expected SEMICOLON -ERROR@26644: expected command, found NULL_KW -ERROR@26649: expected command, found IDENT -ERROR@27519: expected name -ERROR@27519: expected type name -ERROR@27528: expected SEMICOLON -ERROR@27529: expected command, found IDENT -ERROR@27531: expected command, found NOT_KW -ERROR@27535: expected command, found VALID_KW -ERROR@28291: expected name -ERROR@28291: expected type name -ERROR@28300: expected SEMICOLON -ERROR@28301: expected command, found IDENT -ERROR@28303: expected command, found NOT_KW -ERROR@28307: expected command, found VALID_KW -ERROR@28312: expected command, found COMMA -ERROR@28315: expected command, found ADD_KW -ERROR@28319: expected command, found NOT_KW -ERROR@28323: expected command, found NULL_KW -ERROR@28328: expected command, found IDENT -ERROR@28330: expected command, found NOT_KW -ERROR@28334: expected command, found VALID_KW -ERROR@28676: expected FOREIGN_KW -ERROR@28676: expected KEY_KW -ERROR@28676: expected column list -ERROR@28676: expected REFERENCES_KW -ERROR@28680: expected SEMICOLON -ERROR@28681: expected command, found NULL_KW -ERROR@28686: expected command, found IDENT -ERROR@28688: expected command, found NOT_KW -ERROR@28692: expected command, found VALID_KW -ERROR@28749: expected SEMICOLON -ERROR@28750: expected command, found NO_KW -ERROR@28753: expected command, found INHERIT_KW -ERROR@28874: expected SEMICOLON -ERROR@28875: expected command, found INHERIT_KW -ERROR@29160: expected FOREIGN_KW -ERROR@29160: expected KEY_KW -ERROR@29160: expected column list -ERROR@29160: expected REFERENCES_KW -ERROR@29164: expected SEMICOLON -ERROR@29165: expected command, found NULL_KW -ERROR@29170: expected command, found IDENT -ERROR@29172: expected command, found NOT_KW -ERROR@29176: expected command, found VALID_KW -ERROR@29237: expected FOREIGN_KW -ERROR@29237: expected KEY_KW -ERROR@29237: expected column list -ERROR@29237: expected REFERENCES_KW -ERROR@29241: expected R_PAREN -ERROR@29241: expected SEMICOLON -ERROR@29242: expected command, found NULL_KW -ERROR@29247: expected command, found IDENT -ERROR@29248: expected command, found R_PAREN -ERROR@29409: expected FOREIGN_KW -ERROR@29409: expected KEY_KW -ERROR@29409: expected column list -ERROR@29409: expected REFERENCES_KW -ERROR@29413: expected SEMICOLON -ERROR@29414: expected command, found NULL_KW -ERROR@29419: expected command, found IDENT -ERROR@29421: expected command, found NOT_KW -ERROR@29425: expected command, found VALID_KW -ERROR@29987: expected FOREIGN_KW -ERROR@29987: expected KEY_KW -ERROR@29987: expected column list -ERROR@29987: expected REFERENCES_KW -ERROR@29991: expected SEMICOLON -ERROR@29992: expected command, found NULL_KW -ERROR@29997: expected command, found IDENT -ERROR@29999: expected command, found NOT_KW -ERROR@30003: expected command, found VALID_KW -ERROR@30057: expected FOREIGN_KW -ERROR@30057: expected KEY_KW -ERROR@30057: expected column list -ERROR@30057: expected REFERENCES_KW -ERROR@30061: expected SEMICOLON -ERROR@30062: expected command, found NULL_KW -ERROR@30067: expected command, found IDENT -ERROR@30581: expected FOREIGN_KW -ERROR@30581: expected KEY_KW -ERROR@30581: expected column list -ERROR@30581: expected REFERENCES_KW -ERROR@30585: expected SEMICOLON -ERROR@30586: expected command, found NULL_KW -ERROR@30591: expected command, found IDENT -ERROR@30593: expected command, found NOT_KW -ERROR@30597: expected command, found VALID_KW -ERROR@30733: expected FOREIGN_KW -ERROR@30733: expected KEY_KW -ERROR@30733: expected column list -ERROR@30733: expected REFERENCES_KW -ERROR@30737: expected R_PAREN -ERROR@30737: expected SEMICOLON -ERROR@30738: expected command, found NULL_KW -ERROR@30743: expected command, found IDENT -ERROR@30744: expected command, found COMMA -ERROR@30746: expected command, found IDENT -ERROR@30748: expected command, found INT_KW -ERROR@30751: expected command, found R_PAREN -ERROR@30964: expected FOREIGN_KW -ERROR@30964: expected KEY_KW -ERROR@30964: expected column list -ERROR@30964: expected REFERENCES_KW -ERROR@30968: expected SEMICOLON -ERROR@30969: expected command, found NULL_KW -ERROR@30974: expected command, found IDENT -ERROR@30976: expected command, found NOT_KW -ERROR@30980: expected command, found VALID_KW -ERROR@31648: expected R_PAREN -ERROR@31648: expected SEMICOLON -ERROR@31649: expected command, found NOT_KW -ERROR@31653: expected command, found NULL_KW -ERROR@31658: expected command, found IDENT -ERROR@31659: expected command, found R_PAREN -ERROR@31661: expected command, found PARTITION_KW -ERROR@31671: expected command, found BY_KW -ERROR@31674: expected command, found IDENT -ERROR@31679: expected command, found L_PAREN -ERROR@31680: expected command, found IDENT -ERROR@31681: expected command, found R_PAREN -ERROR@31758: expected FOREIGN_KW -ERROR@31758: expected KEY_KW -ERROR@31758: expected column list -ERROR@31758: expected REFERENCES_KW -ERROR@31762: expected SEMICOLON -ERROR@31763: expected command, found NULL_KW -ERROR@31768: expected command, found IDENT -ERROR@31770: expected command, found NOT_KW -ERROR@31774: expected command, found VALID_KW -ERROR@32238: expected FOREIGN_KW -ERROR@32238: expected KEY_KW -ERROR@32238: expected column list -ERROR@32238: expected REFERENCES_KW -ERROR@32242: expected SEMICOLON -ERROR@32243: expected command, found NULL_KW -ERROR@32248: expected command, found IDENT -ERROR@32250: expected command, found NOT_KW -ERROR@32254: expected command, found VALID_KW -ERROR@32544: expected FOREIGN_KW -ERROR@32544: expected KEY_KW -ERROR@32544: expected column list -ERROR@32544: expected REFERENCES_KW -ERROR@32548: expected SEMICOLON -ERROR@32549: expected command, found NULL_KW -ERROR@32554: expected command, found IDENT -ERROR@32556: expected command, found NO_KW -ERROR@32559: expected command, found INHERIT_KW -ERROR@32857: expected FOREIGN_KW -ERROR@32857: expected KEY_KW -ERROR@32857: expected column list -ERROR@32857: expected REFERENCES_KW -ERROR@32861: expected SEMICOLON -ERROR@32862: expected command, found NULL_KW -ERROR@32867: expected command, found IDENT -ERROR@32869: expected command, found NOT_KW -ERROR@32873: expected command, found VALID_KW -ERROR@33064: expected FOREIGN_KW -ERROR@33064: expected KEY_KW -ERROR@33064: expected column list -ERROR@33064: expected REFERENCES_KW -ERROR@33068: expected SEMICOLON -ERROR@33069: expected command, found NULL_KW -ERROR@33074: expected command, found IDENT -ERROR@33125: expected FOREIGN_KW -ERROR@33125: expected KEY_KW -ERROR@33125: expected column list -ERROR@33125: expected REFERENCES_KW -ERROR@33129: expected SEMICOLON -ERROR@33130: expected command, found NULL_KW -ERROR@33135: expected command, found IDENT -ERROR@33137: expected command, found NOT_KW -ERROR@33141: expected command, found VALID_KW -ERROR@33499: expected FOREIGN_KW -ERROR@33499: expected KEY_KW -ERROR@33499: expected column list -ERROR@33499: expected REFERENCES_KW -ERROR@33503: expected SEMICOLON -ERROR@33504: expected command, found NULL_KW -ERROR@33509: expected command, found IDENT -ERROR@33511: expected command, found NOT_KW -ERROR@33515: expected command, found VALID_KW -ERROR@33667: expected FOREIGN_KW -ERROR@33667: expected KEY_KW -ERROR@33667: expected column list -ERROR@33667: expected REFERENCES_KW -ERROR@33671: expected R_PAREN -ERROR@33671: expected SEMICOLON -ERROR@33672: expected command, found NULL_KW -ERROR@33677: expected command, found IDENT -ERROR@33678: expected command, found COMMA -ERROR@33680: expected command, found IDENT -ERROR@33682: expected command, found INT_KW -ERROR@33685: expected command, found R_PAREN -ERROR@33923: expected FOREIGN_KW -ERROR@33923: expected KEY_KW -ERROR@33923: expected column list -ERROR@33923: expected REFERENCES_KW -ERROR@33927: expected SEMICOLON -ERROR@33928: expected command, found NULL_KW -ERROR@33933: expected command, found IDENT -ERROR@33935: expected command, found NOT_KW -ERROR@33939: expected command, found VALID_KW -ERROR@34322: expected name -ERROR@34322: expected type name -ERROR@34331: expected SEMICOLON -ERROR@34332: expected command, found IDENT -ERROR@34334: expected command, found NOT_KW -ERROR@34338: expected command, found VALID_KW -ERROR@34605: expected name -ERROR@34605: expected type name -ERROR@34614: expected SEMICOLON -ERROR@34615: expected command, found IDENT -ERROR@34617: expected command, found NOT_KW -ERROR@34621: expected command, found VALID_KW diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_create_index.snap b/crates/squawk_parser/tests/snapshots/tests__regression_create_index.snap index 81a96248..c7eb35e4 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_create_index.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_create_index.snap @@ -3,12 +3,6 @@ source: crates/squawk_parser/tests/tests.rs input_file: crates/squawk_parser/tests/data/regression_suite/create_index.sql --- ERROR@323: expected name -ERROR@47198: expected SEMICOLON -ERROR@47198: expected command, found DOT -ERROR@47199: expected command, found IDENT -ERROR@47275: expected SEMICOLON -ERROR@47275: expected command, found DOT -ERROR@47276: expected command, found IDENT ERROR@52343: expected name ERROR@52343: expected SEMICOLON ERROR@52344: expected command, found STRING @@ -18,9 +12,3 @@ ERROR@53442: expected command, found R_PAREN ERROR@53474: expected R_PAREN ERROR@53520: expected SEMICOLON ERROR@53520: expected command, found R_PAREN -ERROR@56467: expected SEMICOLON -ERROR@56467: expected command, found DOT -ERROR@56468: expected command, found IDENT -ERROR@56505: expected SEMICOLON -ERROR@56505: expected command, found DOT -ERROR@56506: expected command, found IDENT diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_create_table_like.snap b/crates/squawk_parser/tests/snapshots/tests__regression_create_table_like.snap index d51cb922..d592e817 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_create_table_like.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_create_table_like.snap @@ -2,31 +2,6 @@ source: crates/squawk_parser/tests/tests.rs input_file: crates/squawk_parser/tests/data/regression_suite/create_table_like.sql --- -ERROR@5112: expected R_PAREN -ERROR@5112: expected SEMICOLON -ERROR@5113: expected command, found ENFORCED_KW -ERROR@5122: expected command, found PRIMARY_KW -ERROR@5130: expected command, found KEY_KW -ERROR@5133: expected command, found COMMA -ERROR@5136: expected command, found IDENT -ERROR@5138: expected command, found TEXT_KW -ERROR@5143: expected command, found CHECK_KW -ERROR@5149: expected command, found L_PAREN -ERROR@5150: expected command, found IDENT -ERROR@5156: expected command, found L_PAREN -ERROR@5157: expected command, found IDENT -ERROR@5158: expected command, found R_PAREN -ERROR@5160: expected command, found R_ANGLE -ERROR@5162: expected command, found INT_NUMBER -ERROR@5165: expected command, found R_PAREN -ERROR@5167: expected command, found NOT_KW -ERROR@5171: expected command, found ENFORCED_KW -ERROR@5179: expected command, found R_PAREN -ERROR@8398: expected R_PAREN -ERROR@8398: expected SEMICOLON -ERROR@8399: expected command, found NO_KW -ERROR@8402: expected command, found INHERIT_KW -ERROR@8409: expected command, found R_PAREN ERROR@9797: expected name ERROR@9797: expected R_PAREN ERROR@9797: expected SERVER_KW diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_domain.snap b/crates/squawk_parser/tests/snapshots/tests__regression_domain.snap index da552094..268dabac 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_domain.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_domain.snap @@ -2,9 +2,6 @@ source: crates/squawk_parser/tests/tests.rs input_file: crates/squawk_parser/tests/data/regression_suite/domain.sql --- -ERROR@544: expected SEMICOLON -ERROR@545: expected command, found NO_KW -ERROR@548: expected command, found INHERIT_KW ERROR@991: expected L_PAREN ERROR@993: expected L_PAREN ERROR@994: expected L_PAREN @@ -40,13 +37,3 @@ ERROR@10397: expected command, found ARRAY_KW ERROR@10402: expected command, found L_BRACK ERROR@10403: expected command, found INT_NUMBER ERROR@10405: expected command, found R_BRACK -ERROR@25791: expected SEMICOLON -ERROR@25792: expected command, found ENFORCED_KW -ERROR@25898: expected NULL_KW -ERROR@25898: expected SEMICOLON -ERROR@25899: expected command, found ENFORCED_KW -ERROR@26072: expected SEMICOLON -ERROR@26073: expected command, found ENFORCED_KW -ERROR@26171: expected VALID_KW -ERROR@26171: expected SEMICOLON -ERROR@26172: expected command, found ENFORCED_KW diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_drop_if_exists.snap b/crates/squawk_parser/tests/snapshots/tests__regression_drop_if_exists.snap index 63e204bc..9acb6cd6 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_drop_if_exists.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_drop_if_exists.snap @@ -2,16 +2,6 @@ source: crates/squawk_parser/tests/tests.rs input_file: crates/squawk_parser/tests/data/regression_suite/drop_if_exists.sql --- -ERROR@6109: expected R_PAREN -ERROR@6109: expected SEMICOLON -ERROR@6109: expected command, found DOT -ERROR@6110: expected command, found IDENT -ERROR@6122: expected command, found R_PAREN -ERROR@6640: expected R_PAREN -ERROR@6640: expected SEMICOLON -ERROR@6640: expected command, found DOT -ERROR@6641: expected command, found IDENT -ERROR@6653: expected command, found R_PAREN ERROR@7333: expected SEMICOLON ERROR@7333: expected command, found DOT ERROR@7334: expected command, found IDENT diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_foreign_key.snap b/crates/squawk_parser/tests/snapshots/tests__regression_foreign_key.snap index cc18d438..b3d92bdd 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_foreign_key.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_foreign_key.snap @@ -2,74 +2,6 @@ source: crates/squawk_parser/tests/tests.rs input_file: crates/squawk_parser/tests/data/regression_suite/foreign_key.sql --- -ERROR@273: expected NULL_KW -ERROR@273: expected R_PAREN -ERROR@273: expected SEMICOLON -ERROR@274: expected command, found ENFORCED_KW -ERROR@282: expected command, found COMMA -ERROR@292: expected command, found IDENT -ERROR@299: expected command, found INT_KW -ERROR@303: expected command, found R_PAREN -ERROR@752: expected SEMICOLON -ERROR@753: expected command, found ENFORCED_KW -ERROR@989: expected SEMICOLON -ERROR@990: expected command, found ENFORCED_KW -ERROR@7716: expected SEMICOLON -ERROR@7717: expected command, found NOT_KW -ERROR@7721: expected command, found ENFORCED_KW -ERROR@7956: expected SEMICOLON -ERROR@7957: expected command, found NOT_KW -ERROR@7961: expected command, found ENFORCED_KW -ERROR@8240: expected SEMICOLON -ERROR@8241: expected command, found ENFORCED_KW -ERROR@8457: expected SEMICOLON -ERROR@8458: expected command, found NOT_KW -ERROR@8462: expected command, found ENFORCED_KW -ERROR@8471: expected command, found NOT_KW -ERROR@8475: expected command, found DEFERRABLE_KW -ERROR@32902: expected SEMICOLON -ERROR@32903: expected command, found NOT_KW -ERROR@32907: expected command, found ENFORCED_KW -ERROR@33284: constraint declared INITIALLY DEFERRED must be DEFERRABLE -ERROR@33338: expected SEMICOLON -ERROR@33339: expected command, found NO_KW -ERROR@33342: expected command, found INHERIT_KW -ERROR@33403: expected SEMICOLON -ERROR@33404: expected command, found NOT_KW -ERROR@33408: expected command, found VALID_KW -ERROR@33467: expected SEMICOLON -ERROR@33468: expected command, found ENFORCED_KW -ERROR@33477: expected command, found NOT_KW -ERROR@33481: expected command, found ENFORCED_KW -ERROR@33544: expected R_PAREN -ERROR@33544: expected SEMICOLON -ERROR@33545: expected command, found ENFORCED_KW -ERROR@33554: expected command, found NOT_KW -ERROR@33558: expected command, found ENFORCED_KW -ERROR@33566: expected command, found R_PAREN -ERROR@39895: expected VALID_KW -ERROR@39895: expected SEMICOLON -ERROR@39896: expected command, found ENFORCED_KW -ERROR@40180: expected VALID_KW -ERROR@40180: expected SEMICOLON -ERROR@40181: expected command, found ENFORCED_KW -ERROR@40375: expected SEMICOLON -ERROR@40376: expected command, found ENFORCED_KW -ERROR@43083: expected SEMICOLON -ERROR@43084: expected command, found NOT_KW -ERROR@43088: expected command, found ENFORCED_KW -ERROR@43592: expected SEMICOLON -ERROR@43593: expected command, found ENFORCED_KW -ERROR@54108: expected R_PAREN -ERROR@54108: expected SEMICOLON -ERROR@54109: expected command, found NOT_KW -ERROR@54113: expected command, found ENFORCED_KW -ERROR@54121: expected command, found R_PAREN -ERROR@54469: expected SEMICOLON -ERROR@54470: expected command, found ENFORCED_KW -ERROR@54695: expected SEMICOLON -ERROR@54696: expected command, found NOT_KW -ERROR@54700: expected command, found ENFORCED_KW ERROR@65605: expected SEMICOLON ERROR@65605: expected command, found DOT ERROR@65606: expected command, found IDENT diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_generated_virtual.snap b/crates/squawk_parser/tests/snapshots/tests__regression_generated_virtual.snap deleted file mode 100644 index d304a621..00000000 --- a/crates/squawk_parser/tests/snapshots/tests__regression_generated_virtual.snap +++ /dev/null @@ -1,23 +0,0 @@ ---- -source: crates/squawk_parser/tests/tests.rs -input_file: crates/squawk_parser/tests/data/regression_suite/generated_virtual.sql ---- -ERROR@12952: expected FOREIGN_KW -ERROR@12952: expected KEY_KW -ERROR@12952: expected column list -ERROR@12952: expected REFERENCES_KW -ERROR@12956: expected R_PAREN -ERROR@12956: expected SEMICOLON -ERROR@12957: expected command, found NULL_KW -ERROR@12962: expected command, found IDENT -ERROR@12963: expected command, found R_PAREN -ERROR@13354: expected FOREIGN_KW -ERROR@13354: expected KEY_KW -ERROR@13354: expected column list -ERROR@13354: expected REFERENCES_KW -ERROR@13358: expected SEMICOLON -ERROR@13359: expected command, found NULL_KW -ERROR@13364: expected command, found IDENT -ERROR@29901: expected STORED or VIRTUAL -ERROR@29940: expected STORED or VIRTUAL -ERROR@29988: expected STORED or VIRTUAL diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_inherit.snap b/crates/squawk_parser/tests/snapshots/tests__regression_inherit.snap index c393c7f1..5b743909 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_inherit.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_inherit.snap @@ -2,88 +2,6 @@ source: crates/squawk_parser/tests/tests.rs input_file: crates/squawk_parser/tests/data/regression_suite/inherit.sql --- -ERROR@20202: expected VALID_KW -ERROR@20202: expected SEMICOLON -ERROR@20203: expected command, found ENFORCED_KW -ERROR@20286: expected VALID_KW -ERROR@20286: expected SEMICOLON -ERROR@20287: expected command, found ENFORCED_KW -ERROR@20372: expected VALID_KW -ERROR@20372: expected SEMICOLON -ERROR@20373: expected command, found ENFORCED_KW -ERROR@20454: expected VALID_KW -ERROR@20454: expected SEMICOLON -ERROR@20455: expected command, found ENFORCED_KW -ERROR@20614: expected SEMICOLON -ERROR@20615: expected command, found ENFORCED_KW -ERROR@20696: expected VALID_KW -ERROR@20696: expected SEMICOLON -ERROR@20697: expected command, found ENFORCED_KW -ERROR@20779: expected VALID_KW -ERROR@20779: expected SEMICOLON -ERROR@20780: expected command, found ENFORCED_KW -ERROR@20860: expected SEMICOLON -ERROR@20861: expected command, found ENFORCED_KW -ERROR@20952: expected SEMICOLON -ERROR@20953: expected command, found ENFORCED_KW -ERROR@21034: expected VALID_KW -ERROR@21034: expected SEMICOLON -ERROR@21035: expected command, found ENFORCED_KW -ERROR@21187: expected VALID_KW -ERROR@21187: expected SEMICOLON -ERROR@21188: expected command, found ENFORCED_KW -ERROR@21279: expected SEMICOLON -ERROR@21280: expected command, found ENFORCED_KW -ERROR@21486: expected VALID_KW -ERROR@21486: expected SEMICOLON -ERROR@21487: expected command, found ENFORCED_KW -ERROR@21564: expected SEMICOLON -ERROR@21565: expected command, found ENFORCED_KW -ERROR@21643: expected SEMICOLON -ERROR@21644: expected command, found ENFORCED_KW -ERROR@21728: expected VALID_KW -ERROR@21728: expected SEMICOLON -ERROR@21729: expected command, found ENFORCED_KW -ERROR@21820: expected NULL_KW -ERROR@21820: expected R_PAREN -ERROR@21820: expected SEMICOLON -ERROR@21821: expected command, found ENFORCED_KW -ERROR@21829: expected command, found R_PAREN -ERROR@21831: expected command, found INHERITS_KW -ERROR@21839: expected command, found L_PAREN -ERROR@21840: expected command, found IDENT -ERROR@21842: expected command, found R_PAREN -ERROR@22138: expected NULL_KW -ERROR@22138: expected R_PAREN -ERROR@22138: expected SEMICOLON -ERROR@22139: expected command, found ENFORCED_KW -ERROR@22147: expected command, found R_PAREN -ERROR@22149: expected command, found INHERITS_KW -ERROR@22157: expected command, found L_PAREN -ERROR@22158: expected command, found IDENT -ERROR@22160: expected command, found COMMA -ERROR@22162: expected command, found IDENT -ERROR@22167: expected command, found R_PAREN -ERROR@22631: expected NULL_KW -ERROR@22631: expected R_PAREN -ERROR@22631: expected SEMICOLON -ERROR@22632: expected command, found ENFORCED_KW -ERROR@22640: expected command, found R_PAREN -ERROR@22705: expected R_PAREN -ERROR@22705: expected SEMICOLON -ERROR@22706: expected command, found ENFORCED_KW -ERROR@22714: expected command, found R_PAREN -ERROR@22830: expected R_PAREN -ERROR@22830: expected SEMICOLON -ERROR@22831: expected command, found ENFORCED_KW -ERROR@22839: expected command, found R_PAREN -ERROR@22908: expected NULL_KW -ERROR@22908: expected R_PAREN -ERROR@22908: expected SEMICOLON -ERROR@22909: expected command, found ENFORCED_KW -ERROR@22917: expected command, found R_PAREN -ERROR@25405: expected type name -ERROR@25408: expected type name ERROR@30331: expected R_PAREN ERROR@30426: missing comma ERROR@30455: expected SEMICOLON @@ -114,195 +32,3 @@ ERROR@30747: expected command, found IDENT ERROR@30748: expected command, found L_PAREN ERROR@30749: expected command, found IDENT ERROR@30750: expected command, found R_PAREN -ERROR@33247: expected R_PAREN -ERROR@33247: expected SEMICOLON -ERROR@33248: expected command, found NO_KW -ERROR@33251: expected command, found INHERIT_KW -ERROR@33258: expected command, found R_PAREN -ERROR@33260: expected command, found INHERITS_KW -ERROR@33269: expected command, found L_PAREN -ERROR@33270: expected command, found IDENT -ERROR@33273: expected command, found R_PAREN -ERROR@33373: expected name -ERROR@33373: expected type name -ERROR@33382: expected SEMICOLON -ERROR@33383: expected command, found IDENT -ERROR@33386: expected command, found NO_KW -ERROR@33389: expected command, found INHERIT_KW -ERROR@34034: expected R_PAREN -ERROR@34034: expected SEMICOLON -ERROR@34035: expected command, found NO_KW -ERROR@34038: expected command, found INHERIT_KW -ERROR@34045: expected command, found COMMA -ERROR@34047: expected command, found IDENT -ERROR@34050: expected command, found INT_KW -ERROR@34054: expected command, found NOT_KW -ERROR@34058: expected command, found NULL_KW -ERROR@34063: expected command, found NO_KW -ERROR@34066: expected command, found INHERIT_KW -ERROR@34073: expected command, found R_PAREN -ERROR@34115: expected R_PAREN -ERROR@34115: expected SEMICOLON -ERROR@34116: expected command, found NO_KW -ERROR@34119: expected command, found INHERIT_KW -ERROR@34126: expected command, found COMMA -ERROR@34128: expected command, found IDENT -ERROR@34131: expected command, found INT_KW -ERROR@34134: expected command, found R_PAREN -ERROR@35498: expected FOREIGN_KW -ERROR@35498: expected KEY_KW -ERROR@35498: expected column list -ERROR@35498: expected REFERENCES_KW -ERROR@35502: expected R_PAREN -ERROR@35502: expected SEMICOLON -ERROR@35503: expected command, found NULL_KW -ERROR@35508: expected command, found IDENT -ERROR@35509: expected command, found R_PAREN -ERROR@35511: expected command, found INHERITS_KW -ERROR@35520: expected command, found L_PAREN -ERROR@35521: expected command, found IDENT -ERROR@35532: expected command, found COMMA -ERROR@35534: expected command, found IDENT -ERROR@35545: expected command, found R_PAREN -ERROR@36331: expected name -ERROR@36331: expected type name -ERROR@36340: expected SEMICOLON -ERROR@36341: expected command, found IDENT -ERROR@36343: expected command, found NO_KW -ERROR@36346: expected command, found INHERIT_KW -ERROR@36782: expected R_PAREN -ERROR@36782: expected SEMICOLON -ERROR@36783: expected command, found NOT_KW -ERROR@36787: expected command, found NULL_KW -ERROR@36792: expected command, found IDENT -ERROR@36794: expected command, found NO_KW -ERROR@36797: expected command, found INHERIT_KW -ERROR@36804: expected command, found R_PAREN -ERROR@36905: expected FOREIGN_KW -ERROR@36905: expected KEY_KW -ERROR@36905: expected column list -ERROR@36905: expected REFERENCES_KW -ERROR@36909: expected SEMICOLON -ERROR@36910: expected command, found NULL_KW -ERROR@36915: expected command, found IDENT -ERROR@37265: expected FOREIGN_KW -ERROR@37265: expected KEY_KW -ERROR@37265: expected column list -ERROR@37265: expected REFERENCES_KW -ERROR@37269: expected R_PAREN -ERROR@37269: expected SEMICOLON -ERROR@37270: expected command, found NULL_KW -ERROR@37275: expected command, found IDENT -ERROR@37277: expected command, found NO_KW -ERROR@37280: expected command, found INHERIT_KW -ERROR@37287: expected command, found R_PAREN -ERROR@37289: expected command, found INHERITS_KW -ERROR@37298: expected command, found L_PAREN -ERROR@37299: expected command, found IDENT -ERROR@37310: expected command, found R_PAREN -ERROR@37532: expected R_PAREN -ERROR@37532: expected SEMICOLON -ERROR@37533: expected command, found NOT_KW -ERROR@37537: expected command, found NULL_KW -ERROR@37542: expected command, found IDENT -ERROR@37544: expected command, found NO_KW -ERROR@37547: expected command, found INHERIT_KW -ERROR@37554: expected command, found R_PAREN -ERROR@37632: expected R_PAREN -ERROR@37632: expected SEMICOLON -ERROR@37633: expected command, found NO_KW -ERROR@37636: expected command, found INHERIT_KW -ERROR@37643: expected command, found R_PAREN -ERROR@37645: expected command, found INHERITS_KW -ERROR@37654: expected command, found L_PAREN -ERROR@37655: expected command, found IDENT -ERROR@37662: expected command, found R_PAREN -ERROR@37709: expected R_PAREN -ERROR@37709: expected SEMICOLON -ERROR@37711: expected command, found NOT_KW -ERROR@37715: expected command, found NULL_KW -ERROR@37720: expected command, found IDENT -ERROR@37722: expected command, found NO_KW -ERROR@37725: expected command, found INHERIT_KW -ERROR@37732: expected command, found R_PAREN -ERROR@37771: expected R_PAREN -ERROR@37771: expected SEMICOLON -ERROR@37772: expected command, found NO_KW -ERROR@37775: expected command, found INHERIT_KW -ERROR@37782: expected command, found COMMA -ERROR@37784: expected command, found IDENT -ERROR@37786: expected command, found INT_KW -ERROR@37789: expected command, found COMMA -ERROR@37792: expected command, found NOT_KW -ERROR@37796: expected command, found NULL_KW -ERROR@37801: expected command, found IDENT -ERROR@37802: expected command, found R_PAREN -ERROR@39386: expected R_PAREN -ERROR@39386: expected SEMICOLON -ERROR@39387: expected command, found NO_KW -ERROR@39390: expected command, found INHERIT_KW -ERROR@39397: expected command, found R_PAREN -ERROR@42640: expected R_PAREN -ERROR@42640: expected SEMICOLON -ERROR@42641: expected command, found NO_KW -ERROR@42644: expected command, found INHERIT_KW -ERROR@42651: expected command, found R_PAREN -ERROR@42984: expected SEMICOLON -ERROR@42985: expected command, found INHERIT_KW -ERROR@43334: expected SEMICOLON -ERROR@43335: expected command, found NO_KW -ERROR@43338: expected command, found INHERIT_KW -ERROR@44043: expected R_PAREN -ERROR@44043: expected SEMICOLON -ERROR@44044: expected command, found NO_KW -ERROR@44047: expected command, found INHERIT_KW -ERROR@44054: expected command, found R_PAREN -ERROR@44219: expected SEMICOLON -ERROR@44220: expected command, found INHERIT_KW -ERROR@44451: expected SEMICOLON -ERROR@44452: expected command, found INHERIT_KW -ERROR@44459: expected command, found COMMA -ERROR@44464: expected command, found ALTER_KW -ERROR@44470: expected command, found CONSTRAINT_KW -ERROR@44481: expected command, found IDENT -ERROR@44501: expected command, found NO_KW -ERROR@44504: expected command, found INHERIT_KW -ERROR@44879: expected R_PAREN -ERROR@44879: expected SEMICOLON -ERROR@44880: expected command, found NO_KW -ERROR@44883: expected command, found INHERIT_KW -ERROR@44890: expected command, found R_PAREN -ERROR@45001: expected FOREIGN_KW -ERROR@45001: expected KEY_KW -ERROR@45001: expected column list -ERROR@45001: expected REFERENCES_KW -ERROR@45005: expected R_PAREN -ERROR@45005: expected SEMICOLON -ERROR@45006: expected command, found NULL_KW -ERROR@45011: expected command, found IDENT -ERROR@45014: expected command, found NO_KW -ERROR@45017: expected command, found INHERIT_KW -ERROR@45024: expected command, found R_PAREN -ERROR@45026: expected command, found INHERITS_KW -ERROR@45035: expected command, found L_PAREN -ERROR@45036: expected command, found IDENT -ERROR@45043: expected command, found COMMA -ERROR@45045: expected command, found IDENT -ERROR@45052: expected command, found R_PAREN -ERROR@45376: expected SEMICOLON -ERROR@45377: expected command, found INHERIT_KW -ERROR@45429: expected SEMICOLON -ERROR@45430: expected command, found INHERIT_KW -ERROR@45495: expected SEMICOLON -ERROR@45496: expected command, found INHERIT_KW -ERROR@46019: expected SEMICOLON -ERROR@46020: expected command, found INHERIT_KW -ERROR@46078: expected SEMICOLON -ERROR@46079: expected command, found INHERIT_KW -ERROR@46140: expected SEMICOLON -ERROR@46141: expected command, found INHERIT_KW -ERROR@46230: expected SEMICOLON -ERROR@46231: expected command, found INHERIT_KW -ERROR@46396: expected SEMICOLON -ERROR@46397: expected command, found NO_KW -ERROR@46400: expected command, found INHERIT_KW diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_matview.snap b/crates/squawk_parser/tests/snapshots/tests__regression_matview.snap deleted file mode 100644 index 4069d73e..00000000 --- a/crates/squawk_parser/tests/snapshots/tests__regression_matview.snap +++ /dev/null @@ -1,9 +0,0 @@ ---- -source: crates/squawk_parser/tests/tests.rs -input_file: crates/squawk_parser/tests/data/regression_suite/matview.sql ---- -ERROR@4758: expected type name -ERROR@4761: expected type name -ERROR@5137: expected type name -ERROR@5140: expected type name -ERROR@5143: expected type name diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_misc.snap b/crates/squawk_parser/tests/snapshots/tests__regression_misc.snap index cdc76574..911bb15d 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_misc.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_misc.snap @@ -10,21 +10,3 @@ ERROR@1539: expected SEMICOLON ERROR@1540: expected command, found IDENT ERROR@1554: expected command, found FROM_KW ERROR@1559: expected command, found STRING -ERROR@2825: expected R_PAREN -ERROR@2825: expected function option -ERROR@2825: expected SEMICOLON -ERROR@2825: expected command, found DOT -ERROR@2826: expected command, found NAME_KW -ERROR@2830: expected command, found PERCENT -ERROR@2831: expected command, found TYPE_KW -ERROR@2835: expected command, found R_PAREN -ERROR@2840: expected command, found RETURNS_KW -ERROR@2848: expected command, found IDENT -ERROR@2857: expected command, found DOT -ERROR@2858: expected command, found IDENT -ERROR@2864: expected command, found PERCENT -ERROR@2865: expected command, found TYPE_KW -ERROR@2873: expected command, found AS_KW -ERROR@2876: expected command, found STRING -ERROR@2926: expected command, found LANGUAGE_KW -ERROR@2935: expected command, found SQL_KW diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_namespace.snap b/crates/squawk_parser/tests/snapshots/tests__regression_namespace.snap index 92e8c6b2..78aaca46 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_namespace.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_namespace.snap @@ -6,6 +6,3 @@ ERROR@253: expected SEMICOLON ERROR@301: expected SEMICOLON ERROR@382: expected SEMICOLON ERROR@1810: expected SEMICOLON -ERROR@2810: expected SEMICOLON -ERROR@2810: expected command, found DOT -ERROR@2811: expected command, found IDENT diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_object_address.snap b/crates/squawk_parser/tests/snapshots/tests__regression_object_address.snap deleted file mode 100644 index 223c22d1..00000000 --- a/crates/squawk_parser/tests/snapshots/tests__regression_object_address.snap +++ /dev/null @@ -1,18 +0,0 @@ ---- -source: crates/squawk_parser/tests/tests.rs -input_file: crates/squawk_parser/tests/data/regression_suite/object_address.sql ---- -ERROR@1365: expected type name -ERROR@1365: expected SEMICOLON -ERROR@1365: expected command, found DOT -ERROR@1366: expected command, found IDENT -ERROR@1376: expected command, found AS_KW -ERROR@1379: expected command, found IDENT -ERROR@1384: expected command, found CONSTRAINT_KW -ERROR@1395: expected command, found IDENT -ERROR@1405: expected command, found CHECK_KW -ERROR@1411: expected command, found L_PAREN -ERROR@1412: expected command, found VALUE_KW -ERROR@1418: expected command, found R_ANGLE -ERROR@1420: expected command, found INT_NUMBER -ERROR@1421: expected command, found R_PAREN diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_oidjoins.snap b/crates/squawk_parser/tests/snapshots/tests__regression_oidjoins.snap deleted file mode 100644 index 530efb26..00000000 --- a/crates/squawk_parser/tests/snapshots/tests__regression_oidjoins.snap +++ /dev/null @@ -1,7 +0,0 @@ ---- -source: crates/squawk_parser/tests/tests.rs -input_file: crates/squawk_parser/tests/data/regression_suite/oidjoins.sql ---- -ERROR@1549: expected SEMICOLON -ERROR@1549: expected command, found IDENT -ERROR@60: Unterminated dollar quoted string literal diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_partition_join.snap b/crates/squawk_parser/tests/snapshots/tests__regression_partition_join.snap deleted file mode 100644 index afd8b530..00000000 --- a/crates/squawk_parser/tests/snapshots/tests__regression_partition_join.snap +++ /dev/null @@ -1,6 +0,0 @@ ---- -source: crates/squawk_parser/tests/tests.rs -input_file: crates/squawk_parser/tests/data/regression_suite/partition_join.sql ---- -ERROR@66717: expected select stmt -ERROR@66717: expected SEMICOLON diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_plpgsql.snap b/crates/squawk_parser/tests/snapshots/tests__regression_plpgsql.snap index dd98d4c3..bf38e5e6 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_plpgsql.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_plpgsql.snap @@ -113,460 +113,13 @@ ERROR@75758: expected command, found IDENT ERROR@75785: expected SEMICOLON ERROR@75785: expected command, found DOT ERROR@75786: expected command, found IDENT -ERROR@101411: expected SEMICOLON -ERROR@101411: expected command, found POSITIONAL_PARAM -ERROR@101428: expected CURSOR_KW -ERROR@101428: expected FOR_KW -ERROR@101428: expected select stmt -ERROR@101428: expected SEMICOLON -ERROR@101429: expected command, found INT_KW -ERROR@101433: expected command, found EQ -ERROR@101435: expected command, found INT_NUMBER -ERROR@101449: expected SEMICOLON -ERROR@101458: expected command, found IDENT -ERROR@101460: expected command, found COLON -ERROR@101461: expected command, found EQ -ERROR@101463: expected command, found INT_NUMBER -ERROR@101465: expected command, found SLASH -ERROR@101467: expected command, found IDENT -ERROR@101487: expected command, found DOLLAR_QUOTED_STRING -ERROR@101765: expected CURSOR_KW -ERROR@101765: expected FOR_KW -ERROR@101765: expected select stmt -ERROR@101765: expected SEMICOLON -ERROR@101766: expected command, found INT_KW -ERROR@101770: expected command, found COLON -ERROR@101771: expected command, found EQ -ERROR@101773: expected command, found IDENT -ERROR@101775: expected command, found PLUS -ERROR@101777: expected command, found INT_NUMBER -ERROR@101795: expected SEMICOLON -ERROR@101798: expected command, found IDENT -ERROR@101804: expected command, found IDENT -ERROR@101811: expected command, found STRING -ERROR@101818: expected command, found COMMA -ERROR@101820: expected command, found IDENT -ERROR@101828: expected command, found DOLLAR_QUOTED_STRING -ERROR@101848: expected CURSOR_KW -ERROR@101848: expected FOR_KW -ERROR@101848: expected select stmt -ERROR@101848: expected SEMICOLON -ERROR@101849: expected command, found INT_KW -ERROR@101853: expected command, found COLON -ERROR@101854: expected command, found EQ -ERROR@101856: expected command, found IDENT -ERROR@101858: expected command, found PLUS -ERROR@101860: expected command, found INT_NUMBER -ERROR@101881: expected command, found IDENT -ERROR@101883: expected command, found INT_KW -ERROR@101887: expected command, found COLON -ERROR@101888: expected command, found EQ -ERROR@101890: expected command, found INT_NUMBER -ERROR@101899: expected SEMICOLON -ERROR@101902: expected command, found IDENT -ERROR@101908: expected command, found IDENT -ERROR@101915: expected command, found STRING -ERROR@101929: expected command, found COMMA -ERROR@101931: expected command, found IDENT -ERROR@101932: expected command, found COMMA -ERROR@101934: expected command, found IDENT -ERROR@101942: expected command, found DOLLAR_QUOTED_STRING -ERROR@101962: expected CURSOR_KW -ERROR@101962: expected FOR_KW -ERROR@101962: expected select stmt -ERROR@101962: expected SEMICOLON -ERROR@101963: expected command, found INT_KW -ERROR@101967: expected command, found COLON -ERROR@101968: expected command, found EQ -ERROR@101970: expected command, found INT_NUMBER -ERROR@101982: expected command, found IDENT -ERROR@101984: expected command, found INT_KW -ERROR@101988: expected command, found COLON -ERROR@101989: expected command, found EQ -ERROR@101991: expected command, found IDENT -ERROR@101993: expected command, found PLUS -ERROR@101995: expected command, found INT_NUMBER -ERROR@102003: expected SEMICOLON -ERROR@102006: expected command, found IDENT -ERROR@102012: expected command, found IDENT -ERROR@102019: expected command, found STRING -ERROR@102033: expected command, found COMMA -ERROR@102035: expected command, found IDENT -ERROR@102036: expected command, found COMMA -ERROR@102038: expected command, found IDENT -ERROR@102046: expected command, found DOLLAR_QUOTED_STRING -ERROR@102066: expected CURSOR_KW -ERROR@102066: expected FOR_KW -ERROR@102066: expected select stmt -ERROR@102066: expected SEMICOLON -ERROR@102067: expected command, found INT_KW -ERROR@102071: expected command, found COLON -ERROR@102072: expected command, found EQ -ERROR@102074: expected command, found INT_NUMBER -ERROR@102083: expected SEMICOLON -ERROR@102095: expected CURSOR_KW -ERROR@102095: expected FOR_KW -ERROR@102095: expected select stmt -ERROR@102095: expected SEMICOLON -ERROR@102096: expected command, found INT_KW -ERROR@102100: expected command, found COLON -ERROR@102101: expected command, found EQ -ERROR@102103: expected command, found IDENT -ERROR@102105: expected command, found PLUS -ERROR@102107: expected command, found INT_NUMBER -ERROR@102120: expected command, found IDENT -ERROR@102122: expected command, found INT_KW -ERROR@102126: expected command, found COLON -ERROR@102127: expected command, found EQ -ERROR@102129: expected command, found IDENT -ERROR@102131: expected command, found PLUS -ERROR@102133: expected command, found INT_NUMBER -ERROR@102146: expected command, found IDENT -ERROR@102148: expected command, found INT_KW -ERROR@102152: expected command, found COLON -ERROR@102153: expected command, found EQ -ERROR@102155: expected command, found IDENT -ERROR@102157: expected command, found STAR -ERROR@102159: expected command, found INT_NUMBER -ERROR@102170: expected SEMICOLON -ERROR@102175: expected command, found IDENT -ERROR@102181: expected command, found IDENT -ERROR@102188: expected command, found STRING -ERROR@102209: expected command, found COMMA -ERROR@102211: expected command, found IDENT -ERROR@102212: expected command, found COMMA -ERROR@102214: expected command, found IDENT -ERROR@102215: expected command, found COMMA -ERROR@102217: expected command, found IDENT -ERROR@102232: expected command, found DOLLAR_QUOTED_STRING -ERROR@102419: expected CURSOR_KW -ERROR@102419: expected FOR_KW -ERROR@102419: expected select stmt -ERROR@102419: expected SEMICOLON -ERROR@102420: expected command, found IDENT -ERROR@102430: expected command, found IDENT -ERROR@102433: expected command, found BIGINT_KW -ERROR@102440: expected command, found COLON -ERROR@102441: expected command, found EQ -ERROR@102443: expected command, found INT_NUMBER -ERROR@102452: expected SEMICOLON -ERROR@102455: expected command, found FOR_KW -ERROR@102459: expected command, found IDENT -ERROR@102461: expected command, found IN_KW -ERROR@102495: expected SEMICOLON -ERROR@102500: expected command, found RETURN_KW -ERROR@102507: expected command, found NEXT_KW -ERROR@102512: expected command, found IDENT -ERROR@102520: expected SEMICOLON -ERROR@102521: expected command, found IDENT -ERROR@102532: expected command, found DOLLAR_QUOTED_STRING -ERROR@102658: expected command, found POUND -ERROR@102659: expected command, found IDENT -ERROR@102677: expected command, found IDENT -ERROR@102699: expected CURSOR_KW -ERROR@102699: expected FOR_KW -ERROR@102699: expected select stmt -ERROR@102699: expected SEMICOLON -ERROR@102700: expected command, found IDENT -ERROR@102710: expected command, found IDENT -ERROR@102713: expected command, found BIGINT_KW -ERROR@102720: expected command, found COLON -ERROR@102721: expected command, found EQ -ERROR@102723: expected command, found INT_NUMBER -ERROR@102732: expected SEMICOLON -ERROR@102735: expected command, found FOR_KW -ERROR@102739: expected command, found IDENT -ERROR@102741: expected command, found IN_KW -ERROR@102775: expected SEMICOLON -ERROR@102780: expected command, found RETURN_KW -ERROR@102787: expected command, found NEXT_KW -ERROR@102792: expected command, found IDENT -ERROR@102800: expected SEMICOLON -ERROR@102801: expected command, found IDENT -ERROR@102812: expected command, found DOLLAR_QUOTED_STRING -ERROR@102938: expected command, found POUND -ERROR@102939: expected command, found IDENT -ERROR@102957: expected command, found IDENT -ERROR@102977: expected CURSOR_KW -ERROR@102977: expected FOR_KW -ERROR@102977: expected select stmt -ERROR@102977: expected SEMICOLON -ERROR@102978: expected command, found IDENT -ERROR@102988: expected command, found IDENT -ERROR@102991: expected command, found BIGINT_KW -ERROR@102998: expected command, found COLON -ERROR@102999: expected command, found EQ -ERROR@103001: expected command, found INT_NUMBER -ERROR@103010: expected SEMICOLON -ERROR@103013: expected command, found FOR_KW -ERROR@103017: expected command, found IDENT -ERROR@103019: expected command, found IN_KW -ERROR@103053: expected SEMICOLON -ERROR@103058: expected command, found RETURN_KW -ERROR@103065: expected command, found NEXT_KW -ERROR@103070: expected command, found IDENT -ERROR@103078: expected SEMICOLON -ERROR@103079: expected command, found IDENT -ERROR@103090: expected command, found DOLLAR_QUOTED_STRING -ERROR@103313: expected CURSOR_KW -ERROR@103313: expected FOR_KW -ERROR@103313: expected select stmt -ERROR@103313: expected SEMICOLON -ERROR@103314: expected command, found INT_KW -ERROR@103318: expected command, found COLON -ERROR@103319: expected command, found EQ -ERROR@103321: expected command, found INT_NUMBER -ERROR@103330: expected SEMICOLON -ERROR@103333: expected command, found FORWARD_KW -ERROR@103341: expected command, found COLON -ERROR@103342: expected command, found EQ -ERROR@103344: expected command, found FORWARD_KW -ERROR@103352: expected command, found STAR -ERROR@103354: expected command, found INT_NUMBER -ERROR@103359: expected command, found RETURN_KW -ERROR@103366: expected command, found FORWARD_KW -ERROR@103378: expected SEMICOLON -ERROR@103379: expected command, found DOLLAR_QUOTED_STRING -ERROR@103507: expected CURSOR_KW -ERROR@103507: expected FOR_KW -ERROR@103507: expected select stmt -ERROR@103507: expected SEMICOLON -ERROR@103508: expected command, found INT_KW -ERROR@103512: expected command, found COLON -ERROR@103513: expected command, found EQ -ERROR@103515: expected command, found INT_NUMBER -ERROR@103524: expected SEMICOLON -ERROR@103527: expected command, found RETURN_KW -ERROR@103534: expected command, found COLON -ERROR@103535: expected command, found EQ -ERROR@103537: expected command, found RETURN_KW -ERROR@103544: expected command, found PLUS -ERROR@103546: expected command, found INT_NUMBER -ERROR@103551: expected command, found RETURN_KW -ERROR@103558: expected command, found RETURN_KW -ERROR@103569: expected SEMICOLON -ERROR@103570: expected command, found DOLLAR_QUOTED_STRING -ERROR@103699: expected CURSOR_KW -ERROR@103699: expected FOR_KW -ERROR@103699: expected select stmt -ERROR@103699: expected SEMICOLON -ERROR@103700: expected command, found INT_KW -ERROR@103704: expected command, found COLON -ERROR@103705: expected command, found EQ -ERROR@103707: expected command, found INT_NUMBER -ERROR@103716: expected SEMICOLON -ERROR@103726: expected ON_KW -ERROR@103727: unexpected token -ERROR@103728: expected IS_KW -ERROR@103728: expected string literal or NULL -ERROR@103728: expected SEMICOLON -ERROR@103728: expected command, found EQ -ERROR@103737: expected ON_KW -ERROR@103738: unexpected token -ERROR@103739: expected IS_KW -ERROR@103739: expected string literal or NULL -ERROR@103739: expected SEMICOLON -ERROR@103740: expected command, found INT_NUMBER -ERROR@103806: expected command, found RETURN_KW -ERROR@103820: expected ON_KW -ERROR@103820: unexpected token -ERROR@103821: expected IS_KW -ERROR@103821: expected string literal or NULL -ERROR@103821: expected SEMICOLON -ERROR@103825: expected SEMICOLON -ERROR@103826: expected command, found DOLLAR_QUOTED_STRING -ERROR@104082: expected CURSOR_KW -ERROR@104082: expected FOR_KW -ERROR@104082: expected select stmt -ERROR@104082: expected SEMICOLON -ERROR@104083: expected command, found INT_KW -ERROR@104093: expected SEMICOLON -ERROR@104096: expected command, found IDENT -ERROR@104104: expected command, found IDENT -ERROR@104106: expected command, found IN_KW -ERROR@104109: expected command, found ARRAY_KW -ERROR@104115: expected command, found POSITIONAL_PARAM -ERROR@104120: expected command, found IDENT -ERROR@104129: expected command, found IDENT -ERROR@104135: expected command, found IDENT -ERROR@104142: expected command, found STRING -ERROR@104145: expected command, found COMMA -ERROR@104147: expected command, found IDENT -ERROR@104155: expected SEMICOLON -ERROR@104156: expected command, found IDENT -ERROR@104169: expected command, found DOLLAR_QUOTED_STRING -ERROR@104348: expected CURSOR_KW -ERROR@104348: expected FOR_KW -ERROR@104348: expected select stmt -ERROR@104348: expected SEMICOLON -ERROR@104349: expected command, found INT_KW -ERROR@104359: expected SEMICOLON -ERROR@104362: expected command, found IDENT -ERROR@104370: expected command, found IDENT -ERROR@104372: expected command, found IDENT -ERROR@104378: expected command, found INT_NUMBER -ERROR@104380: expected command, found IN_KW -ERROR@104383: expected command, found ARRAY_KW -ERROR@104389: expected command, found POSITIONAL_PARAM -ERROR@104394: expected command, found IDENT -ERROR@104403: expected command, found IDENT -ERROR@104409: expected command, found IDENT -ERROR@104416: expected command, found STRING -ERROR@104419: expected command, found COMMA -ERROR@104421: expected command, found IDENT -ERROR@104429: expected SEMICOLON -ERROR@104430: expected command, found IDENT -ERROR@104443: expected command, found DOLLAR_QUOTED_STRING -ERROR@104637: expected CURSOR_KW -ERROR@104637: expected FOR_KW -ERROR@104637: expected select stmt -ERROR@104637: expected SEMICOLON -ERROR@104638: expected command, found INT_KW -ERROR@104641: expected command, found L_BRACK -ERROR@104642: expected command, found R_BRACK -ERROR@104650: expected SEMICOLON -ERROR@104653: expected command, found IDENT -ERROR@104661: expected command, found IDENT -ERROR@104663: expected command, found IDENT -ERROR@104669: expected command, found INT_NUMBER -ERROR@104671: expected command, found IN_KW -ERROR@104674: expected command, found ARRAY_KW -ERROR@104680: expected command, found POSITIONAL_PARAM -ERROR@104685: expected command, found IDENT -ERROR@104694: expected command, found IDENT -ERROR@104700: expected command, found IDENT -ERROR@104707: expected command, found STRING -ERROR@104710: expected command, found COMMA -ERROR@104712: expected command, found IDENT -ERROR@104720: expected SEMICOLON -ERROR@104721: expected command, found IDENT -ERROR@104734: expected command, found DOLLAR_QUOTED_STRING -ERROR@104940: expected CURSOR_KW -ERROR@104940: expected FOR_KW -ERROR@104940: expected select stmt -ERROR@104940: expected SEMICOLON -ERROR@104941: expected command, found INT_KW -ERROR@104944: expected command, found L_BRACK -ERROR@104945: expected command, found R_BRACK -ERROR@104953: expected SEMICOLON -ERROR@104956: expected command, found IDENT -ERROR@104964: expected command, found IDENT -ERROR@104966: expected command, found IDENT -ERROR@104972: expected command, found INT_NUMBER -ERROR@104974: expected command, found IN_KW -ERROR@104977: expected command, found ARRAY_KW -ERROR@104983: expected command, found POSITIONAL_PARAM -ERROR@104988: expected command, found IDENT -ERROR@104997: expected command, found IDENT -ERROR@105003: expected command, found IDENT -ERROR@105010: expected command, found STRING -ERROR@105013: expected command, found COMMA -ERROR@105015: expected command, found IDENT -ERROR@105023: expected SEMICOLON -ERROR@105024: expected command, found IDENT -ERROR@105037: expected command, found DOLLAR_QUOTED_STRING -ERROR@105358: expected CURSOR_KW -ERROR@105358: expected FOR_KW -ERROR@105358: expected select stmt -ERROR@105358: expected SEMICOLON -ERROR@105359: expected command, found IDENT -ERROR@105372: expected SEMICOLON -ERROR@105375: expected command, found IDENT -ERROR@105383: expected command, found IDENT -ERROR@105385: expected command, found IN_KW -ERROR@105388: expected command, found ARRAY_KW -ERROR@105394: expected command, found POSITIONAL_PARAM -ERROR@105399: expected command, found IDENT -ERROR@105408: expected command, found IDENT -ERROR@105414: expected command, found IDENT -ERROR@105421: expected command, found STRING -ERROR@105424: expected command, found COMMA -ERROR@105426: expected command, found IDENT -ERROR@105434: expected SEMICOLON -ERROR@105435: expected command, found IDENT -ERROR@105448: expected command, found DOLLAR_QUOTED_STRING -ERROR@105691: expected CURSOR_KW -ERROR@105691: expected FOR_KW -ERROR@105691: expected select stmt -ERROR@105691: expected SEMICOLON -ERROR@105692: expected command, found INT_KW -ERROR@105697: expected command, found IDENT -ERROR@105699: expected command, found INT_KW -ERROR@105709: expected SEMICOLON -ERROR@105712: expected command, found IDENT -ERROR@105720: expected command, found IDENT -ERROR@105721: expected command, found COMMA -ERROR@105723: expected command, found IDENT -ERROR@105725: expected command, found IN_KW -ERROR@105728: expected command, found ARRAY_KW -ERROR@105734: expected command, found POSITIONAL_PARAM -ERROR@105739: expected command, found IDENT -ERROR@105748: expected command, found IDENT -ERROR@105754: expected command, found IDENT -ERROR@105761: expected command, found STRING -ERROR@105775: expected command, found COMMA -ERROR@105777: expected command, found IDENT -ERROR@105778: expected command, found COMMA -ERROR@105780: expected command, found IDENT -ERROR@105788: expected SEMICOLON -ERROR@105789: expected command, found IDENT -ERROR@105802: expected command, found DOLLAR_QUOTED_STRING -ERROR@106086: expected CURSOR_KW -ERROR@106086: expected FOR_KW -ERROR@106086: expected select stmt -ERROR@106086: expected SEMICOLON -ERROR@106087: expected command, found IDENT -ERROR@106095: expected command, found L_BRACK -ERROR@106096: expected command, found R_BRACK -ERROR@106104: expected SEMICOLON -ERROR@106107: expected command, found IDENT -ERROR@106115: expected command, found IDENT -ERROR@106117: expected command, found IDENT -ERROR@106123: expected command, found INT_NUMBER -ERROR@106125: expected command, found IN_KW -ERROR@106128: expected command, found ARRAY_KW -ERROR@106134: expected command, found POSITIONAL_PARAM -ERROR@106139: expected command, found IDENT -ERROR@106148: expected command, found IDENT -ERROR@106154: expected command, found IDENT -ERROR@106161: expected command, found STRING -ERROR@106164: expected command, found COMMA -ERROR@106166: expected command, found IDENT -ERROR@106174: expected SEMICOLON -ERROR@106175: expected command, found IDENT -ERROR@106188: expected command, found DOLLAR_QUOTED_STRING -ERROR@106593: expected CURSOR_KW -ERROR@106593: expected FOR_KW -ERROR@106593: expected select stmt -ERROR@106593: expected SEMICOLON -ERROR@106594: expected command, found IDENT -ERROR@106607: expected SEMICOLON -ERROR@106610: expected command, found IDENT -ERROR@106612: expected command, found COLON -ERROR@106613: expected command, found EQ -ERROR@106615: expected command, found ROW_KW -ERROR@106618: expected command, found L_PAREN -ERROR@106619: expected command, found INT_NUMBER -ERROR@106621: expected command, found COMMA -ERROR@106623: expected command, found STRING -ERROR@106638: expected command, found R_PAREN -ERROR@106639: expected command, found COLON -ERROR@106640: expected command, found COLON -ERROR@106641: expected command, found IDENT -ERROR@106650: expected command, found IDENT -ERROR@106651: expected command, found DOT -ERROR@106652: expected command, found IDENT -ERROR@106654: expected command, found L_BRACK -ERROR@106655: expected command, found INT_NUMBER -ERROR@106656: expected command, found R_BRACK -ERROR@106658: expected command, found COLON -ERROR@106659: expected command, found EQ -ERROR@106661: expected command, found STRING -ERROR@106674: expected command, found RETURN_KW -ERROR@106681: expected command, found IDENT -ERROR@106682: expected command, found DOT -ERROR@106683: expected command, found IDENT -ERROR@106687: expected command, found IDENT +ERROR@102320: expected EQ +ERROR@102320: expected config value, got DOT +ERROR@102320: expected SEMICOLON +ERROR@102320: expected command, found DOT +ERROR@102321: expected command, found IDENT +ERROR@102339: expected command, found EQ +ERROR@102341: expected command, found ERROR_KW ERROR@111464: expected EQ ERROR@111464: expected config value, got DOT ERROR@111464: expected SEMICOLON @@ -577,18 +130,3 @@ ERROR@111481: expected command, found OFF_KW ERROR@111554: expected SEMICOLON ERROR@111554: expected command, found DOT ERROR@111555: expected command, found IDENT -ERROR@122193: expected R_PAREN -ERROR@122193: expected function option -ERROR@122193: expected SEMICOLON -ERROR@122193: expected command, found DOT -ERROR@122194: expected command, found IDENT -ERROR@122195: expected command, found PERCENT -ERROR@122196: expected command, found TYPE_KW -ERROR@122200: expected command, found R_PAREN -ERROR@122202: expected command, found RETURNS_KW -ERROR@122210: expected command, found IDENT -ERROR@122228: expected command, found AS_KW -ERROR@122231: expected command, found DOLLAR_QUOTED_STRING -ERROR@122431: expected command, found LANGUAGE_KW -ERROR@122440: expected command, found IDENT -ERROR@101339: Unterminated dollar quoted string literal diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_privileges.snap b/crates/squawk_parser/tests/snapshots/tests__regression_privileges.snap index f1f0ee51..18eee777 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_privileges.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_privileges.snap @@ -86,15 +86,3 @@ ERROR@62652: expected SEMICOLON ERROR@62653: expected command, found OBJECTS_KW ERROR@62661: expected command, found TO_KW ERROR@62664: expected command, found IDENT -ERROR@64849: expected type name -ERROR@64849: expected SEMICOLON -ERROR@64849: expected command, found DOT -ERROR@64850: expected command, found IDENT -ERROR@64867: expected command, found AS_KW -ERROR@64870: expected command, found INT_KW -ERROR@65100: expected type name -ERROR@65100: expected SEMICOLON -ERROR@65100: expected command, found DOT -ERROR@65101: expected command, found IDENT -ERROR@65118: expected command, found AS_KW -ERROR@65121: expected command, found INT_KW diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_rowsecurity.snap b/crates/squawk_parser/tests/snapshots/tests__regression_rowsecurity.snap index f5b087b1..6828f582 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_rowsecurity.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_rowsecurity.snap @@ -74,9 +74,6 @@ ERROR@58007: expected L_PAREN ERROR@58021: expected R_PAREN ERROR@58105: expected L_PAREN ERROR@58119: expected R_PAREN -ERROR@62112: expected type name -ERROR@62639: expected type name -ERROR@63728: expected type name ERROR@79066: expected SEMICOLON ERROR@79066: expected command, found DOT ERROR@79067: expected command, found IDENT diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_select_into.snap b/crates/squawk_parser/tests/snapshots/tests__regression_select_into.snap deleted file mode 100644 index b6d4dfd2..00000000 --- a/crates/squawk_parser/tests/snapshots/tests__regression_select_into.snap +++ /dev/null @@ -1,24 +0,0 @@ ---- -source: crates/squawk_parser/tests/tests.rs -input_file: crates/squawk_parser/tests/data/regression_suite/select_into.sql ---- -ERROR@619: expected type name -ERROR@831: expected type name -ERROR@944: expected type name -ERROR@1104: expected type name -ERROR@1280: expected type name -ERROR@1428: expected type name -ERROR@1542: expected type name -ERROR@1691: expected type name -ERROR@2192: expected type name -ERROR@2196: expected type name -ERROR@2200: expected type name -ERROR@2270: expected type name -ERROR@2274: expected type name -ERROR@2278: expected type name -ERROR@2361: expected type name -ERROR@2365: expected type name -ERROR@2434: expected type name -ERROR@2438: expected type name -ERROR@2520: expected type name -ERROR@2589: expected type name diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_sqljson_jsontable.snap b/crates/squawk_parser/tests/snapshots/tests__regression_sqljson_jsontable.snap index 31304821..e0ec3058 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_sqljson_jsontable.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_sqljson_jsontable.snap @@ -17,7 +17,6 @@ ERROR@320: expected command, found ERROR_KW ERROR@325: expected command, found R_PAREN ERROR@702: expected name ERROR@702: expected type name -ERROR@1514: expected type name ERROR@1518: expected SELECT, TABLE, VALUES, or EXECUTE ERROR@1518: expected SEMICOLON ERROR@1520: expected command, found L_PAREN diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_sqljson_queryfuncs.snap b/crates/squawk_parser/tests/snapshots/tests__regression_sqljson_queryfuncs.snap index 4da9db0e..dea587ca 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_sqljson_queryfuncs.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_sqljson_queryfuncs.snap @@ -50,7 +50,6 @@ ERROR@22800: expected ERROR_KW ERROR@23992: expected json behavior ERROR@23992: expected ON_KW ERROR@23992: expected ERROR_KW -ERROR@24433: expected type name ERROR@26935: expected json behavior ERROR@26935: expected ON_KW ERROR@26935: expected ERROR_KW diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_stats.snap b/crates/squawk_parser/tests/snapshots/tests__regression_stats.snap index 34e03b58..e08c2b35 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_stats.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_stats.snap @@ -2,37 +2,10 @@ source: crates/squawk_parser/tests/tests.rs input_file: crates/squawk_parser/tests/data/regression_suite/stats.sql --- -ERROR@14434: expected path name -ERROR@14434: expected IS_KW -ERROR@14434: expected string literal or NULL -ERROR@14434: expected SEMICOLON -ERROR@14435: expected command, found COLON -ERROR@14436: expected command, found IDENT -ERROR@14446: expected command, found IS_KW -ERROR@14449: expected command, found STRING -ERROR@14904: expected path name -ERROR@14904: expected IS_KW -ERROR@14904: expected string literal or NULL -ERROR@14904: expected SEMICOLON -ERROR@14905: expected command, found COLON -ERROR@14906: expected command, found IDENT -ERROR@14916: expected command, found IS_KW -ERROR@14919: expected command, found STRING -ERROR@14962: expected path name -ERROR@14962: expected IS_KW -ERROR@14962: expected string literal or NULL -ERROR@14962: expected SEMICOLON -ERROR@14963: expected command, found COLON -ERROR@14964: expected command, found IDENT -ERROR@14974: expected command, found IS_KW -ERROR@14977: expected command, found NULL_KW -ERROR@24357: expected command, found IDENT -ERROR@24509: expected command, found IDENT -ERROR@24652: expected command, found IDENT -ERROR@25572: expected command, found IDENT -ERROR@25899: expected command, found IDENT -ERROR@26231: expected command, found IDENT -ERROR@29127: expected command, found IDENT -ERROR@30023: expected command, found IDENT -ERROR@31772: expected command, found IDENT -ERROR@32434: expected command, found IDENT +ERROR@25578: expected command, found IDENT +ERROR@25905: expected command, found IDENT +ERROR@26237: expected command, found IDENT +ERROR@29133: expected command, found IDENT +ERROR@30029: expected command, found IDENT +ERROR@31778: expected command, found IDENT +ERROR@32440: expected command, found IDENT diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_suite_errors.snap b/crates/squawk_parser/tests/snapshots/tests__regression_suite_errors.snap index 29bc02a6..97e351b6 100644 --- a/crates/squawk_parser/tests/snapshots/tests__regression_suite_errors.snap +++ b/crates/squawk_parser/tests/snapshots/tests__regression_suite_errors.snap @@ -2,65 +2,52 @@ source: crates/squawk_parser/tests/tests.rs expression: "out.join(\"\\n\")" --- -tests/snapshots/tests__regression_alter_table.snap:136 -tests/snapshots/tests__regression_btree_index.snap:30 -tests/snapshots/tests__regression_collate.icu.utf8.snap:16 -tests/snapshots/tests__regression_collate.linux.utf8.snap:15 -tests/snapshots/tests__regression_constraints.snap:538 tests/snapshots/tests__regression_copy.snap:231 tests/snapshots/tests__regression_copy2.snap:58 tests/snapshots/tests__regression_copydml.snap:154 tests/snapshots/tests__regression_copyselect.snap:27 tests/snapshots/tests__regression_create_am.snap:14 -tests/snapshots/tests__regression_create_index.snap:22 +tests/snapshots/tests__regression_create_index.snap:10 tests/snapshots/tests__regression_create_operator.snap:17 tests/snapshots/tests__regression_create_table.snap:31 -tests/snapshots/tests__regression_create_table_like.snap:45 +tests/snapshots/tests__regression_create_table_like.snap:20 tests/snapshots/tests__regression_create_view.snap:265 -tests/snapshots/tests__regression_domain.snap:48 -tests/snapshots/tests__regression_drop_if_exists.snap:22 +tests/snapshots/tests__regression_domain.snap:35 +tests/snapshots/tests__regression_drop_if_exists.snap:12 tests/snapshots/tests__regression_errors.snap:286 tests/snapshots/tests__regression_foreign_data.snap:57 -tests/snapshots/tests__regression_foreign_key.snap:92 -tests/snapshots/tests__regression_generated_virtual.snap:19 +tests/snapshots/tests__regression_foreign_key.snap:24 tests/snapshots/tests__regression_groupingsets.snap:97 tests/snapshots/tests__regression_guc.snap:81 tests/snapshots/tests__regression_horology.snap:173 -tests/snapshots/tests__regression_inherit.snap:304 +tests/snapshots/tests__regression_inherit.snap:30 tests/snapshots/tests__regression_insert.snap:19 tests/snapshots/tests__regression_insert_conflict.snap:253 tests/snapshots/tests__regression_join.snap:20 tests/snapshots/tests__regression_largeobject.snap:12 -tests/snapshots/tests__regression_matview.snap:5 tests/snapshots/tests__regression_merge.snap:384 -tests/snapshots/tests__regression_misc.snap:26 +tests/snapshots/tests__regression_misc.snap:8 tests/snapshots/tests__regression_misc_functions.snap:9 -tests/snapshots/tests__regression_namespace.snap:7 +tests/snapshots/tests__regression_namespace.snap:4 tests/snapshots/tests__regression_numerology.snap:6 -tests/snapshots/tests__regression_object_address.snap:14 -tests/snapshots/tests__regression_oidjoins.snap:3 -tests/snapshots/tests__regression_partition_join.snap:2 tests/snapshots/tests__regression_partition_prune.snap:330 -tests/snapshots/tests__regression_plpgsql.snap:590 -tests/snapshots/tests__regression_privileges.snap:96 +tests/snapshots/tests__regression_plpgsql.snap:128 +tests/snapshots/tests__regression_privileges.snap:84 tests/snapshots/tests__regression_publication.snap:71 tests/snapshots/tests__regression_rangefuncs.snap:290 tests/snapshots/tests__regression_returning.snap:230 -tests/snapshots/tests__regression_rowsecurity.snap:78 +tests/snapshots/tests__regression_rowsecurity.snap:75 tests/snapshots/tests__regression_rules.snap:59 -tests/snapshots/tests__regression_select_into.snap:20 tests/snapshots/tests__regression_select_parallel.snap:3 tests/snapshots/tests__regression_sqljson.snap:1075 -tests/snapshots/tests__regression_sqljson_jsontable.snap:186 -tests/snapshots/tests__regression_sqljson_queryfuncs.snap:52 -tests/snapshots/tests__regression_stats.snap:34 +tests/snapshots/tests__regression_sqljson_jsontable.snap:185 +tests/snapshots/tests__regression_sqljson_queryfuncs.snap:51 +tests/snapshots/tests__regression_stats.snap:7 tests/snapshots/tests__regression_stats_ext.snap:9 tests/snapshots/tests__regression_strings.snap:533 tests/snapshots/tests__regression_subscription.snap:4 tests/snapshots/tests__regression_subselect.snap:52 tests/snapshots/tests__regression_tablesample.snap:6 -tests/snapshots/tests__regression_tablespace.snap:12 -tests/snapshots/tests__regression_temp.snap:16 tests/snapshots/tests__regression_timestamp.snap:65 tests/snapshots/tests__regression_timestamptz.snap:13 tests/snapshots/tests__regression_transactions.snap:114 diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_tablespace.snap b/crates/squawk_parser/tests/snapshots/tests__regression_tablespace.snap deleted file mode 100644 index fcf6bd46..00000000 --- a/crates/squawk_parser/tests/snapshots/tests__regression_tablespace.snap +++ /dev/null @@ -1,16 +0,0 @@ ---- -source: crates/squawk_parser/tests/tests.rs -input_file: crates/squawk_parser/tests/data/regression_suite/tablespace.sql ---- -ERROR@2073: expected SEMICOLON -ERROR@2073: expected command, found DOT -ERROR@2074: expected command, found IDENT -ERROR@2160: expected SEMICOLON -ERROR@2160: expected command, found DOT -ERROR@2161: expected command, found IDENT -ERROR@2234: expected SEMICOLON -ERROR@2234: expected command, found DOT -ERROR@2235: expected command, found IDENT -ERROR@2315: expected SEMICOLON -ERROR@2315: expected command, found DOT -ERROR@2316: expected command, found IDENT diff --git a/crates/squawk_parser/tests/snapshots/tests__regression_temp.snap b/crates/squawk_parser/tests/snapshots/tests__regression_temp.snap deleted file mode 100644 index 332219c8..00000000 --- a/crates/squawk_parser/tests/snapshots/tests__regression_temp.snap +++ /dev/null @@ -1,20 +0,0 @@ ---- -source: crates/squawk_parser/tests/tests.rs -input_file: crates/squawk_parser/tests/data/regression_suite/temp.sql ---- -ERROR@1146: expected type name -ERROR@1511: expected type name -ERROR@2093: expected type name -ERROR@3533: expected type name -ERROR@3533: expected SEMICOLON -ERROR@3533: expected command, found DOT -ERROR@3534: expected command, found IDENT -ERROR@3543: expected command, found AS_KW -ERROR@3546: expected command, found TEXT_KW -ERROR@3551: expected command, found CHECK_KW -ERROR@3557: expected command, found L_PAREN -ERROR@3558: expected command, found VALUE_KW -ERROR@3564: expected command, found L_ANGLE -ERROR@3565: expected command, found R_ANGLE -ERROR@3567: expected command, found STRING -ERROR@3569: expected command, found R_PAREN diff --git a/crates/squawk_parser/tests/snapshots/tests__reindex_ok.snap b/crates/squawk_parser/tests/snapshots/tests__reindex_ok.snap index fd41f26d..c024ade7 100644 --- a/crates/squawk_parser/tests/snapshots/tests__reindex_ok.snap +++ b/crates/squawk_parser/tests/snapshots/tests__reindex_ok.snap @@ -10,8 +10,10 @@ SOURCE_FILE WHITESPACE " " INDEX_KW "INDEX" WHITESPACE " " - NAME - IDENT "my_index" + PATH + PATH_SEGMENT + NAME + IDENT "my_index" SEMICOLON ";" WHITESPACE "\n\n" REINDEX @@ -19,8 +21,10 @@ SOURCE_FILE WHITESPACE " " TABLE_KW "TABLE" WHITESPACE " " - NAME - IDENT "my_table" + PATH + PATH_SEGMENT + NAME + IDENT "my_table" SEMICOLON ";" WHITESPACE "\n\n" REINDEX @@ -30,8 +34,10 @@ SOURCE_FILE WHITESPACE " " CONCURRENTLY_KW "CONCURRENTLY" WHITESPACE " " - NAME - IDENT "my_broken_table" + PATH + PATH_SEGMENT + NAME + IDENT "my_broken_table" SEMICOLON ";" WHITESPACE "\n\n" COMMENT "-- complete_syntax" @@ -62,8 +68,10 @@ SOURCE_FILE WHITESPACE " " CONCURRENTLY_KW "concurrently" WHITESPACE " " - NAME - IDENT "foo" + PATH + PATH_SEGMENT + NAME + IDENT "foo" SEMICOLON ";" WHITESPACE "\n\n" REINDEX @@ -71,8 +79,10 @@ SOURCE_FILE WHITESPACE " " SYSTEM_KW "system" WHITESPACE " " - NAME - IDENT "foo" + PATH + PATH_SEGMENT + NAME + IDENT "foo" SEMICOLON ";" WHITESPACE "\n\n" REINDEX @@ -80,8 +90,10 @@ SOURCE_FILE WHITESPACE " " INDEX_KW "index" WHITESPACE " " - NAME - IDENT "foo" + PATH + PATH_SEGMENT + NAME + IDENT "foo" SEMICOLON ";" WHITESPACE "\n" REINDEX @@ -89,8 +101,10 @@ SOURCE_FILE WHITESPACE " " TABLE_KW "table" WHITESPACE " " - NAME - IDENT "foo" + PATH + PATH_SEGMENT + NAME + IDENT "foo" SEMICOLON ";" WHITESPACE "\n" REINDEX @@ -98,7 +112,9 @@ SOURCE_FILE WHITESPACE " " SCHEMA_KW "schema" WHITESPACE " " - NAME - IDENT "foo" + PATH + PATH_SEGMENT + NAME + IDENT "foo" SEMICOLON ";" WHITESPACE "\n\n" diff --git a/crates/squawk_parser/tests/snapshots/tests__security_label_ok.snap b/crates/squawk_parser/tests/snapshots/tests__security_label_ok.snap index 54812ab6..277bb2db 100644 --- a/crates/squawk_parser/tests/snapshots/tests__security_label_ok.snap +++ b/crates/squawk_parser/tests/snapshots/tests__security_label_ok.snap @@ -161,7 +161,10 @@ SOURCE_FILE WHITESPACE "\n " PARAM PATH_TYPE - TEXT_KW "text" + PATH + PATH_SEGMENT + NAME_REF + TEXT_KW "text" WHITESPACE "\n" R_PAREN ")" WHITESPACE " " @@ -205,7 +208,10 @@ SOURCE_FILE WHITESPACE "\n " PARAM PATH_TYPE - TEXT_KW "text" + PATH + PATH_SEGMENT + NAME_REF + TEXT_KW "text" COMMA "," WHITESPACE "\n " PARAM @@ -244,7 +250,10 @@ SOURCE_FILE WHITESPACE "\n " PARAM PATH_TYPE - TEXT_KW "text" + PATH + PATH_SEGMENT + NAME_REF + TEXT_KW "text" WHITESPACE "\n" R_PAREN ")" WHITESPACE " " @@ -305,7 +314,10 @@ SOURCE_FILE WHITESPACE "\n " PARAM PATH_TYPE - TEXT_KW "text" + PATH + PATH_SEGMENT + NAME_REF + TEXT_KW "text" WHITESPACE "\n" R_PAREN ")" WHITESPACE " " diff --git a/crates/squawk_parser/tests/tests.rs b/crates/squawk_parser/tests/tests.rs index fe65c7da..dc4ca561 100644 --- a/crates/squawk_parser/tests/tests.rs +++ b/crates/squawk_parser/tests/tests.rs @@ -83,6 +83,9 @@ fn parser_err(fixture: Fixture<&str>) { fn regression_suite(fixture: Fixture<&str>) { let content = fixture.content(); let absolute_fixture_path = Utf8Path::new(fixture.path()); + if absolute_fixture_path.to_string().contains("psql") { + return; + } let input_file = absolute_fixture_path; let test_name = absolute_fixture_path .file_name() @@ -174,7 +177,7 @@ fn parse_text(text: &str) -> (String, Vec) { if !errors.is_empty() { buf.push_str("---\n"); for e in &errors { - buf.push_str(&e); + buf.push_str(e); } } (buf, errors) diff --git a/crates/squawk_syntax/src/ast/generated/nodes.rs b/crates/squawk_syntax/src/ast/generated/nodes.rs index 19db520f..597ec78c 100644 --- a/crates/squawk_syntax/src/ast/generated/nodes.rs +++ b/crates/squawk_syntax/src/ast/generated/nodes.rs @@ -49,6 +49,38 @@ impl AddConstraint { support::child(&self.syntax) } #[inline] + pub fn deferrable_constraint_option(&self) -> Option { + support::child(&self.syntax) + } + #[inline] + pub fn enforced(&self) -> Option { + support::child(&self.syntax) + } + #[inline] + pub fn initially_deferred_constraint_option( + &self, + ) -> Option { + support::child(&self.syntax) + } + #[inline] + pub fn initially_immediate_constraint_option( + &self, + ) -> Option { + support::child(&self.syntax) + } + #[inline] + pub fn no_inherit(&self) -> Option { + support::child(&self.syntax) + } + #[inline] + pub fn not_deferrable_constraint_option(&self) -> Option { + support::child(&self.syntax) + } + #[inline] + pub fn not_enforced(&self) -> Option { + support::child(&self.syntax) + } + #[inline] pub fn not_valid(&self) -> Option { support::child(&self.syntax) } @@ -1413,10 +1445,6 @@ pub struct CheckConstraint { pub(crate) syntax: SyntaxNode, } impl CheckConstraint { - #[inline] - pub fn constraint_option_list(&self) -> Option { - support::child(&self.syntax) - } #[inline] pub fn expr(&self) -> Option { support::child(&self.syntax) @@ -1441,14 +1469,6 @@ impl CheckConstraint { pub fn constraint_token(&self) -> Option { support::token(&self.syntax, SyntaxKind::CONSTRAINT_KW) } - #[inline] - pub fn inherit_token(&self) -> Option { - support::token(&self.syntax, SyntaxKind::INHERIT_KW) - } - #[inline] - pub fn no_token(&self) -> Option { - support::token(&self.syntax, SyntaxKind::NO_KW) - } } #[derive(Debug, Clone, PartialEq, Eq, Hash)] @@ -1707,33 +1727,6 @@ impl ConstraintIndexTablespace { } } -#[derive(Debug, Clone, PartialEq, Eq, Hash)] -pub struct ConstraintOptionList { - pub(crate) syntax: SyntaxNode, -} -impl ConstraintOptionList { - #[inline] - pub fn deferrable_constraint_option(&self) -> Option { - support::child(&self.syntax) - } - #[inline] - pub fn initially_deferred_constraint_option( - &self, - ) -> Option { - support::child(&self.syntax) - } - #[inline] - pub fn initially_immediate_constraint_option( - &self, - ) -> Option { - support::child(&self.syntax) - } - #[inline] - pub fn not_deferrable_constraint_option(&self) -> Option { - support::child(&self.syntax) - } -} - #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct ConstraintStorageParams { pub(crate) syntax: SyntaxNode, @@ -2870,10 +2863,6 @@ pub struct DefaultConstraint { pub(crate) syntax: SyntaxNode, } impl DefaultConstraint { - #[inline] - pub fn constraint_option_list(&self) -> Option { - support::child(&self.syntax) - } #[inline] pub fn expr(&self) -> Option { support::child(&self.syntax) @@ -4373,6 +4362,17 @@ impl EnableTrigger { } } +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub struct Enforced { + pub(crate) syntax: SyntaxNode, +} +impl Enforced { + #[inline] + pub fn enforced_token(&self) -> Option { + support::token(&self.syntax, SyntaxKind::ENFORCED_KW) + } +} + #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct ExcludeConstraint { pub(crate) syntax: SyntaxNode, @@ -4594,10 +4594,6 @@ pub struct GeneratedConstraint { pub(crate) syntax: SyntaxNode, } impl GeneratedConstraint { - #[inline] - pub fn constraint_option_list(&self) -> Option { - support::child(&self.syntax) - } #[inline] pub fn expr(&self) -> Option { support::child(&self.syntax) @@ -5576,6 +5572,21 @@ impl NotDeferrableConstraintOption { } } +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub struct NotEnforced { + pub(crate) syntax: SyntaxNode, +} +impl NotEnforced { + #[inline] + pub fn enforced_token(&self) -> Option { + support::token(&self.syntax, SyntaxKind::ENFORCED_KW) + } + #[inline] + pub fn not_token(&self) -> Option { + support::token(&self.syntax, SyntaxKind::NOT_KW) + } +} + #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct NotIlike { pub(crate) syntax: SyntaxNode, @@ -5626,10 +5637,6 @@ pub struct NotNullConstraint { pub(crate) syntax: SyntaxNode, } impl NotNullConstraint { - #[inline] - pub fn constraint_option_list(&self) -> Option { - support::child(&self.syntax) - } #[inline] pub fn name_ref(&self) -> Option { support::child(&self.syntax) @@ -5694,10 +5701,6 @@ pub struct NullConstraint { pub(crate) syntax: SyntaxNode, } impl NullConstraint { - #[inline] - pub fn constraint_option_list(&self) -> Option { - support::child(&self.syntax) - } #[inline] pub fn name_ref(&self) -> Option { support::child(&self.syntax) @@ -6306,10 +6309,6 @@ impl PrimaryKeyConstraint { support::child(&self.syntax) } #[inline] - pub fn constraint_option_list(&self) -> Option { - support::child(&self.syntax) - } - #[inline] pub fn index_params(&self) -> Option { support::child(&self.syntax) } @@ -6411,10 +6410,6 @@ pub struct ReferencesConstraint { pub(crate) syntax: SyntaxNode, } impl ReferencesConstraint { - #[inline] - pub fn constraint_option_list(&self) -> Option { - support::child(&self.syntax) - } #[inline] pub fn match_type(&self) -> Option { support::child(&self.syntax) @@ -7825,10 +7820,6 @@ impl UniqueConstraint { support::child(&self.syntax) } #[inline] - pub fn constraint_option_list(&self) -> Option { - support::child(&self.syntax) - } - #[inline] pub fn name_ref(&self) -> Option { support::child(&self.syntax) } @@ -10043,24 +10034,6 @@ impl AstNode for ConstraintIndexTablespace { &self.syntax } } -impl AstNode for ConstraintOptionList { - #[inline] - fn can_cast(kind: SyntaxKind) -> bool { - kind == SyntaxKind::CONSTRAINT_OPTION_LIST - } - #[inline] - fn cast(syntax: SyntaxNode) -> Option { - if Self::can_cast(syntax.kind()) { - Some(Self { syntax }) - } else { - None - } - } - #[inline] - fn syntax(&self) -> &SyntaxNode { - &self.syntax - } -} impl AstNode for ConstraintStorageParams { #[inline] fn can_cast(kind: SyntaxKind) -> bool { @@ -12167,6 +12140,24 @@ impl AstNode for EnableTrigger { &self.syntax } } +impl AstNode for Enforced { + #[inline] + fn can_cast(kind: SyntaxKind) -> bool { + kind == SyntaxKind::ENFORCED + } + #[inline] + fn cast(syntax: SyntaxNode) -> Option { + if Self::can_cast(syntax.kind()) { + Some(Self { syntax }) + } else { + None + } + } + #[inline] + fn syntax(&self) -> &SyntaxNode { + &self.syntax + } +} impl AstNode for ExcludeConstraint { #[inline] fn can_cast(kind: SyntaxKind) -> bool { @@ -13391,6 +13382,24 @@ impl AstNode for NotDeferrableConstraintOption { &self.syntax } } +impl AstNode for NotEnforced { + #[inline] + fn can_cast(kind: SyntaxKind) -> bool { + kind == SyntaxKind::NOT_ENFORCED + } + #[inline] + fn cast(syntax: SyntaxNode) -> Option { + if Self::can_cast(syntax.kind()) { + Some(Self { syntax }) + } else { + None + } + } + #[inline] + fn syntax(&self) -> &SyntaxNode { + &self.syntax + } +} impl AstNode for NotIlike { #[inline] fn can_cast(kind: SyntaxKind) -> bool { diff --git a/crates/squawk_syntax/src/postgresql.ungram b/crates/squawk_syntax/src/postgresql.ungram index 367a26d9..58860ba9 100644 --- a/crates/squawk_syntax/src/postgresql.ungram +++ b/crates/squawk_syntax/src/postgresql.ungram @@ -240,8 +240,7 @@ Role = CheckConstraint = ('constraint' NameRef) - 'check' '(' Expr ')' ('no' 'inherit')? - ConstraintOptionList? + 'check' '(' Expr ')' UsingIndex = 'using' 'index' NameRef @@ -257,12 +256,10 @@ UniqueConstraint = UsingIndex | ( 'nulls' 'not'? 'distinct' )? ColumnList ) - ConstraintOptionList? PrimaryKeyConstraint = ('constraint' NameRef) 'primary' 'key' (UsingIndex | ColumnList IndexParams) - ConstraintOptionList? SetNullColumns = 'set' 'null' ColumnList? @@ -327,25 +324,23 @@ InitiallyImmediateConstraintOption = InitiallyDeferredConstraintOption = 'initially' 'deferred' -ConstraintOptionList = - (DeferrableConstraintOption | NotDeferrableConstraintOption)? - (InitiallyDeferredConstraintOption | InitiallyImmediateConstraintOption)? +NotEnforced = + 'not' 'enforced' +Enforced = + 'enforced' NotNullConstraint = ('constraint' NameRef) 'not' 'null' - ConstraintOptionList? NullConstraint = ('constraint' NameRef) 'null' - ConstraintOptionList? DefaultConstraint = ('constraint' NameRef) 'default' Expr - ConstraintOptionList? // SequenceOption = // 'as' Type @@ -370,7 +365,6 @@ GeneratedConstraint = ('constraint' NameRef) 'generated' ('always' 'as' '(' Expr ')' 'stored' | ('always' | 'by' 'default') 'as' 'identity' SequenceOptionList? ) - ConstraintOptionList? ReferencesConstraint = ('constraint' NameRef) @@ -378,7 +372,6 @@ ReferencesConstraint = MatchType? OnDeleteAction? OnUpdateAction? - ConstraintOptionList? AlterTableAction = ValidateConstraint @@ -668,7 +661,15 @@ Constraint = | NotNullConstraint AddConstraint = - 'add' Constraint NotValid? + 'add' Constraint + DeferrableConstraintOption? + NotDeferrableConstraintOption? + InitiallyDeferredConstraintOption? + InitiallyImmediateConstraintOption? + NotValid? + NoInherit? + NotEnforced? + Enforced? DropConstraint = 'drop' Constraint IfExists? NameRef ('restrict' | 'cascade')? diff --git a/crates/squawk_syntax/src/snapshots/squawk_syntax__test__alter_aggregate_params_validation.snap b/crates/squawk_syntax/src/snapshots/squawk_syntax__test__alter_aggregate_params_validation.snap index ad5fac13..5d9fbf36 100644 --- a/crates/squawk_syntax/src/snapshots/squawk_syntax__test__alter_aggregate_params_validation.snap +++ b/crates/squawk_syntax/src/snapshots/squawk_syntax__test__alter_aggregate_params_validation.snap @@ -21,7 +21,10 @@ SOURCE_FILE@0..101 IN_KW@58..60 "in" WHITESPACE@60..61 " " PATH_TYPE@61..62 - IDENT@61..62 "x" + PATH@61..62 + PATH_SEGMENT@61..62 + NAME_REF@61..62 + IDENT@61..62 "x" COMMA@62..63 "," WHITESPACE@63..64 " " PARAM@64..69 @@ -29,7 +32,10 @@ SOURCE_FILE@0..101 OUT_KW@64..67 "out" WHITESPACE@67..68 " " PATH_TYPE@68..69 - IDENT@68..69 "y" + PATH@68..69 + PATH_SEGMENT@68..69 + NAME_REF@68..69 + IDENT@68..69 "y" R_PAREN@69..70 ")" WHITESPACE@70..71 " " L_PAREN@71..72 "(" diff --git a/crates/squawk_syntax/src/snapshots/squawk_syntax__test__create_aggregate_params_validation.snap b/crates/squawk_syntax/src/snapshots/squawk_syntax__test__create_aggregate_params_validation.snap index 1aeeaba3..ca1253fa 100644 --- a/crates/squawk_syntax/src/snapshots/squawk_syntax__test__create_aggregate_params_validation.snap +++ b/crates/squawk_syntax/src/snapshots/squawk_syntax__test__create_aggregate_params_validation.snap @@ -23,7 +23,10 @@ SOURCE_FILE@0..91 IN_KW@58..60 "in" WHITESPACE@60..61 " " PATH_TYPE@61..62 - IDENT@61..62 "t" + PATH@61..62 + PATH_SEGMENT@61..62 + NAME_REF@61..62 + IDENT@61..62 "t" COMMA@62..63 "," WHITESPACE@63..64 " " PARAM@64..69 @@ -31,7 +34,10 @@ SOURCE_FILE@0..91 OUT_KW@64..67 "out" WHITESPACE@67..68 " " PATH_TYPE@68..69 - IDENT@68..69 "u" + PATH@68..69 + PATH_SEGMENT@68..69 + NAME_REF@68..69 + IDENT@68..69 "u" R_PAREN@69..70 ")" WHITESPACE@70..76 " \n " SET_KW@76..79 "set" diff --git a/crates/squawk_syntax/src/snapshots/squawk_syntax__test__drop_aggregate_params_validation.snap b/crates/squawk_syntax/src/snapshots/squawk_syntax__test__drop_aggregate_params_validation.snap index d0aef4d3..8368aaf3 100644 --- a/crates/squawk_syntax/src/snapshots/squawk_syntax__test__drop_aggregate_params_validation.snap +++ b/crates/squawk_syntax/src/snapshots/squawk_syntax__test__drop_aggregate_params_validation.snap @@ -86,7 +86,10 @@ SOURCE_FILE@0..389 WHITESPACE@127..136 "\n " PARAM@136..140 PATH_TYPE@136..140 - TEXT_KW@136..140 "text" + PATH@136..140 + PATH_SEGMENT@136..140 + NAME_REF@136..140 + TEXT_KW@136..140 "text" WHITESPACE@140..145 "\n " R_PAREN@145..146 ")" COMMA@146..147 "," @@ -129,7 +132,10 @@ SOURCE_FILE@0..389 WHITESPACE@211..214 "\n " PARAM@214..218 PATH_TYPE@214..218 - TEXT_KW@214..218 "text" + PATH@214..218 + PATH_SEGMENT@214..218 + NAME_REF@214..218 + TEXT_KW@214..218 "text" COMMA@218..219 "," WHITESPACE@219..222 "\n " PARAM@222..229 @@ -171,7 +177,10 @@ SOURCE_FILE@0..389 WHITESPACE@279..284 "\n " PARAM@284..288 PATH_TYPE@284..288 - TEXT_KW@284..288 "text" + PATH@284..288 + PATH_SEGMENT@284..288 + NAME_REF@284..288 + TEXT_KW@284..288 "text" WHITESPACE@288..289 "\n" R_PAREN@289..290 ")" WHITESPACE@290..291 " " @@ -228,7 +237,10 @@ SOURCE_FILE@0..389 WHITESPACE@375..380 "\n " PARAM@380..384 PATH_TYPE@380..384 - TEXT_KW@380..384 "text" + PATH@380..384 + PATH_SEGMENT@380..384 + NAME_REF@380..384 + TEXT_KW@380..384 "text" WHITESPACE@384..385 "\n" R_PAREN@385..386 ")" SEMICOLON@386..387 ";" diff --git a/s/lint b/s/lint index 5782ff3d..fd9d5f67 100755 --- a/s/lint +++ b/s/lint @@ -2,4 +2,4 @@ set -eu cargo fmt -- --check -cargo clippy --all-targets --all-features +cargo clippy --all-targets --all-features -- -D warnings