Package io.github.mfvanek.pg.model
Class PgContext
java.lang.Object
io.github.mfvanek.pg.model.PgContext
Represents a context for running maintenance queries.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Default bloat percentage threshold.static final String
-
Method Summary
Modifier and TypeMethodDescriptionenrichWithSchema
(String objectName) Complement the given object name with the specified schema name if it is necessary.int
Returns the specified bloat percentage threshold.Returns the specified schema name.boolean
Determines whether the specified schema is public or not.static PgContext
CreatesPgContext
for given schema with default bloat percentage threshold.static PgContext
CreatesPgContext
for given schema with given bloat percentage threshold.static PgContext
ofPublic()
CreatesPgContext
for public schema with default bloat percentage threshold.toString()
-
Field Details
-
DEFAULT_BLOAT_PERCENTAGE_THRESHOLD
public static final int DEFAULT_BLOAT_PERCENTAGE_THRESHOLDDefault bloat percentage threshold.- See Also:
-
DEFAULT_SCHEMA_NAME
- See Also:
-
-
Method Details
-
getSchemaName
Returns the specified schema name.- Returns:
- schema name
-
isDefaultSchema
public boolean isDefaultSchema()Determines whether the specified schema is public or not.- Returns:
- true if it is the public schema
-
getBloatPercentageThreshold
public int getBloatPercentageThreshold()Returns the specified bloat percentage threshold.- Returns:
- bloat percentage threshold
-
toString
-
enrichWithSchema
Complement the given object name with the specified schema name if it is necessary.- Parameters:
objectName
- given object name- Returns:
- object name with schema for non default schemas
-
of
CreatesPgContext
for given schema with given bloat percentage threshold.- Parameters:
schemaName
- given database schemabloatPercentageThreshold
- given bloat percentage threshold; should be greater or equals to zero- Returns:
PgContext
-
of
CreatesPgContext
for given schema with default bloat percentage threshold.- Parameters:
schemaName
- given database schema- Returns:
PgContext
- See Also:
-
ofPublic
CreatesPgContext
for public schema with default bloat percentage threshold.- Returns:
PgContext
- See Also:
-