mirror of
https://github.com/supabase/supabase.git
synced 2026-10-08 10:55:06 +03:00
136 lines
2.1 KiB
Plaintext
136 lines
2.1 KiB
Plaintext
---
|
|
id: delete
|
|
title: "Delete data: delete()"
|
|
slug: delete
|
|
---
|
|
|
|
import Tabs from '@theme/Tabs';
|
|
import TabItem from '@theme/TabItem';
|
|
|
|
Performs a DELETE on the table.
|
|
|
|
<Tabs
|
|
defaultValue="js"
|
|
groupId="libraries"
|
|
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
|
|
|
<TabItem value="js">
|
|
|
|
```js
|
|
const { data, error } = await supabase
|
|
.from('cities')
|
|
.delete()
|
|
.match({ id: 666 })
|
|
```
|
|
|
|
|
|
</TabItem>
|
|
<TabItem value="py">
|
|
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
|
|
|
|
</TabItem>
|
|
|
|
</Tabs>
|
|
|
|
## Parameters
|
|
|
|
|
|
<ul className="method-list-group">
|
|
|
|
<li className="method-list-item">
|
|
<h4 className="method-list-item-label">
|
|
<span className="method-list-item-label-name">
|
|
__namedParameters
|
|
</span>
|
|
<span className="method-list-item-label-badge required">
|
|
required
|
|
</span>
|
|
<span className="method-list-item-validation">
|
|
<code>object</code>
|
|
</span>
|
|
</h4>
|
|
<div class="method-list-item-description">
|
|
|
|
No description provided.
|
|
|
|
</div>
|
|
|
|
<ul className="method-list-group">
|
|
<h5 class="method-list-title method-list-title-isChild expanded">Properties</h5>
|
|
|
|
<li className="method-list-item">
|
|
<h4 className="method-list-item-label">
|
|
<span className="method-list-item-label-name">
|
|
returning
|
|
</span>
|
|
<span className="method-list-item-label-badge required">
|
|
required
|
|
</span>
|
|
<span className="method-list-item-validation">
|
|
<code>minimal</code> | <code>representation</code>
|
|
</span>
|
|
</h4>
|
|
<div class="method-list-item-description">
|
|
|
|
If `true`, return the deleted row(s) in the response.
|
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
## Notes
|
|
|
|
- `delete()` should always be combined with [Filters](/docs/client/using-filters) to target the item(s) you wish to delete.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Examples
|
|
|
|
### Delete records
|
|
|
|
|
|
|
|
<Tabs
|
|
defaultValue="js"
|
|
groupId="libraries"
|
|
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
|
|
|
<TabItem value="js">
|
|
|
|
```js
|
|
const { data, error } = await supabase
|
|
.from('cities')
|
|
.delete()
|
|
.match({ id: 666 })
|
|
```
|
|
|
|
|
|
</TabItem>
|
|
<TabItem value="py">
|
|
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
|
|
|
|
</TabItem>
|
|
|
|
</Tabs> |