Delete data
Last updated
Was this helpful?
Last updated
Was this helpful?
You can delete a single resource using . This method deletes the resource specified and creates a history entry for the operation. The history entry created contains the entire deleted resource.
Note that Aidbox does not enforce referential integrity for DELETE
method.
Request:
Response:
This operation groups multiple REST API operations in a transaction. If all DELETE
operations are successful, the transaction with DELETE
requests is equivalent to calling DELETE
multiple times.
If you need to delete resource history, you need to execute SQL manually.
Example:
Or you can make a REST endpoint from SQL query using AidboxQuery.
Example:
And then run it with
You can use truncate
PostgreSQL statement to delete everything from the specified table.
Example:
Similarly you can create an endpoint for this
And then run it with
Note that AidboxQuery with variable resourceType
can only be called with _query
parameter.
In CI environments it is often desired to have same state at the beginning of each test suite. You can simply stop Aidbox, drop database, and start Aidbox again.
If you need to delete multiple resources, use with multiple DELETE
requests.
Use to set up fixtures. Note that you can use different Aidbox projects for each test suite (or different entrypoints).