updateDatabase method

Future<void> updateDatabase({
  1. required DatabaseInput databaseInput,
  2. required String name,
  3. String? catalogId,
})

Updates an existing database definition in a Data Catalog.

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

Parameter databaseInput : A DatabaseInput object specifying the new definition of the metadata database in the catalog.

Parameter name : The name of the database to update in the catalog. For Hive compatibility, this is folded to lowercase.

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

Implementation

Future<void> updateDatabase({
  required DatabaseInput databaseInput,
  required String name,
  String? catalogId,
}) async {
  ArgumentError.checkNotNull(databaseInput, 'databaseInput');
  ArgumentError.checkNotNull(name, 'name');
  _s.validateStringLength(
    'name',
    name,
    1,
    255,
    isRequired: true,
  );
  _s.validateStringLength(
    'catalogId',
    catalogId,
    1,
    255,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSGlue.UpdateDatabase'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'DatabaseInput': databaseInput,
      'Name': name,
      if (catalogId != null) 'CatalogId': catalogId,
    },
  );
}