databases
Creates, updates, deletes, gets or lists a databases
resource.
Overview
Name | databases |
Type | Resource |
Id | google.biglake.databases |
Fields
Name | Datatype | Description |
---|---|---|
name | string | Output only. The resource name. Format: projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_id}/databases/{database_id} |
createTime | string | Output only. The creation time of the database. |
deleteTime | string | Output only. The deletion time of the database. Only set after the database is deleted. |
expireTime | string | Output only. The time when this database is considered expired. Only set after the database is deleted. |
hiveOptions | object | Options of a Hive database. |
type | string | The database type. |
updateTime | string | Output only. The last modification time of the database. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | catalogsId, databasesId, locationsId, projectsId | Gets the database specified by the resource name. |
list | SELECT | catalogsId, locationsId, projectsId | List all databases in a specified catalog. |
create | INSERT | catalogsId, locationsId, projectsId | Creates a new database. |
delete | DELETE | catalogsId, databasesId, locationsId, projectsId | Deletes an existing database specified by the database ID. |
patch | UPDATE | catalogsId, databasesId, locationsId, projectsId | Updates an existing database specified by the database ID. |
SELECT
examples
List all databases in a specified catalog.
SELECT
name,
createTime,
deleteTime,
expireTime,
hiveOptions,
type,
updateTime
FROM google.biglake.databases
WHERE catalogsId = '{{ catalogsId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';
INSERT
example
Use the following StackQL query and manifest file to create a new databases
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO google.biglake.databases (
catalogsId,
locationsId,
projectsId,
hiveOptions,
type
)
SELECT
'{{ catalogsId }}',
'{{ locationsId }}',
'{{ projectsId }}',
'{{ hiveOptions }}',
'{{ type }}'
;
- name: your_resource_model_name
props:
- name: hiveOptions
value:
- name: locationUri
value: string
- name: parameters
value: object
- name: name
value: string
- name: createTime
value: string
- name: updateTime
value: string
- name: deleteTime
value: string
- name: expireTime
value: string
- name: type
value: string
UPDATE
example
Updates a databases
resource.
/*+ update */
UPDATE google.biglake.databases
SET
hiveOptions = '{{ hiveOptions }}',
type = '{{ type }}'
WHERE
catalogsId = '{{ catalogsId }}'
AND databasesId = '{{ databasesId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';
DELETE
example
Deletes the specified databases
resource.
/*+ delete */
DELETE FROM google.biglake.databases
WHERE catalogsId = '{{ catalogsId }}'
AND databasesId = '{{ databasesId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';