Package org.pgcodekeeper.core.schema.pg
Class PgDatabase
java.lang.Object
org.pgcodekeeper.core.schema.PgStatement
org.pgcodekeeper.core.schema.AbstractDatabase
org.pgcodekeeper.core.schema.pg.PgDatabase
- All Implemented Interfaces:
IHashable,IDatabase,IStatement,IStatementContainer
PostgreSQL database implementation.
Manages database-level objects such as schemas, extensions, event triggers,
foreign data wrappers, servers, user mappings, and casts.
- Author:
- fordfrog
-
Field Summary
Fields inherited from class org.pgcodekeeper.core.schema.PgStatement
GO -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChild(IStatement st) Adds a child statement to this container.booleanDeep part ofPgStatement.equals(Object).voidcomputeChildrenHash(Hasher hasher) Returns cast of given name or null if the cast has not been found.Gets a child statement by name and type.getEventTrigger(String name) getExtension(String name) Returns extension of given name or null if the extension has not been found.getForeignDW(String name) Returns foreign data wrapper of given name or null if the foreign data wrapper has not been found.voidSorts columns in all tables within all schemas of this database.Methods inherited from class org.pgcodekeeper.core.schema.AbstractDatabase
addAnalysisLauncher, addLib, addReference, addSchema, appendAlterSQL, clearAnalysisLaunchers, compare, computeHash, containsSchema, copyLaunchers, getAnalysisLaunchers, getCreationSQL, getDatabase, getDefaultSchema, getDropSQL, getObjReferences, getObjReferences, getOverrides, getSchema, getSchemas, getStatement, getStatementType, getVersion, listPgObjects, setDefaultSchema, setVersion, shallowCopyMethods inherited from class org.pgcodekeeper.core.schema.PgStatement
addAllDeps, addDep, addPrivilege, appendAlterComments, appendComments, appendOwnerSQL, canDrop, canDropBeforeCreate, checkComments, clearPrivileges, deepCopy, equals, getAuthor, getBareName, getChildren, getComment, getDbType, getDeps, getDescendants, 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.IStatement
getBareName, getComment, getName, getParent, getQualifiedName
-
Constructor Details
-
PgDatabase
public PgDatabase()Creates a new PostgreSQL database.
-
-
Method Details
-
getChild
Description copied from interface:IStatementContainerGets a child statement by name and type.- Parameters:
name- the name of the child to findtype- the type of the child to find- Returns:
- the child statement, or null if not found
-
addChild
Description copied from interface:IStatementContainerAdds a child statement to this container.- Parameters:
st- the child statement to add
-
getExtension
Returns extension of given name or null if the extension has not been found.- Parameters:
name- extension name- Returns:
- found extension or null
-
getEventTrigger
-
getForeignDW
Returns foreign data wrapper of given name or null if the foreign data wrapper has not been found.- Parameters:
name- foreign data wrapper name- Returns:
- found foreign data wrapper or null
-
getServer
-
getCast
Returns cast of given name or null if the cast has not been found.- Parameters:
name- cast name- Returns:
- found cast or null
-
compareChildren
Description copied from class:PgStatementDeep part ofPgStatement.equals(Object). Compares all object's child PgStatements for equality.- Overrides:
compareChildrenin classAbstractDatabase
-
computeChildrenHash
- Overrides:
computeChildrenHashin classAbstractDatabase
-
sortColumns
public void sortColumns()Sorts columns in all tables within all schemas of this database. This is used to ensure consistent column ordering in inherited tables.
-