Merge pull request #8852 from supabase/docs/postgrest-js

This commit is contained in:
Inian authored and GitHub committed 2022-09-20 20:56:20 +08:00
commit 844ebe676d
41 files changed
+6303 -5067

No files matched your search

@@ -8,8 +8,8 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
Finds all rows whose json, array, or range value on the stated `column` is
contained by the specified `value`.
Only relevant for jsonb, array, and range columns. Match only rows where
every element appearing in `column` is contained by `value`.
```js
const { data, error } = await supabase
@@ -36,7 +36,7 @@ const { data, error } = await supabase
</h4>
<div class="method-list-item-description">
The column to filter on.
The jsonb, array, or range column to filter on
</div>
@@ -56,7 +56,7 @@ The column to filter on.
</h4>
<div class="method-list-item-description">
The value to filter with.
The jsonb, array, or range value to filter with
</div>
@@ -8,8 +8,8 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
Finds all rows whose json, array, or range value on the stated `column`
contains the values specified in `value`.
Only relevant for jsonb, array, and range columns. Match only rows where
`column` contains every element appearing in `value`.
```js
const { data, error } = await supabase
@@ -36,7 +36,7 @@ const { data, error } = await supabase
</h4>
<div class="method-list-item-description">
The column to filter on.
The jsonb, array, or range column to filter on
</div>
@@ -56,7 +56,7 @@ The column to filter on.
</h4>
<div class="method-list-item-description">
The value to filter with.
The jsonb, array, or range value to filter with
</div>
@@ -8,7 +8,10 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
Performs a DELETE on the table.
Perform a DELETE on the table or view.
By default, deleted rows are not returned. To return it, chain the call
with `.select()` after filters.
```js
const { data, error } = await supabase
@@ -24,7 +27,7 @@ const { data, error } = await supabase
<li className="method-list-item">
<h4 className="method-list-item-label">
<span className="method-list-item-label-name">
__namedParameters
options
</span>
<span className="method-list-item-label-badge required">
required
@@ -35,7 +38,7 @@ const { data, error } = await supabase
</h4>
<div class="method-list-item-description">
No description provided.
Named parameters
</div>
@@ -56,7 +59,16 @@ No description provided.
</h4>
<div class="method-list-item-description">
Count algorithm to use to count rows in a table.
Count algorithm to use to count deleted rows.
`"exact"`: Exact but slow count algorithm. Performs a `COUNT(*)` under the
hood.
`"planned"`: Approximated but fast count algorithm. Uses the Postgres
statistics under the hood.
`"estimated"`: Uses exact count for low numbers and planned count for high
numbers.
</div>
@@ -127,26 +139,6 @@ No description provided.
</li>
<li className="method-list-item">
<h4 className="method-list-item-label">
<span className="method-list-item-label-name">
rollback
</span>
<span className="method-list-item-label-badge false">
optional
</span>
<span className="method-list-item-validation">
<code>boolean</code>
</span>
</h4>
<div class="method-list-item-description">
Rollback the operation
</div>
</li>
</ul>
</li>
+5 -4
View File
@@ -8,8 +8,9 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
Finds all rows whose value on the stated `column` exactly matches the
specified `value`.
Match only rows where `column` is equal to `value`.
To check if the value of `column` is NULL, you should use `.is()` instead.
```js
const { data, error } = await supabase
@@ -36,7 +37,7 @@ const { data, error } = await supabase
</h4>
<div class="method-list-item-description">
The column to filter on.
The column to filter on
</div>
@@ -56,7 +57,7 @@ The column to filter on.
</h4>
<div class="method-list-item-description">
The value to filter with.
The value to filter with
</div>
@@ -8,7 +8,13 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
Finds all rows whose `column` satisfies the filter.
Match only rows which satisfy the filter. This is an escape hatch - you
should use the specific filter methods wherever possible.
Unlike most filters, `opearator` and `value` are used as-is and need to
follow [PostgREST
syntax](https://postgrest.org/en/stable/api.html#operators). You also need
to make sure they are properly sanitized.
```js
const { data, error } = await supabase
@@ -35,7 +41,7 @@ const { data, error } = await supabase
</h4>
<div class="method-list-item-description">
The column to filter on.
The column to filter on
</div>
@@ -55,7 +61,7 @@ The column to filter on.
</h4>
<div class="method-list-item-description">
The operator to filter with.
The operator to filter with, following PostgREST syntax
</div>
@@ -540,7 +546,7 @@ No description provided.
</h4>
<div class="method-list-item-description">
The value to filter with.
The value to filter with, following PostgREST syntax
</div>
+3 -4
View File
@@ -8,8 +8,7 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
Finds all rows whose value on the stated `column` is greater than the
specified `value`.
Match only rows where `column` is greater than `value`.
```js
const { data, error } = await supabase
@@ -36,7 +35,7 @@ const { data, error } = await supabase
</h4>
<div class="method-list-item-description">
The column to filter on.
The column to filter on
</div>
@@ -56,7 +55,7 @@ The column to filter on.
</h4>
<div class="method-list-item-description">
The value to filter with.
The value to filter with
</div>
@@ -8,8 +8,7 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
Finds all rows whose value on the stated `column` is greater than or
equal to the specified `value`.
Match only rows where `column` is greater than or equal to `value`.
```js
const { data, error } = await supabase
@@ -36,7 +35,7 @@ const { data, error } = await supabase
</h4>
<div class="method-list-item-description">
The column to filter on.
The column to filter on
</div>
@@ -56,7 +55,7 @@ The column to filter on.
</h4>
<div class="method-list-item-description">
The value to filter with.
The value to filter with
</div>
@@ -8,8 +8,7 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
Finds all rows whose value in the stated `column` matches the supplied
`pattern` (case insensitive).
Match only rows where `column` matches `pattern` case-insensitively.
```js
const { data, error } = await supabase
@@ -36,7 +35,7 @@ const { data, error } = await supabase
</h4>
<div class="method-list-item-description">
The column to filter on.
The column to filter on
</div>
@@ -56,7 +55,7 @@ The column to filter on.
</h4>
<div class="method-list-item-description">
The pattern to filter with.
The pattern to match with
</div>
+3 -4
View File
@@ -8,8 +8,7 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
Finds all rows whose value on the stated `column` is found on the
specified `values`.
Match only rows where `column` is included in the `values` array.
```js
const { data, error } = await supabase
@@ -36,7 +35,7 @@ const { data, error } = await supabase
</h4>
<div class="method-list-item-description">
The column to filter on.
The column to filter on
</div>
@@ -56,7 +55,7 @@ The column to filter on.
</h4>
<div class="method-list-item-description">
The values to filter with.
The values array to filter with
</div>
@@ -2,7 +2,7 @@
id: index
title: 'Supabase Client'
slug: /supabase-client
custom_edit_url: ../../spec/supabase_js_v2_legacy.yml
custom_edit_url: ../supabase_js_v2_legacy.yml
---
import Tabs from '@theme/Tabs'
@@ -8,7 +8,10 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
Performs an INSERT into the table.
Perform an INSERT into the table or view.
By default, inserted rows are not returned. To return it, chain the call
with `.select()`.
```js
const { data, error } = await supabase
@@ -34,7 +37,8 @@ const { data, error } = await supabase
</h4>
<div class="method-list-item-description">
The values to insert.
The values to insert. Pass an object to insert a single row
or an array to insert multiple rows.
</div>
@@ -88,7 +92,7 @@ No description provided.
<li className="method-list-item">
<h4 className="method-list-item-label">
<span className="method-list-item-label-name">
__namedParameters
options
</span>
<span className="method-list-item-label-badge required">
required
@@ -99,7 +103,7 @@ No description provided.
</h4>
<div class="method-list-item-description">
No description provided.
Named parameters
</div>
@@ -120,7 +124,16 @@ No description provided.
</h4>
<div class="method-list-item-description">
Count algorithm to use to count rows in a table.
Count algorithm to use to count inserted rows.
`"exact"`: Exact but slow count algorithm. Performs a `COUNT(*)` under the
hood.
`"planned"`: Approximated but fast count algorithm. Uses the Postgres
statistics under the hood.
`"estimated"`: Uses exact count for low numbers and planned count for high
numbers.
</div>
@@ -191,26 +204,6 @@ No description provided.
</li>
<li className="method-list-item">
<h4 className="method-list-item-label">
<span className="method-list-item-label-name">
rollback
</span>
<span className="method-list-item-label-badge false">
optional
</span>
<span className="method-list-item-validation">
<code>boolean</code>
</span>
</h4>
<div class="method-list-item-description">
Rollback the operation
</div>
</li>
</ul>
</li>
+9 -4
View File
@@ -8,8 +8,13 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
A check for exact equality (null, true, false), finds all rows whose
value on the stated `column` exactly match the specified `value`.
Match only rows where `column` IS `value`.
For non-boolean columns, this is only relevant for checking if the value of
`column` is NULL by setting `value` to `null`.
For boolean columns, you can also set `value` to `true` or `false` and it
will behave the same way as `.eq()`.
```js
const { data, error } = await supabase
@@ -36,7 +41,7 @@ const { data, error } = await supabase
</h4>
<div class="method-list-item-description">
The column to filter on.
The column to filter on
</div>
@@ -56,7 +61,7 @@ The column to filter on.
</h4>
<div class="method-list-item-description">
The value to filter with.
The value to filter with
</div>
@@ -8,8 +8,7 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
Finds all rows whose value in the stated `column` matches the supplied
`pattern` (case sensitive).
Match only rows where `column` matches `pattern` case-sensitively.
```js
const { data, error } = await supabase
@@ -36,7 +35,7 @@ const { data, error } = await supabase
</h4>
<div class="method-list-item-description">
The column to filter on.
The column to filter on
</div>
@@ -56,7 +55,7 @@ The column to filter on.
</h4>
<div class="method-list-item-description">
The pattern to filter with.
The pattern to match with
</div>
@@ -8,7 +8,7 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
Limits the result with the specified `count`.
Limit the query result by `count`.
```js
const { data, error } = await supabase
@@ -35,7 +35,7 @@ const { data, error } = await supabase
</h4>
<div class="method-list-item-description">
The maximum no. of rows to limit to.
The maximum number of rows to return
</div>
@@ -44,7 +44,7 @@ The maximum no. of rows to limit to.
<li className="method-list-item">
<h4 className="method-list-item-label">
<span className="method-list-item-label-name">
foreignTable
options
</span>
<span className="method-list-item-label-badge required">
required
@@ -55,7 +55,7 @@ The maximum no. of rows to limit to.
</h4>
<div class="method-list-item-description">
The foreign table to use (for foreign columns).
Named parameters
</div>
@@ -76,7 +76,8 @@ The foreign table to use (for foreign columns).
</h4>
<div class="method-list-item-description">
No description provided.
Set this to limit rows of foreign tables
instead of the current table
</div>
+3 -4
View File
@@ -8,8 +8,7 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
Finds all rows whose value on the stated `column` is less than the
specified `value`.
Match only rows where `column` is less than `value`.
```js
const { data, error } = await supabase
@@ -36,7 +35,7 @@ const { data, error } = await supabase
</h4>
<div class="method-list-item-description">
The column to filter on.
The column to filter on
</div>
@@ -56,7 +55,7 @@ The column to filter on.
</h4>
<div class="method-list-item-description">
The value to filter with.
The value to filter with
</div>
@@ -8,8 +8,7 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
Finds all rows whose value on the stated `column` is less than or equal
to the specified `value`.
Match only rows where `column` is less than or equal to `value`.
```js
const { data, error } = await supabase
@@ -36,7 +35,7 @@ const { data, error } = await supabase
</h4>
<div class="method-list-item-description">
The column to filter on.
The column to filter on
</div>
@@ -56,7 +55,7 @@ The column to filter on.
</h4>
<div class="method-list-item-description">
The value to filter with.
The value to filter with
</div>
@@ -8,7 +8,8 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
Finds all rows whose columns match the specified `query` object.
Match only rows where each column in `query` keys is equal to its
associated value. Shorthand for multiple `.eq()`s.
```js
const { data, error } = await supabase
@@ -36,7 +37,7 @@ const { data, error } = await supabase
<div class="method-list-item-description">
The object to filter with, with column names as keys mapped
to their filter values.
to their filter values
</div>
@@ -8,9 +8,10 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
Retrieves at most one row from the result. Result must be at most one row
(e.g. using `eq` on a UNIQUE column), otherwise this will result in an
error.
Return `data` as a single object instead of an array of objects.
Query result must be zero or one row (e.g. using `.limit(1)`), otherwise
this returns an error.
```js
const { data, error } = await supabase
@@ -8,8 +8,7 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
Finds all rows whose value on the stated `column` doesn't match the
specified `value`.
Match only rows where `column` is not equal to `value`.
```js
const { data, error } = await supabase
@@ -36,7 +35,7 @@ const { data, error } = await supabase
</h4>
<div class="method-list-item-description">
The column to filter on.
The column to filter on
</div>
@@ -56,7 +55,7 @@ The column to filter on.
</h4>
<div class="method-list-item-description">
The value to filter with.
The value to filter with
</div>
+10 -4
View File
@@ -8,7 +8,12 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
Finds all rows which doesn't satisfy the filter.
Match only rows which doesn't satisfy the filter.
Unlike most filters, `opearator` and `value` are used as-is and need to
follow [PostgREST
syntax](https://postgrest.org/en/stable/api.html#operators). You also need
to make sure they are properly sanitized.
```js
const { data, error } = await supabase
@@ -35,7 +40,7 @@ const { data, error } = await supabase
</h4>
<div class="method-list-item-description">
The column to filter on.
The column to filter on
</div>
@@ -55,7 +60,8 @@ The column to filter on.
</h4>
<div class="method-list-item-description">
The operator to filter with.
The operator to be negated to filter with, following
PostgREST syntax
</div>
@@ -75,7 +81,7 @@ The operator to filter with.
</h4>
<div class="method-list-item-description">
The value to filter with.
The value to filter with, following PostgREST syntax
</div>
+10 -3
View File
@@ -8,7 +8,13 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
Finds all rows satisfying at least one of the filters.
Match only rows which satisfy at least one of the filters.
Unlike most filters, `filters` is used as-is and needs to follow [PostgREST
syntax](https://postgrest.org/en/stable/api.html#operators). You also need
to make sure it's properly sanitized.
It's currently not possible to do an `.or()` filter across multiple tables.
```js
const { data, error } = await supabase
@@ -35,7 +41,7 @@ const { data, error } = await supabase
</h4>
<div class="method-list-item-description">
The filters to use, separated by commas.
The filters to use, following PostgREST syntax
</div>
@@ -55,7 +61,8 @@ The filters to use, separated by commas.
</h4>
<div class="method-list-item-description">
The foreign table to use (if `column` is a foreign column).
Set this to filter on foreign tables instead of the
current table
</div>
@@ -8,7 +8,12 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
Orders the result with the specified `column`.
Order the query result by `column`.
You can call this method multiple times to order by multiple columns.
You can order foreign tables, but it doesn't affect the ordering of the
current table.
```js
const { data, error } = await supabase
@@ -35,7 +40,7 @@ const { data, error } = await supabase
</h4>
<div class="method-list-item-description">
The column to order on.
The column to order by
</div>
@@ -55,7 +60,7 @@ The column to order on.
</h4>
<div class="method-list-item-description">
No description provided.
Named parameters
</div>
@@ -76,7 +81,7 @@ No description provided.
</h4>
<div class="method-list-item-description">
No description provided.
If `true`, the result will be in ascending order
</div>
@@ -96,7 +101,8 @@ No description provided.
</h4>
<div class="method-list-item-description">
No description provided.
Set this to order a foreign table by foreign
columns
</div>
@@ -116,7 +122,8 @@ No description provided.
</h4>
<div class="method-list-item-description">
No description provided.
If `true`, `null`s appear first. If `false`,
`null`s appear last.
</div>
@@ -8,8 +8,8 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
Finds all rows whose array or range value on the stated `column` overlaps
(has a value in common) with the specified `value`.
Only relevant for array and range columns. Match only rows where
`column` and `value` have an element in common.
```js
const { data, error } = await supabase
@@ -36,7 +36,7 @@ const { data, error } = await supabase
</h4>
<div class="method-list-item-description">
The column to filter on.
The array or range column to filter on
</div>
@@ -56,7 +56,7 @@ The column to filter on.
</h4>
<div class="method-list-item-description">
The value to filter with.
The array or range value to filter with
</div>
@@ -8,7 +8,7 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
Limits the result to rows within the specified range, inclusive.
Limit the query result by `from` and `to` inclusively.
```js
const { data, error } = await supabase
@@ -35,7 +35,7 @@ const { data, error } = await supabase
</h4>
<div class="method-list-item-description">
The starting index from which to limit the result, inclusive.
The starting index from which to limit the result
</div>
@@ -55,7 +55,7 @@ The starting index from which to limit the result, inclusive.
</h4>
<div class="method-list-item-description">
The last index to which to limit the result, inclusive.
The last index to which to limit the result
</div>
@@ -64,7 +64,7 @@ The last index to which to limit the result, inclusive.
<li className="method-list-item">
<h4 className="method-list-item-label">
<span className="method-list-item-label-name">
foreignTable
options
</span>
<span className="method-list-item-label-badge required">
required
@@ -75,7 +75,7 @@ The last index to which to limit the result, inclusive.
</h4>
<div class="method-list-item-description">
The foreign table to use (for foreign columns).
Named parameters
</div>
@@ -96,7 +96,8 @@ The foreign table to use (for foreign columns).
</h4>
<div class="method-list-item-description">
No description provided.
Set this to limit rows of foreign tables
instead of the current table
</div>
@@ -8,8 +8,9 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
Finds all rows whose range value on the stated `column` is adjacent to
the specified `range`.
Only relevant for range columns. Match only rows where `column` is
mutually exclusive to `range` and there can be no element between the two
ranges.
```js
const { data, error } = await supabase
@@ -36,7 +37,7 @@ const { data, error } = await supabase
</h4>
<div class="method-list-item-description">
The column to filter on.
The range column to filter on
</div>
@@ -56,7 +57,7 @@ The column to filter on.
</h4>
<div class="method-list-item-description">
The range to filter with.
The range to filter with
</div>
@@ -8,8 +8,8 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
Finds all rows whose range value on the stated `column` is strictly to
the right of the specified `range`.
Only relevant for range columns. Match only rows where every element in
`column` is greater than any element in `range`.
```js
const { data, error } = await supabase
@@ -36,7 +36,7 @@ const { data, error } = await supabase
</h4>
<div class="method-list-item-description">
The column to filter on.
The range column to filter on
</div>
@@ -56,7 +56,7 @@ The column to filter on.
</h4>
<div class="method-list-item-description">
The range to filter with.
The range to filter with
</div>
@@ -8,8 +8,9 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
Finds all rows whose range value on the stated `column` does not extend
to the left of the specified `range`.
Only relevant for range columns. Match only rows where every element in
`column` is either contained in `range` or greater than any element in
`range`.
```js
const { data, error } = await supabase
@@ -36,7 +37,7 @@ const { data, error } = await supabase
</h4>
<div class="method-list-item-description">
The column to filter on.
The range column to filter on
</div>
@@ -56,7 +57,7 @@ The column to filter on.
</h4>
<div class="method-list-item-description">
The range to filter with.
The range to filter with
</div>
@@ -8,8 +8,8 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
Finds all rows whose range value on the stated `column` is strictly to the
left of the specified `range`.
Only relevant for range columns. Match only rows where every element in
`column` is less than any element in `range`.
```js
const { data, error } = await supabase
@@ -36,7 +36,7 @@ const { data, error } = await supabase
</h4>
<div class="method-list-item-description">
The column to filter on.
The range column to filter on
</div>
@@ -56,7 +56,7 @@ The column to filter on.
</h4>
<div class="method-list-item-description">
The range to filter with.
The range to filter with
</div>
@@ -8,8 +8,9 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
Finds all rows whose range value on the stated `column` does not extend
to the right of the specified `range`.
Only relevant for range columns. Match only rows where every element in
`column` is either contained in `range` or less than any element in
`range`.
```js
const { data, error } = await supabase
@@ -36,7 +37,7 @@ const { data, error } = await supabase
</h4>
<div class="method-list-item-description">
The column to filter on.
The range column to filter on
</div>
@@ -56,7 +57,7 @@ The column to filter on.
</h4>
<div class="method-list-item-description">
The range to filter with.
The range to filter with
</div>
+17 -25
View File
@@ -41,7 +41,7 @@ const { data, error } = await supabase.rpc('hello_world')
</h4>
<div class="method-list-item-description">
The function name to call.
The function name to call
</div>
@@ -61,7 +61,7 @@ The function name to call.
</h4>
<div class="method-list-item-description">
The parameters to pass to the function call.
The arguments to pass to the function call
</div>
@@ -81,7 +81,7 @@ The parameters to pass to the function call.
</h4>
<div class="method-list-item-description">
Named parameters.
Named parameters
</div>
@@ -102,7 +102,18 @@ Named parameters.
</h4>
<div class="method-list-item-description">
Count algorithm to use to count rows in a table.
Count algorithm to use to count rows returned by the
function. Only applicable for [set-returning
functions](https://www.postgresql.org/docs/current/functions-srf.html).
`"exact"`: Exact but slow count algorithm. Performs a `COUNT(*)` under the
hood.
`"planned"`: Approximated but fast count algorithm. Uses the Postgres
statistics under the hood.
`"estimated"`: Uses exact count for low numbers and planned count for high
numbers.
</div>
@@ -187,27 +198,8 @@ No description provided.
</h4>
<div class="method-list-item-description">
When set to true, no data will be returned.
</div>
</li>
<li className="method-list-item">
<h4 className="method-list-item-label">
<span className="method-list-item-label-name">
rollback
</span>
<span className="method-list-item-label-badge false">
optional
</span>
<span className="method-list-item-validation">
<code>boolean</code>
</span>
</h4>
<div class="method-list-item-description">
Rollback the operation
When set to `true`, `data` will not be returned.
Useful if you only need the count.
</div>
@@ -8,7 +8,7 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
Performs vertical filtering with SELECT.
Perform a SELECT query on the table or view.
```js
const { data, error } = await supabase.from('cities').select()
@@ -32,7 +32,7 @@ const { data, error } = await supabase.from('cities').select()
</h4>
<div class="method-list-item-description">
The columns to retrieve, separated by commas.
The columns to retrieve, separated by commas
</div>
@@ -41,7 +41,7 @@ The columns to retrieve, separated by commas.
<li className="method-list-item">
<h4 className="method-list-item-label">
<span className="method-list-item-label-name">
__namedParameters
options
</span>
<span className="method-list-item-label-badge required">
required
@@ -52,7 +52,7 @@ The columns to retrieve, separated by commas.
</h4>
<div class="method-list-item-description">
No description provided.
Named parameters
</div>
@@ -73,7 +73,16 @@ No description provided.
</h4>
<div class="method-list-item-description">
Count algorithm to use to count rows in a table.
Count algorithm to use to count rows in the table or view.
`"exact"`: Exact but slow count algorithm. Performs a `COUNT(*)` under the
hood.
`"planned"`: Approximated but fast count algorithm. Uses the Postgres
statistics under the hood.
`"estimated"`: Uses exact count for low numbers and planned count for high
numbers.
</div>
@@ -158,7 +167,8 @@ No description provided.
</h4>
<div class="method-list-item-description">
When set to true, select will void data.
When set to `true`, `data` will not be returned.
Useful if you only need the count.
</div>
@@ -8,8 +8,10 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
Retrieves only one row from the result. Result must be one row (e.g. using
`limit`), otherwise this will result in an error.
Return `data` as a single object instead of an array of objects.
Query result must be one row (e.g. using `.limit(1)`), otherwise this
returns an error.
```js
const { data, error } = await supabase
@@ -8,8 +8,8 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
Finds all rows whose text or tsvector value on the stated `column` matches
the tsquery in `query`.
Only relevant for text and tsvector columns. Match only rows where
`column` matches the query string in `query`.
## Parameters
@@ -29,7 +29,7 @@ the tsquery in `query`.
</h4>
<div class="method-list-item-description">
The column to filter on.
The text or tsvector column to filter on
</div>
@@ -49,7 +49,7 @@ The column to filter on.
</h4>
<div class="method-list-item-description">
The Postgres tsquery string to filter with.
The query text to match with
</div>
@@ -69,7 +69,7 @@ The Postgres tsquery string to filter with.
</h4>
<div class="method-list-item-description">
No description provided.
Named parameters
</div>
@@ -90,7 +90,7 @@ No description provided.
</h4>
<div class="method-list-item-description">
No description provided.
The text search configuration to use
</div>
@@ -110,7 +110,7 @@ No description provided.
</h4>
<div class="method-list-item-description">
No description provided.
Change how the `query` text is interpreted
</div>
@@ -8,7 +8,10 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
Performs an UPDATE on the table.
Perform an UPDATE on the table or view.
By default, updated rows are not returned. To return it, chain the call
with `.select()` after filters.
```js
const { data, error } = await supabase
@@ -35,7 +38,7 @@ const { data, error } = await supabase
</h4>
<div class="method-list-item-description">
The values to update.
The values to update with
</div>
@@ -44,7 +47,7 @@ The values to update.
<li className="method-list-item">
<h4 className="method-list-item-label">
<span className="method-list-item-label-name">
__namedParameters
options
</span>
<span className="method-list-item-label-badge required">
required
@@ -55,7 +58,7 @@ The values to update.
</h4>
<div class="method-list-item-description">
No description provided.
Named parameters
</div>
@@ -76,7 +79,16 @@ No description provided.
</h4>
<div class="method-list-item-description">
Count algorithm to use to count rows in a table.
Count algorithm to use to count updated rows.
`"exact"`: Exact but slow count algorithm. Performs a `COUNT(*)` under the
hood.
`"planned"`: Approximated but fast count algorithm. Uses the Postgres
statistics under the hood.
`"estimated"`: Uses exact count for low numbers and planned count for high
numbers.
</div>
@@ -147,26 +159,6 @@ No description provided.
</li>
<li className="method-list-item">
<h4 className="method-list-item-label">
<span className="method-list-item-label-name">
rollback
</span>
<span className="method-list-item-label-badge false">
optional
</span>
<span className="method-list-item-validation">
<code>boolean</code>
</span>
</h4>
<div class="method-list-item-description">
Rollback the operation
</div>
</li>
</ul>
</li>
@@ -8,7 +8,14 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/spec/supabase_
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
Performs an UPSERT into the table.
Perform an UPSERT on the table or view. Depending on the column(s) passed
to `onConflict`, `.upsert()` allows you to perform the equivalent of
`.insert()` if a row with the corresponding `onConflict` columns doesn't
exist, or if it does exist, perform an alternative action depending on
`ignoreDuplicates`.
By default, upserted rows are not returned. To return it, chain the call
with `.select()`.
```js
const { data, error } = await supabase
@@ -34,7 +41,8 @@ const { data, error } = await supabase
</h4>
<div class="method-list-item-description">
The values to insert.
The values to upsert with. Pass an object to upsert a
single row or an array to upsert multiple rows.
</div>
@@ -88,7 +96,7 @@ No description provided.
<li className="method-list-item">
<h4 className="method-list-item-label">
<span className="method-list-item-label-name">
__namedParameters
options
</span>
<span className="method-list-item-label-badge required">
required
@@ -99,7 +107,7 @@ No description provided.
</h4>
<div class="method-list-item-description">
No description provided.
Named parameters
</div>
@@ -120,7 +128,16 @@ No description provided.
</h4>
<div class="method-list-item-description">
Count algorithm to use to count rows in a table.
Count algorithm to use to count upserted rows.
`"exact"`: Exact but slow count algorithm. Performs a `COUNT(*)` under the
hood.
`"planned"`: Approximated but fast count algorithm. Uses the Postgres
statistics under the hood.
`"estimated"`: Uses exact count for low numbers and planned count for high
numbers.
</div>
@@ -205,7 +222,8 @@ No description provided.
</h4>
<div class="method-list-item-description">
Specifies if duplicate rows should be ignored and not inserted.
If `true`, duplicate rows are ignored. If
`false`, duplicate rows are merged with existing rows.
</div>
@@ -225,27 +243,9 @@ Specifies if duplicate rows should be ignored and not inserted.
</h4>
<div class="method-list-item-description">
By specifying the `on_conflict` query parameter, you can make UPSERT work on a column(s) that has a UNIQUE constraint.
</div>
</li>
<li className="method-list-item">
<h4 className="method-list-item-label">
<span className="method-list-item-label-name">
rollback
</span>
<span className="method-list-item-label-badge false">
optional
</span>
<span className="method-list-item-validation">
<code>boolean</code>
</span>
</h4>
<div class="method-list-item-description">
Rollback the operation
Comma-separated UNIQUE column(s) to specify how
duplicate rows are determined. Two rows are duplicates if all the
`onConflict` columns are equal.
</div>
@@ -139,9 +139,9 @@ const { data, error } = await supabase.auth.api.resetPasswordForEmail(
const { data, error } = await supabase.auth.api.resetPasswordForEmail(
'user@email.com'
)
/**
* Step 2: Once the user is redirected back to your application,
* Step 2: Once the user is redirected back to your application,
* ask the user to reset their password.
*/
useEffect(() => {
@@ -151,10 +151,10 @@ useEffect(() => {
const { data, error } = await supabase.auth.update({
password: newPassword,
})
if (data) alert('Password updated successfully!')
if (error) alert('There was an error updating your password.')
}
}
})
}, [])
```
+1 -1
View File
@@ -13,4 +13,4 @@ To get started, run `make init`. This installs all dependencies.
make # download latest specs and add enrichments
make.generate # transform the specs into docs
```
```
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+2 -2
View File
@@ -565,7 +565,7 @@ pages:
type: 'recovery',
email: 'email@example.com'
})
```
```
- name: Generate a link to change email addresses
isSpotlight: false
js: |
@@ -575,7 +575,7 @@ pages:
email: 'old.email@example.com',
newEmail: 'new.email@example.com'
})
```
```
auth.admin.updateUserById():
title: 'updateUserById()'