This topic describes how to delete a data table from an instance by using Tablestore SDK for PHP.
Usage notes
If a search index is created for a data table, you must delete the search index before you can delete the data table.
If a secondary index is created for a data table, the secondary index is automatically deleted when you delete the data table.
After a data table and its secondary indexes are deleted, they cannot be recovered. Proceed with caution.
Prerequisites
A client is initialized. For more information, see Initialize a Tablestore client.
Method description
public function deleteTable(array $request)Examples
The following sample code demonstrates how to delete a data table named test_table.
try{
$client->deleteTable(array (
'table_name' => 'test_table'
));
echo "Delete table succeeded.";
} catch (Exception $e) {
echo "Delete table failed.";
}