deleteDatabase method

Future<void> deleteDatabase({
  1. required String name,
  2. String? catalogId,
})

Removes a specified database from a Data Catalog.

To ensure the immediate deletion of all related resources, before calling DeleteDatabase, use DeleteTableVersion or BatchDeleteTableVersion, DeletePartition or BatchDeletePartition, DeleteUserDefinedFunction, and DeleteTable or BatchDeleteTable, to delete any resources that belong to the database.

May throw ConcurrentModificationException. May throw EntityNotFoundException. May throw FederationSourceException. May throw FederationSourceRetryableException. May throw InternalServiceException. May throw InvalidInputException. May throw OperationTimeoutException.

Parameter name : The name of the database to delete. For Hive compatibility, this must be all lowercase.

Parameter catalogId : The ID of the Data Catalog in which the database resides. If none is provided, the Amazon Web Services account ID is used by default.

Implementation

Future<void> deleteDatabase({
  required String name,
  String? catalogId,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSGlue.DeleteDatabase'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Name': name,
      if (catalogId != null) 'CatalogId': catalogId,
    },
  );
}