databases
Creates, updates, deletes, gets or lists a databases
resource.
Overview
Name | databases |
Type | Resource |
Id | azure.sql.databases |
Fields
- vw_databases
- databases
Name | Datatype | Description |
---|---|---|
auto_pause_delay | text | field from the properties object |
availability_zone | text | field from the properties object |
catalog_collation | text | field from the properties object |
collation | text | field from the properties object |
create_mode | text | field from the properties object |
creation_date | text | field from the properties object |
current_backup_storage_redundancy | text | field from the properties object |
current_service_objective_name | text | field from the properties object |
current_sku | text | field from the properties object |
databaseName | text | field from the properties object |
database_id | text | field from the properties object |
default_secondary_location | text | field from the properties object |
earliest_restore_date | text | field from the properties object |
elastic_pool_id | text | field from the properties object |
encryption_protector | text | field from the properties object |
encryption_protector_auto_rotation | text | field from the properties object |
failover_group_id | text | field from the properties object |
federated_client_id | text | field from the properties object |
free_limit_exhaustion_behavior | text | field from the properties object |
high_availability_replica_count | text | field from the properties object |
identity | text | Azure Active Directory identity configuration for a resource. |
is_infra_encryption_enabled | text | field from the properties object |
is_ledger_on | text | field from the properties object |
keys | text | field from the properties object |
kind | text | Kind of database. This is metadata used for the Azure portal experience. |
license_type | text | field from the properties object |
location | text | Resource location. |
long_term_retention_backup_resource_id | text | field from the properties object |
maintenance_configuration_id | text | field from the properties object |
managed_by | text | field from the properties object |
manual_cutover | text | field from the properties object |
max_log_size_bytes | text | field from the properties object |
max_size_bytes | text | field from the properties object |
min_capacity | text | field from the properties object |
paused_date | text | field from the properties object |
perform_cutover | text | field from the properties object |
preferred_enclave_type | text | field from the properties object |
read_scale | text | field from the properties object |
recoverable_database_id | text | field from the properties object |
recovery_services_recovery_point_id | text | field from the properties object |
requested_backup_storage_redundancy | text | field from the properties object |
requested_service_objective_name | text | field from the properties object |
resourceGroupName | text | field from the properties object |
restorable_dropped_database_id | text | field from the properties object |
restore_point_in_time | text | field from the properties object |
resumed_date | text | field from the properties object |
sample_name | text | field from the properties object |
secondary_type | text | field from the properties object |
serverName | text | field from the properties object |
sku | text | An ARM Resource SKU. |
source_database_deletion_date | text | field from the properties object |
source_database_id | text | field from the properties object |
source_resource_id | text | field from the properties object |
status | text | field from the properties object |
subscriptionId | text | field from the properties object |
tags | text | Resource tags. |
use_free_limit | text | field from the properties object |
zone_redundant | text | field from the properties object |
Name | Datatype | Description |
---|---|---|
identity | object | Azure Active Directory identity configuration for a resource. |
kind | string | Kind of database. This is metadata used for the Azure portal experience. |
location | string | Resource location. |
managedBy | string | Resource that manages the database. |
properties | object | The database's properties. |
sku | object | An ARM Resource SKU. |
tags | object | Resource tags. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | databaseName, resourceGroupName, serverName, subscriptionId | Gets a database. |
list_by_elastic_pool | SELECT | elasticPoolName, resourceGroupName, serverName, subscriptionId | Gets a list of databases in an elastic pool. |
list_by_server | SELECT | resourceGroupName, serverName, subscriptionId | Gets a list of databases. |
create_or_update | INSERT | databaseName, resourceGroupName, serverName, subscriptionId, data__location | Creates a new database or updates an existing database. |
delete | DELETE | databaseName, resourceGroupName, serverName, subscriptionId | Deletes the database. |
update | UPDATE | databaseName, resourceGroupName, serverName, subscriptionId | Updates an existing database. |
export | EXEC | databaseName, resourceGroupName, serverName, subscriptionId, data__administratorLogin, data__administratorLoginPassword, data__storageKey, data__storageKeyType, data__storageUri | Exports a database. |
failover | EXEC | databaseName, resourceGroupName, serverName, subscriptionId | Failovers a database. |
import | EXEC | databaseName, resourceGroupName, serverName, subscriptionId, data__administratorLogin, data__administratorLoginPassword, data__storageKey, data__storageKeyType, data__storageUri | Imports a bacpac into a new database. |
pause | EXEC | databaseName, resourceGroupName, serverName, subscriptionId | Pauses a database. |
rename | EXEC | databaseName, resourceGroupName, serverName, subscriptionId, data__id | Renames a database. |
resume | EXEC | databaseName, resourceGroupName, serverName, subscriptionId | Resumes a database. |
upgrade_data_warehouse | EXEC | databaseName, resourceGroupName, serverName, subscriptionId | Upgrades a data warehouse. |
SELECT
examples
Gets a list of databases.
- vw_databases
- databases
SELECT
auto_pause_delay,
availability_zone,
catalog_collation,
collation,
create_mode,
creation_date,
current_backup_storage_redundancy,
current_service_objective_name,
current_sku,
databaseName,
database_id,
default_secondary_location,
earliest_restore_date,
elastic_pool_id,
encryption_protector,
encryption_protector_auto_rotation,
failover_group_id,
federated_client_id,
free_limit_exhaustion_behavior,
high_availability_replica_count,
identity,
is_infra_encryption_enabled,
is_ledger_on,
keys,
kind,
license_type,
location,
long_term_retention_backup_resource_id,
maintenance_configuration_id,
managed_by,
manual_cutover,
max_log_size_bytes,
max_size_bytes,
min_capacity,
paused_date,
perform_cutover,
preferred_enclave_type,
read_scale,
recoverable_database_id,
recovery_services_recovery_point_id,
requested_backup_storage_redundancy,
requested_service_objective_name,
resourceGroupName,
restorable_dropped_database_id,
restore_point_in_time,
resumed_date,
sample_name,
secondary_type,
serverName,
sku,
source_database_deletion_date,
source_database_id,
source_resource_id,
status,
subscriptionId,
tags,
use_free_limit,
zone_redundant
FROM azure.sql.vw_databases
WHERE resourceGroupName = '{{ resourceGroupName }}'
AND serverName = '{{ serverName }}'
AND subscriptionId = '{{ subscriptionId }}';
SELECT
identity,
kind,
location,
managedBy,
properties,
sku,
tags
FROM azure.sql.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.sql.databases (
databaseName,
resourceGroupName,
serverName,
subscriptionId,
data__location,
location,
tags,
sku,
identity,
properties
)
SELECT
'{{ databaseName }}',
'{{ resourceGroupName }}',
'{{ serverName }}',
'{{ subscriptionId }}',
'{{ data__location }}',
'{{ location }}',
'{{ tags }}',
'{{ sku }}',
'{{ identity }}',
'{{ properties }}'
;
- name: your_resource_model_name
props:
- name: location
value: string
- name: tags
value: object
- name: sku
value:
- name: name
value: string
- name: tier
value: string
- name: size
value: string
- name: family
value: string
- name: capacity
value: integer
- name: kind
value: string
- name: managedBy
value: string
- name: identity
value:
- name: type
value: string
- name: tenantId
value: string
- name: userAssignedIdentities
value: object
- name: properties
value:
- name: createMode
value: string
- name: collation
value: string
- name: maxSizeBytes
value: integer
- name: sampleName
value: string
- name: elasticPoolId
value: string
- name: sourceDatabaseId
value: string
- name: status
value: string
- name: databaseId
value: string
- name: creationDate
value: string
- name: currentServiceObjectiveName
value: string
- name: requestedServiceObjectiveName
value: string
- name: defaultSecondaryLocation
value: string
- name: failoverGroupId
value: string
- name: restorePointInTime
value: string
- name: sourceDatabaseDeletionDate
value: string
- name: recoveryServicesRecoveryPointId
value: string
- name: longTermRetentionBackupResourceId
value: string
- name: recoverableDatabaseId
value: string
- name: restorableDroppedDatabaseId
value: string
- name: catalogCollation
value: string
- name: zoneRedundant
value: boolean
- name: licenseType
value: string
- name: maxLogSizeBytes
value: integer
- name: earliestRestoreDate
value: string
- name: readScale
value: string
- name: highAvailabilityReplicaCount
value: integer
- name: secondaryType
value: string
- name: autoPauseDelay
value: integer
- name: currentBackupStorageRedundancy
value: string
- name: requestedBackupStorageRedundancy
value: string
- name: minCapacity
value: number
- name: pausedDate
value: string
- name: resumedDate
value: string
- name: maintenanceConfigurationId
value: string
- name: isLedgerOn
value: boolean
- name: isInfraEncryptionEnabled
value: boolean
- name: federatedClientId
value: string
- name: keys
value: object
- name: encryptionProtector
value: string
- name: preferredEnclaveType
value: string
- name: useFreeLimit
value: boolean
- name: freeLimitExhaustionBehavior
value: string
- name: sourceResourceId
value: string
- name: manualCutover
value: boolean
- name: performCutover
value: boolean
- name: availabilityZone
value: string
- name: encryptionProtectorAutoRotation
value: boolean
UPDATE
example
Updates a databases
resource.
/*+ update */
UPDATE azure.sql.databases
SET
sku = '{{ sku }}',
identity = '{{ identity }}',
properties = '{{ properties }}',
tags = '{{ tags }}'
WHERE
databaseName = '{{ databaseName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND serverName = '{{ serverName }}'
AND subscriptionId = '{{ subscriptionId }}';
DELETE
example
Deletes the specified databases
resource.
/*+ delete */
DELETE FROM azure.sql.databases
WHERE databaseName = '{{ databaseName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND serverName = '{{ serverName }}'
AND subscriptionId = '{{ subscriptionId }}';