Package org.pgcodekeeper.core.schema.ch
Class ChColumn
java.lang.Object
org.pgcodekeeper.core.schema.PgStatement
org.pgcodekeeper.core.schema.AbstractColumn
org.pgcodekeeper.core.schema.ch.ChColumn
- All Implemented Interfaces:
IHashable,ISearchPath,IStatement
Represents a ClickHouse database column with ClickHouse-specific properties.
Extends the base AbstractColumn with support for ClickHouse-specific features like TTL,
codecs, and different default types.
-
Field Summary
Fields inherited from class org.pgcodekeeper.core.schema.PgStatement
GO -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidappendAlterSQL(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.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.voidgetDropSQL(SQLScript script, boolean optionExists) Generates DROP SQL for this statement.Returns the complete column definition including type, constraints, and other attributes.voidsetDefaultType(String defaultType) voidvoidMethods inherited from class org.pgcodekeeper.core.schema.AbstractColumn
getCollation, getContainingSchema, getDefaultValue, getLocation, getNullValue, getStatementType, getType, isSubElement, setCollation, setDefaultValue, setNullValue, setType, shallowCopyMethods inherited from class org.pgcodekeeper.core.schema.PgStatement
addAllDeps, addDep, addPrivilege, appendAlterComments, appendOwnerSQL, canDrop, canDropBeforeCreate, checkComments, clearPrivileges, compareChildren, deepCopy, equals, getAuthor, getBareName, getChildren, getComment, getDeps, getDescendants, getDropSQL, getLibName, getName, getObjectState, getObjectState, getOwner, getParent, getPrivileges, getQualifiedName, getSQL, getTwin, getTypeName, hasChildren, hashCode, isLib, isOwned, 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
-
ChColumn
Creates a new ClickHouse column with the specified name.- Parameters:
name- the name of the column
-
-
Method Details
-
setDefaultType
-
setTtl
-
addCodec
-
setOption
-
getFullDefinition
Description copied from class:AbstractColumnReturns the complete column definition including type, constraints, and other attributes.- Specified by:
getFullDefinitionin classAbstractColumn- Returns:
- the full column definition as SQL string
-
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
-
getDropSQL
Description copied from class:PgStatementGenerates DROP SQL for this statement.- Overrides:
getDropSQLin classPgStatement- Parameters:
script- the SQL script to append the DROP statement tooptionExists- whether to include "IF EXISTS" in the DROP statement
-
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 classAbstractColumn- 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 classAbstractColumn
-
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
-