Class AbstractModelExporter
java.lang.Object
org.pgcodekeeper.core.database.base.project.AbstractModelExporter
- All Implemented Interfaces:
IModelExporter
- Direct Known Subclasses:
AbstractOverridesModelExporter,ChModelExporter,MsModelExporter,PgModelExporter
Abstract base class for database model exporters that provides common export functionality
for different database types (PostgreSQL, MS SQL, ClickHouse).
Subclasses must implement database-specific methods for directory structure and file paths.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidExports the complete database schema to directory structure.voidExports only changed objects based on comparison between old and new schemas.voidExports selected objects as a new project structure.getDumpSql(IStatement statement) static StringgetExportedFilename(IStatement statement) Gets the exported filename for a database statement.static StringgetExportedFilenameSql(String name) Gets the SQL filename with .sql extension.Gets the relative file path for a database statement within project structure.static voidwriteProjVersion(Path path) Writes project version marker file.
-
Field Details
-
GROUP_DELIMITER
- See Also:
-
-
Method Details
-
getRelativeFilePath
Gets the relative file path for a database statement within project structure.- Parameters:
st- the database statement- Returns:
- relative path for the statement's file
-
exportFull
Description copied from interface:IModelExporterExports the complete database schema to directory structure. Creates output directory and exports all database objects as SQL files.- Specified by:
exportFullin interfaceIModelExporter- Throws:
IOException- if export operation fails
-
exportPartial
Description copied from interface:IModelExporterExports only changed objects based on comparison between old and new schemas. Handles object additions, deletions, and modifications.- Specified by:
exportPartialin interfaceIModelExporter- Throws:
IOException- if export operation failsPgCodeKeeperException- if old database is null or directory issues occur
-
exportProject
Description copied from interface:IModelExporterExports selected objects as a new project structure. Creates clean directory structure with only specified objects.- Specified by:
exportProjectin interfaceIModelExporter- Throws:
IOException- if export operation fails
-
getDumpSql
-
getExportedFilename
Gets the exported filename for a database statement.- Parameters:
statement- the database statement- Returns:
- sanitized filename suitable for file system
-
getExportedFilenameSql
Gets the SQL filename with .sql extension.- Parameters:
name- the base name- Returns:
- filename with .sql extension
-
writeProjVersion
Writes project version marker file.- Parameters:
path- the path to write version file- Throws:
IOException- if writing fails
-