Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more PostgreSQL keywords and phrases #821

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/languages/postgresql/postgresql.formatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ const tabularOnelineClauses = expandPhrases([
'DROP IDENTITY',
'DROP INDEX',
'DROP LANGUAGE',
'DROP MATERIALIZED VIEW',
'DROP MATERIALIZED VIEW [IF EXISTS]',
'DROP OPERATOR',
'DROP OPERATOR CLASS',
'DROP OPERATOR FAMILY',
Expand Down Expand Up @@ -216,7 +216,7 @@ const tabularOnelineClauses = expandPhrases([
'REFRESH MATERIALIZED VIEW',
'REINDEX',
'RELEASE SAVEPOINT',
'RESET',
'RESET [ALL|ROLE|SESSION AUTHORIZATION]',
'REVOKE',
'ROLLBACK',
'ROLLBACK PREPARED',
Expand Down Expand Up @@ -252,11 +252,15 @@ const reservedPhrases = expandPhrases([
'PRIMARY KEY',
'GENERATED {ALWAYS | BY DEFAULT} AS IDENTITY',
'ON {UPDATE | DELETE} [SET NULL | SET DEFAULT]',
'DO {NOTHING | UPDATE}',
'AS MATERIALIZED',
'{ROWS | RANGE | GROUPS} BETWEEN',
// https://www.postgresql.org/docs/current/datatype-datetime.html
'[TIMESTAMP | TIME] {WITH | WITHOUT} TIME ZONE',
// comparison operator
'IS [NOT] DISTINCT FROM',
'NULLS {FIRST | LAST}',
'WITH ORDINALITY',
]);

// https://www.postgresql.org/docs/14/index.html
Expand Down
Loading