From c16975721775a75cdde9944ffa34b612b0347839 Mon Sep 17 00:00:00 2001 From: Joe Reynolds Date: Thu, 15 Aug 2024 15:32:24 +0100 Subject: [PATCH] Support TYPE in ALTER statement (postgres) (#272) Co-authored-by: Joe Reynolds --- src/lexer/statements/postgres/alter.ts | 1 + .../checker/checks/postgres/postgresInvalidAlterOption.test.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/src/lexer/statements/postgres/alter.ts b/src/lexer/statements/postgres/alter.ts index 86fbf98..46a657b 100644 --- a/src/lexer/statements/postgres/alter.ts +++ b/src/lexer/statements/postgres/alter.ts @@ -20,6 +20,7 @@ class PostgresAlter implements ILexer { "server", "table", "tablespace", + "type", "view", ]; diff --git a/test/unit/checker/checks/postgres/postgresInvalidAlterOption.test.ts b/test/unit/checker/checks/postgres/postgresInvalidAlterOption.test.ts index bb65258..40c32bc 100644 --- a/test/unit/checker/checks/postgres/postgresInvalidAlterOption.test.ts +++ b/test/unit/checker/checks/postgres/postgresInvalidAlterOption.test.ts @@ -15,6 +15,7 @@ test.each([ ["ALTER server;"], ["ALTER table;"], ["ALTER tablespace;"], + ["ALTER TYPE blah;"], ["ALTER view;"], ])("it does not error about valid ALTER options", (query) => { const checker = new PostgresInvalidAlterOption();