Skip to main content

kx_databases

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

Overview

Namekx_databases
TypeResource
Idaws.finspace.kx_databases

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
created_timestampstring (date-time)The timestamp at which the database is created in FinSpace. The value is determined as epoch time in milliseconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000000.
database_arnstringThe ARN identifier of the database.
database_namestringThe name of the kdb database for which the information is retrieved. (pattern: <code>^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$</code>)
descriptionstringA description of the database. (pattern: <code>^[a-zA-Z0-9. ]{1,1000}$</code>)
environment_idstringA unique identifier for the kdb environment. (pattern: <code>.\S.</code>)
last_completed_changeset_idstringA unique identifier for the changeset. (pattern: <code>^[a-zA-Z0-9]+$</code>)
last_modified_timestampstring (date-time)The last time that the database was modified. The value is determined as epoch time in milliseconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000000.
num_bytesinteger (int64)The total number of bytes in the database.
num_changesetsintegerThe total number of changesets in the database.
num_filesintegerThe total number of files in the database.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_kx_databaseselectenvironment_id, database_name, regionReturns database information for the specified environment ID.
list_kx_databasesselectenvironment_id, regionnextToken, maxResultsReturns a list of all the databases in the kdb environment.
create_kx_databaseinsertenvironment_id, region, databaseName, clientTokenCreates a new kdb database in the environment.
update_kx_databaseupdateenvironment_id, database_name, region, clientTokenUpdates information for the given kdb database.
delete_kx_databasedeleteenvironment_id, database_name, clientToken, regionDeletes the specified database and all of its associated data. This action is irreversible. You must copy any data out of the database before deleting it if the data is to be retained.

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
clientTokenstringA token that ensures idempotency. This token expires in 10 minutes.
database_namestringThe name of the kdb database that you want to delete.
environment_idstringA unique identifier for the kdb environment.
regionstringAWS region (default: us-east-1)
maxResultsintegerThe maximum number of results to return in this request.
nextTokenstringA token that indicates where a results page should begin.

SELECT examples

Returns database information for the specified environment ID.

SELECT
created_timestamp,
database_arn,
database_name,
description,
environment_id,
last_completed_changeset_id,
last_modified_timestamp,
num_bytes,
num_changesets,
num_files
FROM aws.finspace.kx_databases
WHERE environment_id = '{{ environment_id }}' -- required
AND database_name = '{{ database_name }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Creates a new kdb database in the environment.

INSERT INTO aws.finspace.kx_databases (
databaseName,
description,
tags,
clientToken,
environment_id,
region
)
SELECT
'{{ databaseName }}' /* required */,
'{{ description }}',
'{{ tags }}',
'{{ clientToken }}' /* required */,
'{{ environment_id }}',
'{{ region }}'
RETURNING
created_timestamp,
database_arn,
database_name,
description,
environment_id,
last_modified_timestamp
;

UPDATE examples

Updates information for the given kdb database.

UPDATE aws.finspace.kx_databases
SET
description = '{{ description }}',
clientToken = '{{ clientToken }}'
WHERE
environment_id = '{{ environment_id }}' --required
AND database_name = '{{ database_name }}' --required
AND region = '{{ region }}' --required
AND clientToken = '{{ clientToken }}' --required
RETURNING
database_name,
description,
environment_id,
last_modified_timestamp;

DELETE examples

Deletes the specified database and all of its associated data. This action is irreversible. You must copy any data out of the database before deleting it if the data is to be retained.

DELETE FROM aws.finspace.kx_databases
WHERE environment_id = '{{ environment_id }}' --required
AND database_name = '{{ database_name }}' --required
AND clientToken = '{{ clientToken }}' --required
AND region = '{{ region }}' --required
;