Class Database

java.lang.Object
dev.frostlake.metastore.SqlObject
dev.frostlake.metastore.model.Database
All Implemented Interfaces:
Taggable

public class Database extends SqlObject
  • Constructor Details

    • Database

      public Database(String name)
  • Method Details

    • getDataRetentionTimeInDays

      public Integer getDataRetentionTimeInDays()
    • setDataRetentionTimeInDays

      public void setDataRetentionTimeInDays(Integer dataRetentionTimeInDays)
    • isTransientObject

      public boolean isTransientObject()
    • setTransientObject

      public void setTransientObject(boolean value)
    • addSchema

      public void addSchema(Schema schema)
    • dropSchema

      public void dropSchema(String name, boolean cascade)
    • hasSchema

      public boolean hasSchema(String name)
      Whether a schema of this name exists, matched ignoring case — the question getSchema(java.lang.String) cannot answer, because it THROWS for a name that is not there rather than returning null. Two callers were written as getSchema("PUBLIC") != null, which reads like a check and is one only for databases that happen to have a PUBLIC.
      Parameters:
      name - the schema name
      Returns:
      whether it exists
    • getSchema

      public Schema getSchema(String name)
      A schema by name, matched ignoring case — the INTERNAL Java API. SQL resolution goes through schemaExact(java.lang.String).
    • schemaExact

      public Schema schemaExact(String name)
      The schema a SQL reference names, matched EXACTLY — live answers Schema 'DB.MIXEDSCH' does not exist or not authorized. for an unquoted reference to a schema created as "mixedSch", echoing each qualifier as the reference resolved it.
    • getAllSchemas

      public List<Schema> getAllSchemas()
    • clone

      public Database clone(String newName)
      Clone this database with a new name
    • cloneSchema

      public Schema cloneSchema(String sourceName, String targetName)
      Clone a schema within this database
    • cloneSchemaTo

      public Schema cloneSchemaTo(String sourceName, Database targetDb, String targetName)
      Clone a schema from this database to another database
    • isReadOnly

      public boolean isReadOnly()
    • setReadOnly

      public void setReadOnly(boolean readOnly)
    • getObjectType

      public String getObjectType()
      Description copied from class: SqlObject
      Get the type of this SQL object (e.g., "TABLE", "VIEW", "DATABASE") Subclasses should override to provide their specific type
      Specified by:
      getObjectType in class SqlObject
      Returns:
      The object type as a string