Deletes all records in a table, or a specific record, from the database.
Arguments
| Argument | Description |
|---|---|
resource
| The table name or a record ID to select. Will also accept a tuple of record name and ID. |
Example usage
Restrict records with .range()
For deletes targeting every record in a table, chain .range(...) so only record IDs inside the RecordIdKeyRange are removed.
Translated query
While SurrealQL's DELETE statement returns an empty array by default, this function translates into a query that adds a RETURN BEFORE clause to return the deleted items.