Skip to content

Commit

Permalink
fix: constraint with quoted name
Browse files Browse the repository at this point in the history
  • Loading branch information
taozhi8833998 committed Aug 26, 2024
1 parent c2f70bf commit fce3407
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions pegjs/postgresql.pegjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
'CASE': true,
'CREATE': true,
'CONTAINS': true,
'CONSTRAINT': true,
'CURRENT_DATE': true,
'CURRENT_TIME': true,
'CURRENT_TIMESTAMP': true,
Expand Down
10 changes: 10 additions & 0 deletions test/postgres.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1912,6 +1912,16 @@ describe('Postgres', () => {
'CREATE SCHEMA public'
]
},
{
title: 'create constraint with quoted name',
sql: [
`CREATE TABLE "User" (
"id" SERIAL NOT NULL,
CONSTRAINT "User_pkey" PRIMARY KEY ("id")
);`,
'CREATE TABLE "User" ("id" SERIAL NOT NULL, CONSTRAINT "User_pkey" PRIMARY KEY ("id"))'
]
},
]
neatlyNestTestedSQL(SQL_LIST)
})
Expand Down

0 comments on commit fce3407

Please sign in to comment.