Skip to content

Commit

Permalink
Add more PostgreSQL keywords and phrases (#821)
Browse files Browse the repository at this point in the history
Closes #809
  • Loading branch information
nene authored Jan 5, 2025
2 parents 9fe19f9 + 2e0079b commit 366bd7b
Showing 1 changed file with 6 additions and 2 deletions.
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

0 comments on commit 366bd7b

Please sign in to comment.