Skip to main content

backups

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

Overview

Namebackups
TypeResource
Iddeno.database.backups

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstring (uuid)The ID of the backup
statusThe status of a KV database backup.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_kv_backupsselectdatabaseIdThis API returns a list of backups of the specified KV database.

Note that currently more than one backups are not supported for a single
database. So this API will return either an empty list or a list with a
single item.
get_kv_backupselectdatabaseBackupIdThis API returns the details of the specified database backup.
enable_kv_backupexecdatabaseId, endpoint, bucketName, bucketRegion, accessKeyId, secretAccessKey, kindThis API allows you to enable a backup for a KV database. The backup can be
stored in your S3 bucket.

Currently, only one backup can be enabled per database. When a second backup
is being configured, the API will return a 409 Conflict error.
disable_kv_backupexecdatabaseBackupIdThis API allows you to disable a backup for a KV database.

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
databaseBackupIdstring (uuid)KV Backup ID
databaseIdstring (uuid)KV database ID

SELECT examples

This API returns a list of backups of the specified KV database.

Note that currently more than one backups are not supported for a single
database. So this API will return either an empty list or a list with a
single item.

SELECT
id,
status
FROM deno.database.backups
WHERE databaseId = '{{ databaseId }}' -- required
;

Lifecycle Methods

This API allows you to enable a backup for a KV database. The backup can be
stored in your S3 bucket.

Currently, only one backup can be enabled per database. When a second backup
is being configured, the API will return a 409 Conflict error.

EXEC deno.database.backups.enable_kv_backup 
@databaseId='{{ databaseId }}' --required
@@json=
'{
"endpoint": "{{ endpoint }}",
"bucketName": "{{ bucketName }}",
"bucketRegion": "{{ bucketRegion }}",
"accessKeyId": "{{ accessKeyId }}",
"secretAccessKey": "{{ secretAccessKey }}",
"prefix": "{{ prefix }}",
"kind": "{{ kind }}"
}'
;