Package dev.frostlake.metastore.model
Class Database
java.lang.Object
dev.frostlake.metastore.SqlObject
dev.frostlake.metastore.model.Database
- All Implemented Interfaces:
Taggable
-
Field Summary
Fields inherited from class dev.frostlake.metastore.SqlObject
comment, createdTime, name, owner -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidClone this database with a new namecloneSchema(String sourceName, String targetName) Clone a schema within this databasecloneSchemaTo(String sourceName, Database targetDb, String targetName) Clone a schema from this database to another databasevoiddropSchema(String name, boolean cascade) Get the type of this SQL object (e.g., "TABLE", "VIEW", "DATABASE") Subclasses should override to provide their specific typeA schema by name, matched ignoring case — the INTERNAL Java API.booleanWhether a schema of this name exists, matched ignoring case — the questiongetSchema(java.lang.String)cannot answer, because it THROWS for a name that is not there rather than returning null.booleanbooleanschemaExact(String name) The schema a SQL reference names, matched EXACTLY — live answersSchema '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.voidsetDataRetentionTimeInDays(Integer dataRetentionTimeInDays) voidsetReadOnly(boolean readOnly) voidsetTransientObject(boolean value) Methods inherited from class dev.frostlake.metastore.SqlObject
equals, getComment, getCreatedTime, getName, getOwner, getTagValue, getTagValues, hashCode, rename, setComment, setName, setOwner, setTag, toString, unsetTag, withoutTrailingSemicolon
-
Constructor Details
-
Database
-
-
Method Details
-
getDataRetentionTimeInDays
-
setDataRetentionTimeInDays
-
isTransientObject
public boolean isTransientObject() -
setTransientObject
public void setTransientObject(boolean value) -
addSchema
-
dropSchema
-
hasSchema
Whether a schema of this name exists, matched ignoring case — the questiongetSchema(java.lang.String)cannot answer, because it THROWS for a name that is not there rather than returning null. Two callers were written asgetSchema("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
A schema by name, matched ignoring case — the INTERNAL Java API. SQL resolution goes throughschemaExact(java.lang.String). -
schemaExact
The schema a SQL reference names, matched EXACTLY — live answersSchema '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
-
clone
Clone this database with a new name -
cloneSchema
Clone a schema within this database -
cloneSchemaTo
Clone a schema from this database to another database -
isReadOnly
public boolean isReadOnly() -
setReadOnly
public void setReadOnly(boolean readOnly) -
getObjectType
Description copied from class:SqlObjectGet the type of this SQL object (e.g., "TABLE", "VIEW", "DATABASE") Subclasses should override to provide their specific type- Specified by:
getObjectTypein classSqlObject- Returns:
- The object type as a string
-