Interface MsSourceStatement
- All Superinterfaces:
ISearchPath,IStatement
- All Known Implementing Classes:
MsAbstractFunction,MsFunction,MsProcedure,MsTrigger,MsView
Interface for database statements that are represented by their full source code.
The source is separated into two parts by the CREATE/ALTER statement keywords,
allowing for flexible SQL generation while preserving the original formatting.
-
Method Summary
Modifier and TypeMethodDescriptiondefault StringBuilderAppends the only normalized statement part: its name and location, always qualifies and quotes.default voidappendSourceStatement(StringBuilder sb, boolean quotedIdentified, boolean ansiNulls, boolean isCreate) Assembles entire statement from source partsGets the first part of the source statement (before CREATE/ALTER).Gets the second part of the source statement (after the object name).voidsetFirstPart(String firstPart) Sets the first part of the source statement.voidsetSecondPart(String secondPart) Sets the second part of the source statement.Methods 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, getStatementType, getTwin, getTypeName, hasChildren, isLib, isOwned, quote, setComment, setLibName, setLocation, setOwner, shallowCopy
-
Method Details
-
getFirstPart
String getFirstPart()Gets the first part of the source statement (before CREATE/ALTER).- Returns:
- the first part of the source
-
setFirstPart
Sets the first part of the source statement.- Parameters:
firstPart- the first part to set
-
getSecondPart
String getSecondPart()Gets the second part of the source statement (after the object name).- Returns:
- the second part of the source
-
setSecondPart
Sets the second part of the source statement.- Parameters:
secondPart- the second part to set
-
appendSourceStatement
default void appendSourceStatement(StringBuilder sb, boolean quotedIdentified, boolean ansiNulls, boolean isCreate) Assembles entire statement from source parts- Parameters:
isCreate- do CREATE or ALTER
-
appendName
Appends the only normalized statement part: its name and location, always qualifies and quotes.
-