Package org.pgcodekeeper.core
Class WorkDirs
java.lang.Object
org.pgcodekeeper.core.WorkDirs
Provides directory structure definitions and path resolution utilities
for different database types (PostgreSQL, Microsoft SQL, ClickHouse).
Manages the organization of database objects in filesystem directories.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetDirectoryNameForType(DatabaseType databaseType, DbObjType type) Gets the directory name for a specific database object typegetDirectoryNames(DatabaseType databaseType) Gets the list of top-level directory names for the specified database typeGets the loading order for PostgreSQL object typesstatic PathgetRelativeFolderPath(PgStatement st, Path baseDir) Gets the relative filesystem path for a database statementstatic booleanisInMsSchema(String dirSub) Checks if a Microsoft SQL Server subdirectory belongs to a schema
-
Field Details
-
OVERRIDES
- See Also:
-
PG_SCHEMA
-
MS_SECURITY
- See Also:
-
MS_SCHEMAS
- See Also:
-
MS_USERS
- See Also:
-
MS_ROLES
- See Also:
-
CH_DATABASE
-
-
Method Details
-
getDirectoryNames
Gets the list of top-level directory names for the specified database type- Parameters:
databaseType- the database type (PG, MS, or CH)- Returns:
- list of directory names
-
getDirectoryNameForType
Gets the directory name for a specific database object type- Parameters:
databaseType- the database typetype- the database object type- Returns:
- directory name for the object type, or null if the object type doesn't have a dedicated directory
- Throws:
IllegalStateException- if the object type is not supported
-
getRelativeFolderPath
Gets the relative filesystem path for a database statement- Parameters:
st- the database statementbaseDir- the base directory path- Returns:
- relative path where the statement should be stored
- Throws:
IllegalStateException- if the object type is not supported
-
isInMsSchema
Checks if a Microsoft SQL Server subdirectory belongs to a schema- Parameters:
dirSub- the subdirectory name- Returns:
- true if the directory is schema-related, false otherwise
-
getDirLoadOrder
Gets the loading order for PostgreSQL object types- Returns:
- set of database object types in loading order
-