deleteTable method

Future<DeleteTableOutput> deleteTable({
  1. required String tableName,
})

Deletes a table and all of its items.

If the table is in the ACTIVE state, you can delete it. If a table is in CREATING or UPDATING states then Amazon DynamoDB returns a ResourceInUseException. If the specified table does not exist, Amazon DynamoDB returns a ResourceNotFoundException.

May throw ResourceInUseException. May throw ResourceNotFoundException. May throw LimitExceededException. May throw InternalServerError.

Parameter tableName : The name of the table you want to delete. Allowed characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and . (period).

Implementation

Future<DeleteTableOutput> deleteTable({
  required String tableName,
}) async {
  ArgumentError.checkNotNull(tableName, 'tableName');
  _s.validateStringLength(
    'tableName',
    tableName,
    3,
    255,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'DynamoDB_20111205.DeleteTable'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'TableName': tableName,
    },
  );

  return DeleteTableOutput.fromJson(jsonResponse.body);
}