Class PgPrivilege
java.lang.Object
org.pgcodekeeper.core.database.base.schema.AbstractPrivilege
org.pgcodekeeper.core.database.pg.schema.PgPrivilege
- All Implemented Interfaces:
IPrivilege,IHashable
Represents a database privilege (GRANT/REVOKE) for PostgreSQL database object.
Handles privilege operations including creation, dropping, and SQL generation.
-
Field Summary
Fields inherited from interface org.pgcodekeeper.core.database.api.schema.IPrivilege
GRANT, REVOKE, WITH_GRANT_OPTION -
Constructor Summary
ConstructorsConstructorDescriptionPgPrivilege(String state, String permission, String name, String role, boolean isGrantOption) Creates a new privilege instance. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidappendDefaultPostgresPrivileges(IStatement newObj, SQLScript script) Appends default PostgreSQL privileges for a database object.Methods inherited from class org.pgcodekeeper.core.database.base.schema.AbstractPrivilege
computeHash, equals, getCreationSQL, getDropSQL, getName, getPermission, getRole, hashCode, isRevoke, toString
-
Constructor Details
-
PgPrivilege
public PgPrivilege(String state, String permission, String name, String role, boolean isGrantOption) Creates a new privilege instance.- Parameters:
state- the privilege state (GRANT or REVOKE)permission- the permission type (e.g., SELECT, INSERT, ALL)name- the object name the privilege applies torole- the role receiving or losing the privilegeisGrantOption- whether this privilege includes GRANT OPTION
-
-
Method Details
-
appendDefaultPostgresPrivileges
Appends default PostgreSQL privileges for a database object.- Parameters:
newObj- the database object to set default privileges forscript- the script to append privileges to
-