Skip to content

Commit 366bd7b

Browse files
authored
Add more PostgreSQL keywords and phrases (#821)
Closes #809
2 parents 9fe19f9 + 2e0079b commit 366bd7b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/languages/postgresql/postgresql.formatter.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ const tabularOnelineClauses = expandPhrases([
172172
'DROP IDENTITY',
173173
'DROP INDEX',
174174
'DROP LANGUAGE',
175-
'DROP MATERIALIZED VIEW',
175+
'DROP MATERIALIZED VIEW [IF EXISTS]',
176176
'DROP OPERATOR',
177177
'DROP OPERATOR CLASS',
178178
'DROP OPERATOR FAMILY',
@@ -216,7 +216,7 @@ const tabularOnelineClauses = expandPhrases([
216216
'REFRESH MATERIALIZED VIEW',
217217
'REINDEX',
218218
'RELEASE SAVEPOINT',
219-
'RESET',
219+
'RESET [ALL|ROLE|SESSION AUTHORIZATION]',
220220
'REVOKE',
221221
'ROLLBACK',
222222
'ROLLBACK PREPARED',
@@ -252,11 +252,15 @@ const reservedPhrases = expandPhrases([
252252
'PRIMARY KEY',
253253
'GENERATED {ALWAYS | BY DEFAULT} AS IDENTITY',
254254
'ON {UPDATE | DELETE} [SET NULL | SET DEFAULT]',
255+
'DO {NOTHING | UPDATE}',
256+
'AS MATERIALIZED',
255257
'{ROWS | RANGE | GROUPS} BETWEEN',
256258
// https://www.postgresql.org/docs/current/datatype-datetime.html
257259
'[TIMESTAMP | TIME] {WITH | WITHOUT} TIME ZONE',
258260
// comparison operator
259261
'IS [NOT] DISTINCT FROM',
262+
'NULLS {FIRST | LAST}',
263+
'WITH ORDINALITY',
260264
]);
261265

262266
// https://www.postgresql.org/docs/14/index.html

0 commit comments

Comments
 (0)