delete
Permanently remove database records by ID, including connected relations and triggering deletion events. This irreversible operation also handles foreign key constraint validation.
Instructions
Delete a specific record from the database by its ID.
This tool permanently removes a record from the database. Use with caution as this operation cannot be undone. The deletion will also:
Remove any graph edges (relations) connected to this record
Trigger any defined deletion events/hooks
Fail if the record is referenced by FOREIGN KEY constraints
Args: thing: The full record ID to delete in format "table:id" (e.g., "user:john", "product:laptop-123")
Returns: A dictionary containing: - success: Boolean indicating if deletion was successful - deleted: The ID of the deleted record - data: The deleted record data (if available) - error: Error message if deletion failed (only present on failure)
Examples: >>> await delete("user:john") {"success": true, "deleted": "user:john", "data": {"id": "user:john", "name": "John Doe"}}
Note: This operation is irreversible. Consider using soft deletes (status fields) for recoverable deletions.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
thing | Yes |