File tree Expand file tree Collapse file tree
operator/src/main/java/it/aboutbits/postgresql/crd/grant Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313import java .util .stream .Collectors ;
1414
1515import static org .jooq .impl .DSL .grant ;
16- import static org .jooq .impl .DSL .name ;
1716import static org .jooq .impl .DSL .privilege ;
17+ import static org .jooq .impl .DSL .quotedName ;
1818import static org .jooq .impl .DSL .role ;
1919
2020@ NullMarked
@@ -37,14 +37,19 @@ public String getName() {
3737 var database = spec .getDatabase ();
3838 var schema = spec .getSchema ();
3939
40- return spec .getObjects ().stream ()
40+ var statements = spec .getObjects ().stream ()
4141 .map (object -> {
42- var on = name ( database , schema , object );
42+ var on = quotedName ( schema , object );
4343
4444 var statement = grant (privileges ).on (on ).to (role );
4545
4646 return statement .getSQL () + ";" ;
4747 })
4848 .collect (Collectors .joining ("\n " ));
49+
50+ return """
51+ Statement(s) executed on database "%s":
52+ %s\
53+ """ .formatted (database , statements );
4954 }
5055}
You can’t perform that action at this time.
0 commit comments