Skip to content

Commit c9c0781

Browse files
committed
Allow short multiline ALTER DEFAULT PRIVILEGES
1 parent 38349bb commit c9c0781

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/syntax/dcl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export const dclMap: CstToDocMap<AllDclNodes> = {
9999

100100
alter_default_privileges_stmt: (print) =>
101101
group(
102-
join(line, [
102+
join(print.dynamicLine(), [
103103
print.spaced("alterDefaultPrivilegesKw"),
104104
...print("clauses"),
105105
print("action"),

test/dcl/alter_default_privileges.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ describe("alter default privileges", () => {
2626
`);
2727
});
2828

29+
it(`formats short ALTER DEFAULT PRIVILEGES to multiple lines when original code is multiline`, async () => {
30+
await testPostgresql(dedent`
31+
ALTER DEFAULT PRIVILEGES
32+
REVOKE ALL ON TABLES FROM PUBLIC
33+
`);
34+
});
35+
2936
it(`formats long clauses to multiple lines`, async () => {
3037
await testPostgresql(dedent`
3138
ALTER DEFAULT PRIVILEGES

0 commit comments

Comments
 (0)