Package org.pgcodekeeper.core.schema.pg
Class AbstractForeignTable
java.lang.Object
org.pgcodekeeper.core.schema.PgStatement
org.pgcodekeeper.core.schema.PgStatementContainer
org.pgcodekeeper.core.schema.AbstractTable
org.pgcodekeeper.core.schema.pg.AbstractPgTable
org.pgcodekeeper.core.schema.pg.AbstractForeignTable
- All Implemented Interfaces:
IHashable,IForeignTable,IOptionContainer,IRelation,ISearchPath,IStatement,IStatementContainer,PgForeignOptionContainer
- Direct Known Subclasses:
PartitionForeignPgTable,SimpleForeignPgTable
public abstract class AbstractForeignTable
extends AbstractPgTable
implements PgForeignOptionContainer, IForeignTable
Base implementation of foreign table for PostgreSQL database.
Foreign tables are used to access data that exists outside the database,
typically in other databases or external data sources through foreign data wrappers.
- Since:
- 4.1.1
- Author:
- galiev_mr
-
Field Summary
Fields inherited from class org.pgcodekeeper.core.schema.PgStatement
GOFields inherited from interface org.pgcodekeeper.core.schema.IOptionContainer
GP_OPTION_LISTFields inherited from interface org.pgcodekeeper.core.schema.pg.PgForeignOptionContainer
ALTER_FOREIGN_OPTION, DELIM -
Method Summary
Modifier and TypeMethodDescriptionvoidappendMoveDataSql(PgStatement 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.voidappendOptions(StringBuilder sqlOption) Appends SQL OPTIONS clause to StringBuilder.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.Returns the ALTER statement header for this object.getAlterTable(boolean only) Generates beginning of alter table statement.Gets the type name of this statement for SQL generation.Methods inherited from class org.pgcodekeeper.core.schema.pg.AbstractPgTable
addInherits, appendAlterSQL, appendComments, getColsForMovingData, getCreationSQL, getInherits, getRelationColumns, hasInherits, putTriggerState, setHasOids, shallowCopy, sortColumnsMethods inherited from class org.pgcodekeeper.core.schema.AbstractTable
addColumn, addConstraint, addOption, columnAdder, compareChildren, compareIgnoringColumnOrder, computeChildrenHash, containsColumn, getColumn, getColumns, getConstraint, getConstraints, getOption, getOptions, getStatementType, isRecreatedMethods 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, getDbType, getDeps, getDescendants, getDropSQL, getDropSQL, getLibName, getLocation, getName, getObjectState, getObjectState, getOwner, getParent, getPrivileges, getQualifiedName, getSQL, getTwin, hasChildren, hashCode, isLib, isOwned, isSubElement, setAuthor, setComment, setLibName, setLocation, setOwner, setParent, toStringMethods inherited from interface org.pgcodekeeper.core.schema.IOptionContainer
addOption, getOptionsMethods inherited from interface org.pgcodekeeper.core.schema.ISearchPath
getDatabase, getSchemaNameMethods inherited from interface org.pgcodekeeper.core.schema.IStatement
getBareName, getComment, getName, getParent, getQualifiedName, getStatementTypeMethods inherited from interface org.pgcodekeeper.core.schema.pg.PgForeignOptionContainer
compareOptions
-
Method Details
-
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
-
appendOptions
Description copied from interface:PgForeignOptionContainerAppends SQL OPTIONS clause to StringBuilder.- Specified by:
appendOptionsin interfacePgForeignOptionContainer- Parameters:
sqlOption- the StringBuilder to append to
-
getTypeName
Description copied from class:PgStatementGets the type name of this statement for SQL generation.- Overrides:
getTypeNamein classPgStatement- Returns:
- the type name
-
getAlterHeader
Description copied from interface:PgForeignOptionContainerReturns the ALTER statement header for this object.- Specified by:
getAlterHeaderin interfacePgForeignOptionContainer- Returns:
- ALTER statement prefix (e.g., "ALTER FOREIGN TABLE table_name")
-
compare
Description copied from class:PgStatementThis method does not account for nested child PgStatements. Shallow version ofPgStatement.equals(Object)- Overrides:
comparein classAbstractPgTable
-
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 classAbstractPgTable- Parameters:
hasher- the hasher instance to use for hash computation
-
appendMoveDataSql
public void appendMoveDataSql(PgStatement newCondition, SQLScript script, String tblTmpBareName, List<String> identityCols) Description copied from class:AbstractTableAdds 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.- Overrides:
appendMoveDataSqlin classAbstractTable
-