Skip to main content

databases

Creates, updates, deletes, gets or lists a databases resource.

Overview

Namedatabases
TypeResource
Idgoogle.biglake.databases

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringOutput only. The resource name. Format: projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_id}/databases/{database_id}
createTimestring (google-datetime)Output only. The creation time of the database.
deleteTimestring (google-datetime)Output only. The deletion time of the database. Only set after the database is deleted.
expireTimestring (google-datetime)Output only. The time when this database is considered expired. Only set after the database is deleted.
hiveOptionsobjectOptions of a Hive database. (id: HiveDatabaseOptions)
typestringThe database type.
updateTimestring (google-datetime)Output only. The last modification time of the database.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, catalogsId, databasesIdGets the database specified by the resource name.
listselectprojectsId, locationsId, catalogsIdpageSize, pageTokenList all databases in a specified catalog.
createinsertprojectsId, locationsId, catalogsIddatabaseIdCreates a new database.
patchupdateprojectsId, locationsId, catalogsId, databasesIdupdateMaskUpdates an existing database specified by the database ID.
deletedeleteprojectsId, locationsId, catalogsId, databasesIdDeletes an existing database specified by the database ID.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
catalogsIdstring
databasesIdstring
locationsIdstring
projectsIdstring
databaseIdstring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)

SELECT examples

Gets the database specified by the resource name.

SELECT
name,
createTime,
deleteTime,
expireTime,
hiveOptions,
type,
updateTime
FROM google.biglake.databases
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND catalogsId = '{{ catalogsId }}' -- required
AND databasesId = '{{ databasesId }}' -- required;

INSERT examples

Creates a new database.

INSERT INTO google.biglake.databases (
data__hiveOptions,
data__type,
projectsId,
locationsId,
catalogsId,
databaseId
)
SELECT
'{{ hiveOptions }}',
'{{ type }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ catalogsId }}',
'{{ databaseId }}'
RETURNING
name,
createTime,
deleteTime,
expireTime,
hiveOptions,
type,
updateTime
;

UPDATE examples

Updates an existing database specified by the database ID.

UPDATE google.biglake.databases
SET
data__hiveOptions = '{{ hiveOptions }}',
data__type = '{{ type }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND catalogsId = '{{ catalogsId }}' --required
AND databasesId = '{{ databasesId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
createTime,
deleteTime,
expireTime,
hiveOptions,
type,
updateTime;

DELETE examples

Deletes an existing database specified by the database ID.

DELETE FROM google.biglake.databases
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND catalogsId = '{{ catalogsId }}' --required
AND databasesId = '{{ databasesId }}' --required;