Class PgContext

java.lang.Object
io.github.mfvanek.pg.model.PgContext

public class PgContext extends Object
Represents a context for running maintenance queries.
  • Field Details

    • DEFAULT_BLOAT_PERCENTAGE_THRESHOLD

      public static final int DEFAULT_BLOAT_PERCENTAGE_THRESHOLD
      Default bloat percentage threshold.
      See Also:
    • DEFAULT_SCHEMA_NAME

      public static final String DEFAULT_SCHEMA_NAME
      See Also:
  • Method Details

    • getSchemaName

      @Nonnull public String 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

      @Nonnull public String toString()
      Overrides:
      toString in class Object
    • enrichWithSchema

      @Nonnull public String enrichWithSchema(@Nonnull String objectName)
      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

      @Nonnull public static PgContext of(@Nonnull String schemaName, int bloatPercentageThreshold)
      Creates PgContext for given schema with given bloat percentage threshold.
      Parameters:
      schemaName - given database schema
      bloatPercentageThreshold - given bloat percentage threshold; should be greater or equals to zero
      Returns:
      PgContext
    • of

      @Nonnull public static PgContext of(@Nonnull String schemaName)
      Creates PgContext for given schema with default bloat percentage threshold.
      Parameters:
      schemaName - given database schema
      Returns:
      PgContext
      See Also:
    • ofPublic

      @Nonnull public static PgContext ofPublic()
      Creates PgContext for public schema with default bloat percentage threshold.
      Returns:
      PgContext
      See Also: