createDatabase method

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

Creates a new database in a Data Catalog.

May throw InvalidInputException. May throw AlreadyExistsException. May throw ResourceNumberLimitExceededException. May throw InternalServiceException. May throw OperationTimeoutException. May throw GlueEncryptionException.

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 AWS account ID is used by default.

Implementation

Future<void> createDatabase({
  required DatabaseInput databaseInput,
  String? catalogId,
}) async {
  ArgumentError.checkNotNull(databaseInput, 'databaseInput');
  _s.validateStringLength(
    'catalogId',
    catalogId,
    1,
    255,
  );
  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,
    },
  );
}