createDatabase method

Future<void> createDatabase({
  1. required DatabaseInput databaseInput,
  2. String? catalogId,
  3. Map<String, String>? tags,
})

Creates a new database in a Data Catalog.

May throw AlreadyExistsException. May throw ConcurrentModificationException. May throw FederatedResourceAlreadyExistsException. May throw FederationSourceException. May throw FederationSourceRetryableException. May throw GlueEncryptionException. May throw InternalServiceException. May throw InvalidInputException. May throw OperationTimeoutException. May throw ResourceNumberLimitExceededException.

Parameter databaseInput : The metadata for the database.

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

Parameter tags : The tags you assign to the database.

Implementation

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