Skip to main content

databases

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

Overview

Namedatabases
TypeResource
Idazure.maria_db.databases

Fields

NameDatatypeDescription
charsettextfield from the properties object
collationtextfield from the properties object
databaseNametextfield from the properties object
resourceGroupNametextfield from the properties object
serverNametextfield from the properties object
subscriptionIdtextfield from the properties object

Methods

NameAccessible byRequired ParamsDescription
getSELECTdatabaseName, resourceGroupName, serverName, subscriptionIdGets information about a database.
list_by_serverSELECTresourceGroupName, serverName, subscriptionIdList all the databases in a given server.
create_or_updateINSERTdatabaseName, resourceGroupName, serverName, subscriptionIdCreates a new database or updates an existing database.
deleteDELETEdatabaseName, resourceGroupName, serverName, subscriptionIdDeletes a database.

SELECT examples

List all the databases in a given server.

SELECT
charset,
collation,
databaseName,
resourceGroupName,
serverName,
subscriptionId
FROM azure.maria_db.vw_databases
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND serverName = '{{ serverName }}'
AND subscriptionId = '{{ subscriptionId }}';

INSERT example

Use the following StackQL query and manifest file to create a new databases resource.

/*+ create */
INSERT INTO azure.maria_db.databases (
databaseName,
resourceGroupName,
serverName,
subscriptionId,
properties
)
SELECT
'{{ databaseName }}',
'{{ resourceGroupName }}',
'{{ serverName }}',
'{{ subscriptionId }}',
'{{ properties }}'
;

DELETE example

Deletes the specified databases resource.

/*+ delete */
DELETE FROM azure.maria_db.databases
WHERE databaseName = '{{ databaseName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND serverName = '{{ serverName }}'
AND subscriptionId = '{{ subscriptionId }}';