Package org.pgcodekeeper.core.schema.ch
Class ChTable
java.lang.Object
org.pgcodekeeper.core.schema.PgStatement
org.pgcodekeeper.core.schema.PgStatementContainer
org.pgcodekeeper.core.schema.AbstractTable
org.pgcodekeeper.core.schema.ch.ChTable
- All Implemented Interfaces:
IHashable,IOptionContainer,IRelation,ISearchPath,IStatement,IStatementContainer
- Direct Known Subclasses:
ChTableLog
Represents a ClickHouse table with engine configuration and projections.
Supports ClickHouse-specific features like table engines, projections, and specialized DDL operations.
-
Field Summary
Fields inherited from class org.pgcodekeeper.core.schema.PgStatement
GOFields inherited from interface org.pgcodekeeper.core.schema.IOptionContainer
GP_OPTION_LIST -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddProjection(String key, String expression) Adds a projection to this table.appendAlterSQL(PgStatement newCondition, SQLScript script) Fill script with object changes and return change typevoidappendComments(SQLScript script) Appends comment SQL to the script if this statement has comments.booleancompare(PgStatement obj) This method does not account for nested child PgStatements.voidcompareOptions(IOptionContainer newContainer, SQLScript script) Compares options between this container and a new container, generating SQL to update differences.voidcomputeHash(Hasher hasher) Computes the hash of the implementing object using the provided hasher.getAlterTable(boolean only) Generates beginning of alter table statement.voidgetCreationSQL(SQLScript script) Generates the SQL statements needed to create this database object.voidvoidMethods inherited from class org.pgcodekeeper.core.schema.AbstractTable
addColumn, addConstraint, addOption, appendMoveDataSql, columnAdder, compareChildren, compareIgnoringColumnOrder, computeChildrenHash, containsColumn, getColumn, getColumns, getConstraint, getConstraints, getOption, getOptions, getRelationColumns, getStatementType, isRecreated, shallowCopyMethods inherited from class org.pgcodekeeper.core.schema.PgStatementContainer
addChild, addIndex, addPolicy, addRule, addTrigger, getChild, getContainingSchema, getIndex, getIndexes, getPolicies, getPolicy, getRule, getRules, getTrigger, getTriggers, isClusteredMethods inherited from class org.pgcodekeeper.core.schema.PgStatement
addAllDeps, addDep, addPrivilege, appendAlterComments, appendOwnerSQL, canDrop, canDropBeforeCreate, checkComments, clearPrivileges, deepCopy, equals, getAuthor, getBareName, getChildren, getComment, getDeps, getDescendants, getDropSQL, getDropSQL, getLibName, getLocation, getName, getObjectState, getObjectState, getOwner, getParent, getPrivileges, getQualifiedName, getSQL, getTwin, getTypeName, hasChildren, hashCode, isLib, isOwned, isSubElement, setAuthor, setComment, setLibName, setLocation, setOwner, setParent, toStringMethods inherited from interface org.pgcodekeeper.core.schema.ISearchPath
getDatabase, getSchemaNameMethods inherited from interface org.pgcodekeeper.core.schema.IStatement
getBareName, getComment, getName, getParent, getQualifiedName
-
Constructor Details
-
ChTable
Creates a new ClickHouse table with the specified name.- Parameters:
name- the name of the table
-
-
Method Details
-
addProjection
Adds a projection to this table.- Parameters:
key- the projection nameexpression- the projection expression
-
setEngine
-
setPkExpr
-
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
-
getAlterTable
Description copied from class:AbstractTableGenerates beginning of alter table statement.- Specified by:
getAlterTablein classAbstractTable- Parameters:
only- if true, append 'ONLY' to statement- Returns:
- alter table statement beginning in String format
-
getDbType
- Overrides:
getDbTypein classPgStatement
-
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 classAbstractTable- 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 classAbstractTable
-
appendComments
Description copied from class:PgStatementAppends comment SQL to the script if this statement has comments.- Overrides:
appendCommentsin classPgStatement- Parameters:
script- the SQL script to append comments to
-
compareOptions
Description copied from interface:IOptionContainerCompares options between this container and a new container, generating SQL to update differences.- Parameters:
newContainer- the new container to compare againstscript- the script to append changes to
-