GRANT语句
适用于 ✅ 开源版 ✅ 专业版 ✅ 企业版
为数据库目录实现访问控制的数据库允许使用 GRANT 和 REVOKE 权限从 org.jooq.User 和 org.jooq.Role 对象。 在 jOOQ 中,可以通过以下方式完成
// Define privileges
Privilege select = privilege("select");
Privilege insert = privilege("insert");
User user = user("user");
// Grant privileges to a given user or role
create.grant(select, insert).on(BOOK).to(user).execute();
// Grant privileges to a given user or role with the grant option
create.grant(select, insert).on(BOOK).to(user).withGrantOption().execute();
// Grant privileges to everyone
create.grant(select, insert).on(BOOK).toPublic().execute();
反馈
您对此页面有任何反馈吗? 我们很乐意听到您的意见!