Package org.pgcodekeeper.core.settings
Class CoreSettings
java.lang.Object
org.pgcodekeeper.core.settings.CoreSettings
- All Implemented Interfaces:
ISettings
Core implementation of settings interface for database comparison and migration.
Provides default implementations for all configuration options including database type,
character encoding, file paths, and various migration behavior flags.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()Creates a copy of this settings instance.Gets the collection of allowed database object types for processing.Get the cluster name for ClickHouseGets the format configuration for code formatting.Gets the input character encoding name.Gets the collection of post-processing file paths.Gets the collection of pre-processing file paths.Gets the time zone setting.booleanChecks if migration scripts should be wrapped in transactions.booleanChecks if object code should be automatically formatted.booleanChecks if comments should be moved to the end of generated scripts.booleanChecks if concurrent mode is enabled.booleanChecks if data movement mode is enabled for migrations.booleanChecks whether automatic loading of project auxiliary files should be disabledbooleanChecks if function body checking should be disabled.booleanChecks if objects should be dropped before creating in migrations.booleanChecks if function body dependencies analysis is enabled.booleanChecks if constraints should be generated with NOT VALID option.booleanChecks if existence check DO blocks should be generated.booleanChecks if existence checks should be generated in migration scripts.booleanChecks if column order should be ignored during comparison.booleanChecks if concurrent modifications should be ignored.booleanChecks if privileges should be ignored during comparison.booleanChecks if newlines should be preserved in generated SQL.booleanReturns the parallel load flag that controls how databases are loaded during comparison.booleanChecks if USING clauses should be printed in generated SQL.booleanChecks if only selected objects should be processed.booleanChecks if view definitions should be simplified.booleanChecks if migration should stop when encountering not-allowed operations.booleanReturn flag to use correct migration script syntaxvoidsetActualVersionSyntax(boolean isUseActualVersionSyntax) voidsetAddTransaction(boolean addTransaction) voidsetAllowedTypes(List<DbObjType> allowedTypes) voidsetAutoFormatObjectCode(boolean isAutoFormatObjectCode) voidsetClusterName(String clusterName) voidsetCommentsToEnd(boolean commentsToEnd) voidsetConcurrentlyMode(boolean concurrentlyMode) voidsetDataMovementMode(boolean dataMovementMode) voidsetDisableAutoLoad(boolean disableAutoLoad) voidsetDisableCheckFunctionBodies(boolean disableCheckFunctionBodies) voidsetDropBeforeCreate(boolean dropBeforeCreate) voidsetEnableFunctionBodiesDependencies(boolean enableFunctionBodiesDependencies) voidsetFormatConfiguration(IFormatConfiguration formatConfiguration) voidsetGenerateConstraintNotValid(boolean generateConstraintNotValid) voidsetGenerateExistDoBlock(boolean generateExistDoBlock) voidsetGenerateExists(boolean generateExists) voidsetIgnoreColumnOrder(boolean ignoreColumnOrder) voidsetIgnoreConcurrentModification(boolean ignoreConcurrentModification) voidsetIgnorePrivileges(boolean ignorePrivileges) Sets whether privileges should be ignored during comparison.voidsetInCharsetName(String inCharsetName) voidsetKeepNewlines(boolean keepNewlines) voidsetParallelLoad(boolean parallelLoad) voidsetPostFilePath(List<String> postFilePath) voidsetPreFilePath(List<String> preFilePath) voidsetPrintUsing(boolean printUsing) voidsetSelectedOnly(boolean selectedOnly) voidsetSimplifyView(boolean simplifyView) voidsetStopNotAllowed(boolean stopNotAllowed) voidsetTimeZone(String timeZone)
-
Constructor Details
-
CoreSettings
public CoreSettings()
-
-
Method Details
-
isConcurrentlyMode
public boolean isConcurrentlyMode()Description copied from interface:ISettingsChecks if concurrent mode is enabled.- Specified by:
isConcurrentlyModein interfaceISettings- Returns:
- true if concurrent mode is enabled
-
setConcurrentlyMode
public void setConcurrentlyMode(boolean concurrentlyMode) -
isAddTransaction
public boolean isAddTransaction()Description copied from interface:ISettingsChecks if migration scripts should be wrapped in transactions.- Specified by:
isAddTransactionin interfaceISettings- Returns:
- true if transaction wrapping is enabled
-
setAddTransaction
public void setAddTransaction(boolean addTransaction) -
isGenerateExists
public boolean isGenerateExists()Description copied from interface:ISettingsChecks if existence checks should be generated in migration scripts.- Specified by:
isGenerateExistsin interfaceISettings- Returns:
- true if existence checks are enabled
-
setGenerateExists
public void setGenerateExists(boolean generateExists) -
isGenerateConstraintNotValid
public boolean isGenerateConstraintNotValid()Description copied from interface:ISettingsChecks if constraints should be generated with NOT VALID option.- Specified by:
isGenerateConstraintNotValidin interfaceISettings- Returns:
- true if NOT VALID constraints are enabled
-
setGenerateConstraintNotValid
public void setGenerateConstraintNotValid(boolean generateConstraintNotValid) -
isGenerateExistDoBlock
public boolean isGenerateExistDoBlock()Description copied from interface:ISettingsChecks if existence check DO blocks should be generated.- Specified by:
isGenerateExistDoBlockin interfaceISettings- Returns:
- true if DO block generation is enabled
-
setGenerateExistDoBlock
public void setGenerateExistDoBlock(boolean generateExistDoBlock) -
isPrintUsing
public boolean isPrintUsing()Description copied from interface:ISettingsChecks if USING clauses should be printed in generated SQL.- Specified by:
isPrintUsingin interfaceISettings- Returns:
- true if USING clause printing is enabled
-
setPrintUsing
public void setPrintUsing(boolean printUsing) -
isKeepNewlines
public boolean isKeepNewlines()Description copied from interface:ISettingsChecks if newlines should be preserved in generated SQL.- Specified by:
isKeepNewlinesin interfaceISettings- Returns:
- true if newline preservation is enabled
-
setKeepNewlines
public void setKeepNewlines(boolean keepNewlines) -
isCommentsToEnd
public boolean isCommentsToEnd()Description copied from interface:ISettingsChecks if comments should be moved to the end of generated scripts.- Specified by:
isCommentsToEndin interfaceISettings- Returns:
- true if comments are moved to end
-
setCommentsToEnd
public void setCommentsToEnd(boolean commentsToEnd) -
isAutoFormatObjectCode
public boolean isAutoFormatObjectCode()Description copied from interface:ISettingsChecks if object code should be automatically formatted.- Specified by:
isAutoFormatObjectCodein interfaceISettings- Returns:
- true if auto-formatting is enabled
-
setAutoFormatObjectCode
public void setAutoFormatObjectCode(boolean isAutoFormatObjectCode) -
isIgnorePrivileges
public boolean isIgnorePrivileges()Description copied from interface:ISettingsChecks if privileges should be ignored during comparison.- Specified by:
isIgnorePrivilegesin interfaceISettings- Returns:
- true if privileges are ignored
-
setIgnorePrivileges
public void setIgnorePrivileges(boolean ignorePrivileges) Description copied from interface:ISettingsSets whether privileges should be ignored during comparison.- Specified by:
setIgnorePrivilegesin interfaceISettings- Parameters:
ignorePrivileges- true to ignore privileges
-
isIgnoreColumnOrder
public boolean isIgnoreColumnOrder()Description copied from interface:ISettingsChecks if column order should be ignored during comparison.- Specified by:
isIgnoreColumnOrderin interfaceISettings- Returns:
- true if column order is ignored
-
setIgnoreColumnOrder
public void setIgnoreColumnOrder(boolean ignoreColumnOrder) -
isEnableFunctionBodiesDependencies
public boolean isEnableFunctionBodiesDependencies()Description copied from interface:ISettingsChecks if function body dependencies analysis is enabled.- Specified by:
isEnableFunctionBodiesDependenciesin interfaceISettings- Returns:
- true if function body dependencies are enabled
-
setEnableFunctionBodiesDependencies
public void setEnableFunctionBodiesDependencies(boolean enableFunctionBodiesDependencies) -
isDataMovementMode
public boolean isDataMovementMode()Description copied from interface:ISettingsChecks if data movement mode is enabled for migrations.- Specified by:
isDataMovementModein interfaceISettings- Returns:
- true if data movement mode is enabled
-
setDataMovementMode
public void setDataMovementMode(boolean dataMovementMode) -
isDropBeforeCreate
public boolean isDropBeforeCreate()Description copied from interface:ISettingsChecks if objects should be dropped before creating in migrations.- Specified by:
isDropBeforeCreatein interfaceISettings- Returns:
- true if drop-before-create is enabled
-
setDropBeforeCreate
public void setDropBeforeCreate(boolean dropBeforeCreate) -
isStopNotAllowed
public boolean isStopNotAllowed()Description copied from interface:ISettingsChecks if migration should stop when encountering not-allowed operations.- Specified by:
isStopNotAllowedin interfaceISettings- Returns:
- true if stop-on-not-allowed is enabled
-
setStopNotAllowed
public void setStopNotAllowed(boolean stopNotAllowed) -
isSelectedOnly
public boolean isSelectedOnly()Description copied from interface:ISettingsChecks if only selected objects should be processed.- Specified by:
isSelectedOnlyin interfaceISettings- Returns:
- true if selected-only mode is enabled
-
setSelectedOnly
public void setSelectedOnly(boolean selectedOnly) -
isIgnoreConcurrentModification
public boolean isIgnoreConcurrentModification()Description copied from interface:ISettingsChecks if concurrent modifications should be ignored.- Specified by:
isIgnoreConcurrentModificationin interfaceISettings- Returns:
- true if concurrent modifications are ignored
-
setIgnoreConcurrentModification
public void setIgnoreConcurrentModification(boolean ignoreConcurrentModification) -
isSimplifyView
public boolean isSimplifyView()Description copied from interface:ISettingsChecks if view definitions should be simplified.- Specified by:
isSimplifyViewin interfaceISettings- Returns:
- true if view simplification is enabled
-
setSimplifyView
public void setSimplifyView(boolean simplifyView) -
isDisableCheckFunctionBodies
public boolean isDisableCheckFunctionBodies()Description copied from interface:ISettingsChecks if function body checking should be disabled.- Specified by:
isDisableCheckFunctionBodiesin interfaceISettings- Returns:
- true if function body checking is disabled
-
setDisableCheckFunctionBodies
public void setDisableCheckFunctionBodies(boolean disableCheckFunctionBodies) -
getInCharsetName
Description copied from interface:ISettingsGets the input character encoding name.- Specified by:
getInCharsetNamein interfaceISettings- Returns:
- the character encoding name
-
setInCharsetName
-
getTimeZone
Description copied from interface:ISettingsGets the time zone setting.- Specified by:
getTimeZonein interfaceISettings- Returns:
- the time zone string
-
setTimeZone
-
getFormatConfiguration
Description copied from interface:ISettingsGets the format configuration for code formatting.- Specified by:
getFormatConfigurationin interfaceISettings- Returns:
- the format configuration instance
-
setFormatConfiguration
-
getAllowedTypes
Description copied from interface:ISettingsGets the collection of allowed database object types for processing.- Specified by:
getAllowedTypesin interfaceISettings- Returns:
- collection of allowed object types
-
setAllowedTypes
-
getPreFilePath
Description copied from interface:ISettingsGets the collection of pre-processing file paths.- Specified by:
getPreFilePathin interfaceISettings- Returns:
- collection of pre-processing file paths
-
setPreFilePath
-
getPostFilePath
Description copied from interface:ISettingsGets the collection of post-processing file paths.- Specified by:
getPostFilePathin interfaceISettings- Returns:
- collection of post-processing file paths
-
setPostFilePath
-
setClusterName
-
getClusterName
Description copied from interface:ISettingsGet the cluster name for ClickHouse- Specified by:
getClusterNamein interfaceISettings- Returns:
- cluster name
-
setActualVersionSyntax
public void setActualVersionSyntax(boolean isUseActualVersionSyntax) -
isUseActualVersionSyntax
public boolean isUseActualVersionSyntax()Description copied from interface:ISettingsReturn flag to use correct migration script syntax- Specified by:
isUseActualVersionSyntaxin interfaceISettings- Returns:
- true to generate migration script with actual syntax
-
setParallelLoad
public void setParallelLoad(boolean parallelLoad) -
isParallelLoad
public boolean isParallelLoad()Description copied from interface:ISettingsReturns the parallel load flag that controls how databases are loaded during comparison.- Specified by:
isParallelLoadin interfaceISettings- Returns:
truefor parallel loading (faster, more resource-intensive),falsefor sequential loading (slower, fewer resources)
-
isDisableAutoLoad
public boolean isDisableAutoLoad()Description copied from interface:ISettingsChecks whether automatic loading of project auxiliary files should be disabled- Specified by:
isDisableAutoLoadin interfaceISettings- Returns:
- true if whether automatic loading of project auxiliary files should be disabled
-
setDisableAutoLoad
public void setDisableAutoLoad(boolean disableAutoLoad) -
copy
Description copied from interface:ISettingsCreates a copy of this settings instance.
-