Interface ITable
- All Superinterfaces:
IRelation,ISearchPath,IStatement,IStatementContainer
- All Known Subinterfaces:
IForeignTable,IPartitionTable
- All Known Implementing Classes:
ChTable,ChTableLog,GpExternalTable,GpPartitionTable,MsTable,PgAbstractForeignTable,PgAbstractRegularTable,PgAbstractTable,PgPartitionForeignTable,PgPartitionTable,PgSimpleForeignTable,PgSimpleTable,PgTypedTable
Interface for database table
-
Method Summary
Modifier and TypeMethodDescriptionvoidappendMoveDataSql(IStatement newCondition, SQLScript script, String tblTmpBareName, List<String> identityCols) Adds commands to the script for move data from the temporary table to the new table, given the identity columns, and a command to delete the temporary table.static Stream<? extends IStatement>Creates a stream that includes the statement itself and its columns if it's a table.booleancompareIgnoringColumnOrder(ITable newTable) default DbObjTypeGets the type of this database object.booleanisRecreated(ITable newTable, ISettings settings) Compares this table with thenewTableto determine if a full table recreation is required.Methods inherited from interface org.pgcodekeeper.core.database.api.schema.IRelation
getRelationColumnsMethods inherited from interface org.pgcodekeeper.core.database.api.schema.ISearchPath
getContainingSchema, getDatabase, getSchemaName, toObjectReferenceMethods inherited from interface org.pgcodekeeper.core.database.api.schema.IStatement
addDependency, appendAlterSQL, appendOwnerSQL, canDrop, canDropBeforeCreate, clearPrivileges, compare, deepCopy, formatSql, getAuthor, getBareName, getChildren, getComment, getCreationSQL, getDependencies, getDescendants, getDropSQL, getLibName, getLocation, getName, getOwner, getParent, getPrivileges, getQualifiedName, getQuotedName, getQuoter, getRenameCommand, getSeparator, getSQL, getTwin, getTypeName, hasChildren, isLib, isOwned, quote, setComment, setLibName, setLocation, setOwner, shallowCopyMethods inherited from interface org.pgcodekeeper.core.database.api.schema.IStatementContainer
addChild, getChild, getChildrenByType
-
Method Details
-
getColumn
-
getStatementType
Description copied from interface:IStatementGets the type of this database object.- Specified by:
getStatementTypein interfaceIStatement- Returns:
- the database object type
-
getColumns
Collection<IColumn> getColumns() -
getConstraints
Collection<IConstraint> getConstraints() -
columnAdder
Creates a stream that includes the statement itself and its columns if it's a table.- Parameters:
st- the statement to process- Returns:
- a stream containing the statement and its columns (if applicable)
-
appendMoveDataSql
void appendMoveDataSql(IStatement newCondition, SQLScript script, String tblTmpBareName, List<String> identityCols) Adds commands to the script for move data from the temporary table to the new table, given the identity columns, and a command to delete the temporary table. -
isRecreated
Compares this table with thenewTableto determine if a full table recreation is required. A full recreation (DROP and CREATE) is needed when the tables differ in ways that cannot be altered using ALTER TABLE statements.- Parameters:
newTable- the new table definition to compare againstsettings- application settings that may affect the comparison logic- Returns:
trueif the table requires recreation (DROP and CREATE) rather than being alterable,falseif the changes can be applied via ALTER TABLE
-
compareIgnoringColumnOrder
- Parameters:
newTable- new state of the table- Returns:
- true if the tables are identical
-