Skip to content

Commit e76d8ea

Browse files
committed
Format DROP PUBLICATION
1 parent 71c9561 commit e76d8ea

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/syntax/publication.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,9 @@ export const publicationMap: Partial<CstToDocMap<AllPublicationNodes>> = {
2121
group(print.spaced(["tableKw", "table", "columns", "where"])),
2222
publication_object_tables_in_schema: (print) =>
2323
group(print.spaced(["tablesInSchemaKw", "schema"])),
24+
25+
drop_publication_stmt: (print) =>
26+
group(
27+
print.spaced(["dropPublicationKw", "ifExistsKw", "names", "behaviorKw"]),
28+
),
2429
};

test/postgresql/publication.test.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,15 @@ describe("publications", () => {
7575
`);
7676
});
7777
});
78+
79+
describe("DROP PUBLICATION", () => {
80+
it(`formats DROP PUBLICATION`, async () => {
81+
await testPostgresql(dedent`
82+
DROP PUBLICATION my_publication
83+
`);
84+
await testPostgresql(dedent`
85+
DROP PUBLICATION IF EXISTS my_publication1, my_publication2 CASCADE
86+
`);
87+
});
88+
});
7889
});

0 commit comments

Comments
 (0)