databases
Creates, updates, deletes, gets or lists a databases
resource.
Overview
Name | databases |
Type | Resource |
Id | azure.maria_db.databases |
Fields
- vw_databases
- databases
Name | Datatype | Description |
---|---|---|
charset | text | field from the properties object |
collation | text | field from the properties object |
databaseName | text | field from the properties object |
resourceGroupName | text | field from the properties object |
serverName | text | field from the properties object |
subscriptionId | text | field from the properties object |
Name | Datatype | Description |
---|---|---|
properties | object | The properties of a database. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | databaseName, resourceGroupName, serverName, subscriptionId | Gets information about a database. |
list_by_server | SELECT | resourceGroupName, serverName, subscriptionId | List all the databases in a given server. |
create_or_update | INSERT | databaseName, resourceGroupName, serverName, subscriptionId | Creates a new database or updates an existing database. |
delete | DELETE | databaseName, resourceGroupName, serverName, subscriptionId | Deletes a database. |
SELECT
examples
List all the databases in a given server.
- vw_databases
- databases
SELECT
charset,
collation,
databaseName,
resourceGroupName,
serverName,
subscriptionId
FROM azure.maria_db.vw_databases
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND serverName = '{{ serverName }}'
AND subscriptionId = '{{ subscriptionId }}';
SELECT
properties
FROM azure.maria_db.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.
- All Properties
- Manifest
/*+ create */
INSERT INTO azure.maria_db.databases (
databaseName,
resourceGroupName,
serverName,
subscriptionId,
properties
)
SELECT
'{{ databaseName }}',
'{{ resourceGroupName }}',
'{{ serverName }}',
'{{ subscriptionId }}',
'{{ properties }}'
;
- name: your_resource_model_name
props:
- name: properties
value:
- name: charset
value: string
- name: collation
value: string
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 }}';