Skip to content

Commit 6e9fd29

Browse files
committed
feat: support comment on extension in pg
1 parent d24698d commit 6e9fd29

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

pegjs/postgresql.pegjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3231,7 +3231,7 @@ comment_on_option
32313231
name,
32323232
}
32333233
}
3234-
/ t:(KW_INDEX / KW_COLLATION / KW_TABLESPACE / KW_SCHEMA / 'DOMAIN'i / KW_DATABASE / 'ROLE'i / 'SEQUENCE'i / 'SERVER'i / 'SUBSCRIPTION'i ) __ name:ident_type {
3234+
/ t:(KW_INDEX / KW_COLLATION / KW_TABLESPACE / KW_SCHEMA / 'DOMAIN'i / KW_DATABASE / 'ROLE'i / 'SEQUENCE'i / 'SERVER'i / 'SUBSCRIPTION'i / 'EXTENSION'i) __ name:ident_type {
32353235
// => { type: string; name: ident; }
32363236
return {
32373237
type: t.toLowerCase(),

test/postgres.spec.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1861,6 +1861,13 @@ describe('Postgres', () => {
18611861
'SELECT 100.0 * COUNT(_timestamp) AS "y_axis_1" FROM "default"'
18621862
]
18631863
},
1864+
{
1865+
title: 'comment on extension',
1866+
sql: [
1867+
"COMMENT ON EXTENSION pgcrypto IS 'HELLO WORLD'",
1868+
"COMMENT ON EXTENSION pgcrypto IS 'HELLO WORLD'"
1869+
]
1870+
},
18641871
]
18651872
function neatlyNestTestedSQL(sqlList){
18661873
sqlList.forEach(sqlInfo => {

0 commit comments

Comments
 (0)