Package org.pgcodekeeper.core.schema.ch
Class ChPolicy
java.lang.Object
org.pgcodekeeper.core.schema.PgStatement
org.pgcodekeeper.core.schema.AbstractPolicy
org.pgcodekeeper.core.schema.ch.ChPolicy
- All Implemented Interfaces:
IHashable,IStatement
Represents a ClickHouse row-level security policy.
Supports role-based access control with EXCEPT clauses for role exclusions.
-
Field Summary
Fields inherited from class org.pgcodekeeper.core.schema.PgStatement
GO -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a role to the EXCEPT list for this policy.appendAlterSQL(PgStatement newCondition, SQLScript script) Fill script with object changes and return change typebooleancompare(PgStatement obj) This method does not account for nested child PgStatements.voidcomputeHash(Hasher hasher) Computes the hash of the implementing object using the provided hasher.voidgetCreationSQL(SQLScript script) Generates the SQL statements needed to create this database object.Gets the database that contains this statement.Gets the fully qualified name of this statement.Methods inherited from class org.pgcodekeeper.core.schema.AbstractPolicy
addRole, getStatementType, setEvent, setPermissive, setUsing, shallowCopyMethods inherited from class org.pgcodekeeper.core.schema.PgStatement
addAllDeps, addDep, addPrivilege, appendAlterComments, appendComments, appendOwnerSQL, canDrop, canDropBeforeCreate, checkComments, clearPrivileges, compareChildren, deepCopy, equals, getAuthor, getBareName, getChildren, getComment, getDeps, getDescendants, getDropSQL, getDropSQL, getLibName, getLocation, getName, getObjectState, getObjectState, getOwner, getParent, getPrivileges, getSQL, getTwin, getTypeName, hasChildren, hashCode, isLib, isOwned, isSubElement, setAuthor, setComment, setLibName, setLocation, setOwner, setParent, toString
-
Constructor Details
-
ChPolicy
Creates a new ClickHouse policy with the specified name.- Parameters:
name- the name of the policy
-
-
Method Details
-
addExcept
Adds a role to the EXCEPT list for this policy.- Parameters:
except- the role name to exclude
-
getCreationSQL
Description copied from class:PgStatementGenerates the SQL statements needed to create this database object. This is an abstract method that must be implemented by subclasses to provide the specific CREATE SQL for each object type.- Specified by:
getCreationSQLin classPgStatement- Parameters:
script- the SQL script to append creation statements to
-
appendAlterSQL
Description copied from class:PgStatementFill script with object changes and return change type- Specified by:
appendAlterSQLin classPgStatement- Parameters:
newCondition- new object statescript- script to collect changes- Returns:
- object change type
-
getQualifiedName
Description copied from interface:IStatementGets the fully qualified name of this statement.- Specified by:
getQualifiedNamein interfaceIStatement- Overrides:
getQualifiedNamein classPgStatement- Returns:
- fully qualified (up to schema) dot-delimited object name. Identifiers are quoted.
-
computeHash
Description copied from interface:IHashableComputes the hash of the implementing object using the provided hasher. The implementation should call appropriateputmethods on the hasher for all fields that should contribute to the hash value.- Specified by:
computeHashin interfaceIHashable- Overrides:
computeHashin classAbstractPolicy- Parameters:
hasher- the hasher instance to use for hash computation
-
compare
Description copied from class:PgStatementThis method does not account for nested child PgStatements. Shallow version ofPgStatement.equals(Object)- Overrides:
comparein classAbstractPolicy
-
getDbType
- Overrides:
getDbTypein classPgStatement
-
getDatabase
Description copied from interface:IStatementGets the database that contains this statement.- Returns:
- the containing database
-