mirror of
https://github.com/supabase/supabase.git
synced 2026-10-07 02:15:05 +03:00
The following changes were done: - Add responses for subscribe.mdx, post.mdx, patch.mdx, delete.mdx, stored-procedures.mdx. - Clean up of repeated information.
100 lines
1.6 KiB
Plaintext
100 lines
1.6 KiB
Plaintext
---
|
|
id: patch
|
|
title: 'Updating'
|
|
description: 'How to update records in your database with Supabase'
|
|
---
|
|
|
|
|
|
import DummyData from '../common/DummyData.mdx'
|
|
import Collapsable from '../../src/components/Collapsable'
|
|
import CommonResponses from '../common/CommonResponses.mdx'
|
|
import CommonFilters from '../common/CommonFilters'
|
|
import FromFunction from '../common/FromFunction.mdx'
|
|
import CustomCodeBlock from '../../src/components/CustomCodeBlock'
|
|
import { patchRecordJs } from './getExamples'
|
|
|
|
<DummyData />
|
|
|
|
### Update record
|
|
|
|
<CustomCodeBlock
|
|
header="Updates information about a city."
|
|
js={patchRecordJs}
|
|
jsHighlight="{7-10}"
|
|
response={`{
|
|
"body": null,
|
|
"status": 204,
|
|
"statusCode": 204,
|
|
"statusText": "No Content"
|
|
}`}
|
|
/>
|
|
|
|
## Reference
|
|
|
|
### `from()`
|
|
<FromFunction verb='patch' />
|
|
|
|
### `update()`
|
|
```js {3}
|
|
supabase
|
|
.from(tableName)
|
|
.udpate(data, options?)
|
|
```
|
|
|
|
#### `data: object`
|
|
New record values.
|
|
|
|
#### `options: object?`
|
|
|
|
```js
|
|
const options = {
|
|
bulk: false // Protects against bulk updates. Set to true if you intend to perform a bulk change.
|
|
}
|
|
```
|
|
|
|
----
|
|
|
|
## Filtering
|
|
|
|
### `filter()`
|
|
<CommonFilters filter='filter'/>
|
|
|
|
### `match()`
|
|
<CommonFilters filter='match'/>
|
|
|
|
### `eq()`
|
|
<CommonFilters filter='eq'/>
|
|
|
|
### `gt()`
|
|
<CommonFilters filter='gt'/>
|
|
|
|
### `lt()`
|
|
<CommonFilters filter='lt'/>
|
|
|
|
### `gte()`
|
|
<CommonFilters filter='gte'/>
|
|
|
|
### `lte()`
|
|
<CommonFilters filter='lte'/>
|
|
|
|
### `like()`
|
|
<CommonFilters filter='like'/>
|
|
|
|
### `ilike()`
|
|
<CommonFilters filter='ilike'/>
|
|
|
|
### `is()`
|
|
<CommonFilters filter='is'/>
|
|
|
|
### `in()`
|
|
<CommonFilters filter='in'/>
|
|
|
|
### `not()`
|
|
<CommonFilters filter='not'/>
|
|
|
|
## Responses
|
|
|
|
#### 200 OK
|
|
Successful
|
|
|
|
<CommonResponses /> |