Class ChPolicy
java.lang.Object
org.pgcodekeeper.core.database.base.schema.AbstractStatement
org.pgcodekeeper.core.database.ch.schema.ChAbstractStatement
org.pgcodekeeper.core.database.ch.schema.ChPolicy
- All Implemented Interfaces:
IPolicy,IStatement,IHashable
Represents a ClickHouse row-level security policy.
Supports role-based access control with EXCEPT clauses for role exclusions.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a role to the EXCEPT list for this policy.voidAdds a role to this policy.appendAlterSQL(IStatement newCondition, SQLScript script) Fill script with object changes and return change typebooleancompare(IStatement 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 fully qualified name of this statement.voidvoidsetPermissive(boolean isPermissive) voidMethods inherited from class org.pgcodekeeper.core.database.ch.schema.ChAbstractStatement
appendComments, appendOwnerSQL, formatSql, getQuoter, getRenameCommandMethods inherited from class org.pgcodekeeper.core.database.base.schema.AbstractStatement
addDependency, addPrivilege, appendAlterComments, appendPrivileges, canDrop, canDropBeforeCreate, checkComments, clearPrivileges, compareChildren, deepCopy, equals, fillChildrenList, fillDescendantsList, getAuthor, getBareName, getChildren, getComment, getDependencies, getDescendants, getDropSQL, getDropSQL, getLibName, getLocation, getName, getObjectState, getObjectState, getOwner, getParent, getPrivileges, getSeparator, getSQL, getTwin, hasChildren, hashCode, isLib, setAuthor, setComment, setLibName, setLocation, setOwner, setParent, shallowCopy, toStringMethods inherited from interface org.pgcodekeeper.core.database.api.schema.IPolicy
getStatementTypeMethods inherited from interface org.pgcodekeeper.core.database.api.schema.IStatement
addDependency, appendOwnerSQL, canDrop, canDropBeforeCreate, clearPrivileges, deepCopy, formatSql, getAuthor, getBareName, getChildren, getComment, getDatabase, getDependencies, getDescendants, getDropSQL, getLibName, getLocation, getName, getOwner, getParent, getPrivileges, getQuoter, getRenameCommand, getSeparator, getSQL, getTwin, getTypeName, hasChildren, isLib, isOwned, quote, setComment, setLibName, setLocation, setOwner, shallowCopy, toObjectReference
-
Constructor Details
-
ChPolicy
Creates a new ClickHouse policy with the specified name.- Parameters:
name- the name of the policy
-
-
Method Details
-
getCreationSQL
Description copied from interface:IStatementGenerates 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 interfaceIStatement- Parameters:
script- the SQL script to append creation statements to
-
appendAlterSQL
Description copied from interface:IStatementFill script with object changes and return change type- Specified by:
appendAlterSQLin interfaceIStatement- 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 classAbstractStatement- Returns:
- fully qualified (up to schema) dot-delimited object name. Identifiers are quoted.
-
getQuotedName
- Specified by:
getQuotedNamein interfaceIStatement- Returns:
- the quoted name
-
setEvent
-
addRole
Adds a role to this policy.- Parameters:
role- the role name to add
-
setUsing
-
setPermissive
public void setPermissive(boolean isPermissive) -
addExcept
Adds a role to the EXCEPT list for this policy.- Parameters:
except- the role name to exclude
-
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- Parameters:
hasher- the hasher instance to use for hash computation
-
compare
Description copied from class:AbstractStatementThis method does not account for nested child PgStatements. Shallow version ofAbstractStatement.equals(Object)- Specified by:
comparein interfaceIStatement- Overrides:
comparein classAbstractStatement
-