Databases
The database data object represents a Parquet-format database in the platform. In Spark SQL, you can use either the shorter databaseName or the longer uniqueDatabaseName for cases with potential duplicates. You can store additional database metadata in properties.
Database API Method Specifications
API method: /database-xxxx/describe
/database-xxxx/describeSpecification
Describes a database data object. A project ID can be given to request user-provided metadata from a particular project but it is not necessary as database data object belongs only to one project always. Cloning of database data object is suppressed. A relocate method is available for moving a database data object from one project to another.
Inputs
projectstring (optional) Project or container ID to be used as a hint for finding the object in an accessible project.defaultFieldsboolean (optional) Whether to include the default set of fields in the output (the default fields are described in the "Outputs" section below). The selections are overridden by any fields explicitly named infields.Defaults to
falseiffieldsis supplied,trueotherwise.
fieldsmapping (optional) Include or exclude the specified fields from the output. These selections override the settings indefaultFields.key — the desired output field. See "Outputs" below for valid values.
value boolean — whether to include the field.
The following options are deprecated (and are not respected if fields is present):
propertiesboolean (optional, deprecated) Whether the properties should be returned. Defaults tofalse.detailsboolean (optional, deprecated) Whether the details should also be returned. Defaults tofalse.
Outputs
idstring The object ID, such as "database-xxxx".
The following fields are included by default (but can be disabled using fields or defaultFields):
projectstring ID of the project or container in which the object was found.classstring The value "database".databaseNamestring The suffix ofuniqueDatabaseNameused for referencing a Parquet-format database. If a user has access to multiple databases with the samedatabaseName, the user has to reference the Parquet-format database byuniqueDatabaseName.uniqueDatabaseNamestring The Parquet-format database name.typesarray of strings Types associated with the object.createdtimestamp Time at which this object was created.statestring Always "open".hiddenboolean Whether the object is hidden or not.linksarray of strings The object IDs that are pointed to from this object.namestring The name of the database data object. Thenameof the object can be different fromdatabaseName.folderstring The full path to the folder containing the object.sponsoredboolean Whether the object is sponsored by DNAnexus.tagsarray of strings Tags associated with the object.modifiedtimestamp Time at which the user-provided metadata of the object was last modified.createdBymapping How the object was created.userstring ID of the user who created the object or launched an execution which created the object.jobstring ID of the job that created the object.Only present when a job created the object.
executablestring ID of the app or applet that the job was running.Only present when a job created the object.
The following field (included by default) is available if the object is sponsored by a third party:
sponsoredUntiltimestamp Indicates the expiration time of data sponsorship. This field exists only for sponsored objects and specifies a future timestamp.
The following fields are only returned if the corresponding field in the fields input is set to true:
propertiesmapping Properties associated with the object.key — the property name.
value string — the property value.
detailsmapping or array Contents of the object's details.
Errors
ResourceNotFound
The specified object does not exist or the specified
projectdoes not exist
InvalidInput
The input is not a hash,
project(if supplied) is not a string
PermissionDenied
VIEW access required for the
projectprovided (if any), and VIEW access required for some project containing the specified object (not necessarily the same as the hint provided)
API method: /database-xxxx/relocate
/database-xxxx/relocateSpecification
Moves the database data object from the current project to the specified project. You may not move a database to another project which already contains a database with the same database name.
Inputs
projectstring (required) ID of the project to which the database should be relocated, such as "project-xxxx".destinationstring (optional) The destination folder inproject. Defaults to"/".parentsboolean (optional) Whether the destination folder and/or parent folders should be created if they do not exist. Defaults tofalse.
Outputs
idstring ID of the moved database object, such as "database-xxxx".projectstring ID of the modified destination project.
Errors
ResourceNotFound
The specified database does not exist
The project specified in
projectdoes not existThe folder specified in
destinationdoes not exist in the destination project andparentsis set to falseThe source or destination project is not accessible for specified action due to missing license
InvalidInput
projectis missing, is not a project ID or is the same as source projectdestination(if provided) is not a nonempty string starting with "/"parents(if provided) is not a booleanprojectmust be in the same region as the source projectA database with the same
databaseNamealready exists in the target project
PermissionDenied
CONTRIBUTE/ADMINISTER access is required, depending on PROTECTED flag on the source project
UPLOAD access is required in the destination project
Last updated
Was this helpful?