getDatabase method

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

Retrieves the definition of a specified database.

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

Parameter name : The name of the database to retrieve. For Hive compatibility, this should 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<GetDatabaseResponse> getDatabase({
  required String name,
  String? catalogId,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSGlue.GetDatabase'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Name': name,
      if (catalogId != null) 'CatalogId': catalogId,
    },
  );

  return GetDatabaseResponse.fromJson(jsonResponse.body);
}