Delete Table
Permanently delete a table and all its data using the client.tables.delete()
method. This is a destructive operation that cannot be undone, so use it with extreme caution.
⚠️ PERMANENT DELETION WARNING
Deleting a table permanently removes:
- The table structure and schema
- ALL records and data in the table
- Column definitions and constraints
- Any associated indexes and metadata
This operation cannot be undone. Ensure you have backups before proceeding.
Method Signature
client.tables.delete(name: string): Promise<ApiResponse<{ deletedCount: number }>>
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
name | string | ✅ | Name of the table to delete |
Return Value
interface DeleteTableResponse {
message: string;
}
Example
import { createClient } from "@boltic/sdk";
const client = createClient("your-api-key");
const { data: result, error } = await client.tables.delete("old_products");
if (error) {
console.error("Failed to delete table:", error.message);
} else {
console.log(`Table deleted successfully. ${result.deletedCount} records were removed.`);
}