Skip to content

Commit 93862b9

Browse files
committed
Lint fix
1 parent 0c01777 commit 93862b9

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

internal/api/handle_databases.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ func handleCreateDatabase(w http.ResponseWriter, r *http.Request) {
8484
}
8585
defer close()
8686

87-
if err = admin.GrantCreateOnPublic(ctx, dbConn); err != nil {
87+
if err := admin.GrantCreateOnPublic(ctx, dbConn); err != nil {
8888
renderErr(w, err)
8989
return
9090
}

internal/flypg/admin/admin.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,10 @@ func CreateDatabase(ctx context.Context, pg *pgx.Conn, name string) error {
6565
return err
6666
}
6767

68-
// PG 15 by default removes the ability for normal users to create
69-
// tables within the public schema. This re-enables it to keep the
70-
// experience consistent for users. We should explore create user
71-
// schemas for better isolation in the future.
68+
// GrantCreateOnPublic re-enables the public schema for normal users.
69+
// We should look into creating better isolation in the future.
7270
func GrantCreateOnPublic(ctx context.Context, pg *pgx.Conn) error {
73-
sql := fmt.Sprintf(`GRANT CREATE on SCHEMA PUBLIC to PUBLIC;`)
71+
sql := "GRANT CREATE on SCHEMA PUBLIC to PUBLIC;"
7472
_, err := pg.Exec(ctx, sql)
7573
return err
7674
}

0 commit comments

Comments
 (0)