> For the complete documentation index, see [llms.txt](https://trillo.gitbook.io/trillo-workbench-python-sdk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://trillo.gitbook.io/trillo-workbench-python-sdk/database/delete-apis.md).

# Delete APIs

## delete

Delete a record from the table. It can be made permanent or temporary.​ A delete flag is updated when it is handled as temporary.

```
DSApi.delete(className, id, permanent)

or

DSApi.delete(className, id, permanent, auditMsg)
```

**Parameters**

```
className: the str name of the table
id:        the record number as str
permanent:   permanent or temporary. a boolean
auditMsg:    any message as str
```

**Sample Code**

```python
className = "shared.common.product"
permanent = True
id = "12"

res = DSApi.delete(className, id, permanent)
```

**Returns**

```
A Result object indicating the success or failure of the deletion operation.
```

## deleteMany

Delete many records at a time. The list is provided which represents the record numbers​.

```
DSApi.deleteMany(className, ids, boolean permanent)

or

DSApi.deleteMany(String className, Iterable<String> ids, boolean permanent, String auditMsg)
```

**Parameters**

```
className: the str name of the table
ids:        list of the regards
permanent:   either flagged or permanent. a boolean
auditMsg:    any message as str
```

**Sample Code**

```python
className = "shared.common.product"
permanent = True
ids = ["12", "13"]

res = DSApi.deleteMany(className, ids, permanent)
```

**Returns**

```
A Result object indicating the success or failure of the deletion operation.
```

## deleteByQuery

Delete a record (s) by executing a query. ​

```
DSApi.deleteByQuery (className, query, permanent)

or

DSApi.deleteByQuery(className, query, permanent, auditMsg)
```

Parameters

```
className: str name of the table
query:     query as str
permanent: flagged or permanent as boolean
```

**Sample Code**

```python
className = "shared.common.product"
permanent = True
query = "Select first_name from product_tbl where price>100"

res = DSApi.deleteByQuery(className, query, permanent)
```

**Returns**

```
A Result object indicating the success or failure of the deletion operation.
```
