mirror of
https://github.com/supabase/supabase.git
synced 2026-10-06 18:05:11 +03:00
Removes generated files
This commit is contained in:
1 parent
c9751d517f
commit
6c399f320d
120 files changed
+3708
-20643
No files matched your search
Whitespace-only changes.
@@ -1,226 +0,0 @@
|
||||
---
|
||||
id: adj
|
||||
title: ".adj()"
|
||||
slug: adj
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
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`.
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase
|
||||
.from('countries')
|
||||
.select('name, id, population_range_millions')
|
||||
.adj('population_range_millions', [70, 185])
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
column
|
||||
</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">
|
||||
|
||||
The column to filter on.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
range
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>string</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The range to filter with.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### With `select()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase
|
||||
.from('countries')
|
||||
.select('name, id, population_range_millions')
|
||||
.adj('population_range_millions', [70, 185])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `update()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase
|
||||
.from('countries')
|
||||
.update({ name: 'Mordor' })
|
||||
.adj('population_range_millions', [70, 185])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `delete()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase
|
||||
.from('countries')
|
||||
.delete()
|
||||
.adj('population_range_millions', [70, 185])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `rpc()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
// Only valid if the Stored Procedure returns a table type.
|
||||
const { data, error } = await supabase
|
||||
.rpc('echo_all_countries')
|
||||
.adj('population_range_millions', [70, 185])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,75 +0,0 @@
|
||||
---
|
||||
id: auth-forgotpassword
|
||||
title: "auth.forgotPassword()"
|
||||
slug: auth-forgotpassword
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = supabase.auth.api.resetPasswordForEmail('user@email.com')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
Sends a reset request to an email address.
|
||||
|
||||
When the user clicks the reset link in the email they will be forwarded to:
|
||||
`<SITE_URL>#access_token=x&refresh_token=y&expires_in=z&token_type=bearer&type=recovery`
|
||||
|
||||
Your app must detect `type=recovery` in the fragment and display a password reset form to the user.
|
||||
|
||||
You should then use the access_token in the url and new password to update the user as follows:
|
||||
|
||||
```js
|
||||
const { error, data } = await auth.api
|
||||
.updateUser(access_token, { password : new_password })
|
||||
```
|
||||
|
||||
|
||||
|
||||
## Parameters
|
||||
|
||||
|
||||
<ul className="method-list-group">
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
email
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
string
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The email address of the user.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
@@ -1,109 +0,0 @@
|
||||
---
|
||||
id: auth-onauthstatechange
|
||||
title: "auth.onAuthStateChange()"
|
||||
slug: auth-onauthstatechange
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Receive a notification every time an auth event happens.
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
supabase.auth.onAuthStateChange((event, session) => {
|
||||
console.log(event, session)
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
callback
|
||||
</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>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### Listen to auth changes
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
supabase.auth.onAuthStateChange((event, session) => {
|
||||
console.log(event, session)
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,39 +0,0 @@
|
||||
---
|
||||
id: auth-password-reset
|
||||
title: "auth.password-reset"
|
||||
slug: auth-password-reset
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Sends a reset request to an email address.
|
||||
|
||||
|
||||
|
||||
## Parameters
|
||||
|
||||
|
||||
<ul className="method-list-group">
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
email
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
string
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The email address of the user.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
@@ -1,81 +0,0 @@
|
||||
---
|
||||
id: auth-session
|
||||
title: "auth.session()"
|
||||
slug: auth-session
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Returns the session data, if there is an active session.
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const session = supabase.auth.session()
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### Get the session data
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const session = supabase.auth.session()
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,243 +0,0 @@
|
||||
---
|
||||
id: auth-signin
|
||||
title: "auth.signIn()"
|
||||
slug: auth-signin
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Log in an existing user, or login via a third-party provider.
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { user, error } = await supabase.auth.signIn({
|
||||
email: 'example@email.com',
|
||||
password: 'example-password',
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
credentials
|
||||
</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">
|
||||
|
||||
The user login details.
|
||||
|
||||
</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">
|
||||
email
|
||||
</span>
|
||||
<span className="method-list-item-label-badge false">
|
||||
optional
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>undefined</code> | <code>string</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The user's email address.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
password
|
||||
</span>
|
||||
<span className="method-list-item-label-badge false">
|
||||
optional
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>undefined</code> | <code>string</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The user's password.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
provider
|
||||
</span>
|
||||
<span className="method-list-item-label-badge false">
|
||||
optional
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>Provider</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
One of the providers supported by GoTrue.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
## Notes
|
||||
|
||||
- A user can sign up either via email or OAuth.
|
||||
- If you provide `email` without a `password`, the user will be sent a magic link.
|
||||
- The magic link's destination URL is determined by the SITE_URL config variable. To change this, you can go to Authentication -> Settings on [app.supabase.io](https://app.supabase.io)
|
||||
- Specifying a `provider` will open the browser to the relevant login page.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### Sign in with email.
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { user, error } = await supabase.auth.signIn({
|
||||
email: 'example@email.com',
|
||||
password: 'example-password',
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### Sign in with magic link.
|
||||
|
||||
If no password is provided, the user will be sent a "magic link" to their email address, which they can click to open your application with a valid session. By default, a given user can only request a Magic Link once every 60 seconds.
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { user, error } = await supabase.auth.signIn({
|
||||
email: 'example@email.com'
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### Sign in using third-party providers.
|
||||
|
||||
Supabase supports OAuth logins.
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { user, error } = await supabase.auth.signIn({
|
||||
// provider can be 'github', 'google', 'gitlab', or 'bitbucket'
|
||||
provider: 'github'
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,81 +0,0 @@
|
||||
---
|
||||
id: auth-signout
|
||||
title: "auth.signOut()"
|
||||
slug: auth-signout
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Signs out the current user, if there is a logged in user.
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { error } = supabase.auth.signOut()
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### Sign out
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { error } = supabase.auth.signOut()
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,159 +0,0 @@
|
||||
---
|
||||
id: auth-signup
|
||||
title: "auth.signUp()"
|
||||
slug: auth-signup
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Creates a new user.
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { user, error } = await supabase.auth.signUp({
|
||||
email: 'example@email.com',
|
||||
password: 'example-password',
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
credentials
|
||||
</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">
|
||||
|
||||
The user login details.
|
||||
|
||||
</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">
|
||||
password
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>string</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The user's password.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
email
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>string</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The user's email address.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
## Notes
|
||||
|
||||
- By default, the user will need to verify their email address before logging in. If you would like to change this, you can disable email confirmations by going to Authentication -> Settings on [app.supabase.io](https://app.supabase.io)
|
||||
- When the user confirms their email address, they will be redirected to localhost:3000 by default. To change this, you can go to Authentication -> Settings on [app.supabase.io](https://app.supabase.io)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### Sign up
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { user, error } = await supabase.auth.signUp({
|
||||
email: 'example@email.com',
|
||||
password: 'example-password',
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,111 +0,0 @@
|
||||
---
|
||||
id: auth-update
|
||||
title: "auth.update()"
|
||||
slug: auth-update
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Updates user data, if there is a logged in user.
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { user, error } = await supabase.auth.update({
|
||||
data: { hello: 'world' }
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
attributes
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>UserAttributes</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
## Notes
|
||||
|
||||
It's generally better to store user data in a table inside your public schema (i.e. `public.users`).
|
||||
Use the `update()` method if you have data which rarely changes or is specific only to the logged in user.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### Update a user's metadata.
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { user, error } = await supabase.auth.update({
|
||||
data: { hello: 'world' }
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,81 +0,0 @@
|
||||
---
|
||||
id: auth-user
|
||||
title: "auth.user()"
|
||||
slug: auth-user
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Returns the user data, if there is a logged in user.
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const user = supabase.auth.user()
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### Get the logged in user
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const user = supabase.auth.user()
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,226 +0,0 @@
|
||||
---
|
||||
id: cd
|
||||
title: ".cd()"
|
||||
slug: cd
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
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`.
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase
|
||||
.from('countries')
|
||||
.select('name, id, main_exports')
|
||||
.cd('main_exports', ['cars', 'food', 'machine'])
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
column
|
||||
</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">
|
||||
|
||||
The column to filter on.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
value
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>string</code> | <code>array</code> | <code>object</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The value to filter with.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### With `select()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase
|
||||
.from('countries')
|
||||
.select('name, id, main_exports')
|
||||
.cd('main_exports', ['cars', 'food', 'machine'])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `update()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase
|
||||
.from('countries')
|
||||
.update({ name: 'Mordor' })
|
||||
.cd('main_exports', ['orks', 'surveillance', 'evil'])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `delete()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase
|
||||
.from('countries')
|
||||
.delete()
|
||||
.cd('main_exports', ['cars', 'food', 'machine'])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `rpc()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
// Only valid if the Stored Procedure returns a table type.
|
||||
const { data, error } = await supabase
|
||||
.rpc('echo_all_countries')
|
||||
.cd('main_exports', ['cars', 'food', 'machine'])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,226 +0,0 @@
|
||||
---
|
||||
id: cs
|
||||
title: ".cs()"
|
||||
slug: cs
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
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`.
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase
|
||||
.from('countries')
|
||||
.select('name, id, main_exports')
|
||||
.cs('main_exports', ['oil'])
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
column
|
||||
</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">
|
||||
|
||||
The column to filter on.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
value
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>string</code> | <code>array</code> | <code>object</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The value to filter with.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### With `select()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase
|
||||
.from('countries')
|
||||
.select('name, id, main_exports')
|
||||
.cs('main_exports', ['oil'])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `update()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase
|
||||
.from('countries')
|
||||
.update({ name: 'Mordor' })
|
||||
.cs('main_exports', ['oil'])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `delete()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase
|
||||
.from('countries')
|
||||
.delete()
|
||||
.cs('main_exports', ['oil'])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `rpc()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
// Only valid if the Stored Procedure returns a table type.
|
||||
const { data, error } = await supabase
|
||||
.rpc('echo_all_countries')
|
||||
.cs('main_exports', ['oil'])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,158 +0,0 @@
|
||||
---
|
||||
id: delete
|
||||
title: "Delete data: delete()"
|
||||
slug: delete
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
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>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
count
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>null</code> | <code>exact</code> | <code>planned</code> | <code>estimated</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
|
||||
</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>
|
||||
@@ -1,226 +0,0 @@
|
||||
---
|
||||
id: eq
|
||||
title: ".eq()"
|
||||
slug: eq
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Finds all rows whose value on the stated `column` exactly matches the
|
||||
specified `value`.
|
||||
|
||||
<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')
|
||||
.select('name, country_id')
|
||||
.eq('name', 'The shire')
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
column
|
||||
</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">
|
||||
|
||||
The column to filter on.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
value
|
||||
</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">
|
||||
|
||||
The value to filter with.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### With `select()`
|
||||
|
||||
|
||||
|
||||
<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')
|
||||
.select('name, country_id')
|
||||
.eq('name', 'The shire')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `update()`
|
||||
|
||||
|
||||
|
||||
<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')
|
||||
.update({ name: 'Mordor' })
|
||||
.eq('name', 'San Francisco')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `delete()`
|
||||
|
||||
|
||||
|
||||
<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()
|
||||
.eq('name', 'Mordor')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `rpc()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
// Only valid if the Stored Procedure returns a table type.
|
||||
const { data, error } = await supabase
|
||||
.rpc('echo_all_cities')
|
||||
.eq('name', 'San Francisco')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,277 +0,0 @@
|
||||
---
|
||||
id: filter
|
||||
title: ".filter()"
|
||||
slug: filter
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Finds all rows whose `column` satisfies the filter.
|
||||
|
||||
<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')
|
||||
.select('name, country_id')
|
||||
.filter('name', 'eq', 'Paris')
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
column
|
||||
</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">
|
||||
|
||||
The column to filter on.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
operator
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>FilterOperator</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The operator to filter with.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
value
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>any</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The value to filter with.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### With `select()`
|
||||
|
||||
|
||||
|
||||
<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')
|
||||
.select('name, country_id')
|
||||
.filter('name', 'eq', 'Paris')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `update()`
|
||||
|
||||
|
||||
|
||||
<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')
|
||||
.update({ name: 'Mordor' })
|
||||
.filter('name', 'eq', 'Paris')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `delete()`
|
||||
|
||||
|
||||
|
||||
<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()
|
||||
.filter('name', 'eq', 'Paris')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `rpc()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
// Only valid if the Stored Procedure returns a table type.
|
||||
const { data, error } = await supabase
|
||||
.rpc('echo_all_cities')
|
||||
.filter('name', 'eq', 'Paris')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### Filter embedded resources
|
||||
|
||||
|
||||
|
||||
<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')
|
||||
.select('name, countries ( name )')
|
||||
.filter('countries.name', 'eq', 'France')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,108 +0,0 @@
|
||||
---
|
||||
id: fts
|
||||
title: ".fts()"
|
||||
slug: fts
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Finds all rows whose tsvector value on the stated `column` matches
|
||||
to_tsquery(`query`).
|
||||
|
||||
|
||||
|
||||
## Parameters
|
||||
|
||||
|
||||
<ul className="method-list-group">
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
column
|
||||
</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">
|
||||
|
||||
The column to filter on.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
query
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>string</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The Postgres tsquery string to filter with.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<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">
|
||||
config
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>undefined</code> | <code>string</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The text search configuration to use.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
@@ -1,81 +0,0 @@
|
||||
---
|
||||
id: generating-types
|
||||
title: "Generating Types"
|
||||
slug: generating-types
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Supabase will soon release native type generators that dump your database types for various languages. For now, we support TypeScript through a third-party tool.
|
||||
|
||||
## Usage with TypeScript
|
||||
|
||||
`supabase-js` ships with type definitions for usage with TypeScript and for convenient IntelliSense auto-complete and documentation in your editor.
|
||||
|
||||
When using TypeScript, you can pass the type of database row as a type parameter to the `from` method to get better auto-completion support down the chain.
|
||||
If you don't provide a type for the row you need to explicitly pass `from<any>('tableName')`.
|
||||
|
||||
```ts
|
||||
type Message = {
|
||||
id: number;
|
||||
inserted_at: string;
|
||||
message: string;
|
||||
user_id: string;
|
||||
channel_id: number;
|
||||
author: { username: string };
|
||||
}
|
||||
|
||||
const response = await supabase
|
||||
.from<Message>('messages') // Message maps to the type of the row in your database.
|
||||
.select('*, author:user_id(username)')
|
||||
.match({ channel_id: 2 }) // Your IDE will be able to help with auto-completion.
|
||||
response.data // Response data will be of type Array<Message>.
|
||||
|
||||
// If you don't provide a type for the row you need to explicitly pass `from<any>('tableName')`.
|
||||
const response = await supabase
|
||||
.from<any>('messages')
|
||||
.select('*, author:user_id(username)')
|
||||
.match({ channel_id: 2 })
|
||||
response.data // Response data will be of type Array<any>.
|
||||
```
|
||||
|
||||
### Generate database types from Swagger OpenAPI specification
|
||||
|
||||
Supabase generates a Swagger specification file for your database which can be used to generate your data types for usage with TypeScript.
|
||||
|
||||
The Swagger specification for your Supabase project can be accessed as follows:
|
||||
|
||||
```txt
|
||||
https://your-project.supabase.co/rest/v1/?apikey=your-anon-key
|
||||
```
|
||||
|
||||
Using the open source [swagger-to-ts](https://github.com/manifoldco/swagger-to-ts#%EF%B8%8F-reading-specs-from-remote-resource) tool you can generate your types and store them locally:
|
||||
|
||||
```bash
|
||||
npx @manifoldco/swagger-to-ts https://your-project.supabase.co/rest/v1/?apikey=your-anon-key --output types/supabase.ts
|
||||
```
|
||||
|
||||
**Note:** Do note that your local types won't automatically stay in sync with your database, so make sure to regenerate your types after your make changes to your database.
|
||||
|
||||
After you have generated your types, you can use them in your TypeScript projects:
|
||||
|
||||
```ts
|
||||
import { NextApiRequest, NextApiResponse } from "next";
|
||||
import { createClient } from "@supabase/supabase-js";
|
||||
import { definitions } from "../../types/supabase";
|
||||
|
||||
const supabase = createClient(
|
||||
process.env.NEXT_PUBLIC_SUPABASE_URL,
|
||||
process.env.SUPABASE_SECRET_KEY
|
||||
);
|
||||
|
||||
export default async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
const allOnlineUsers = await supabase
|
||||
.from<definitions["users"]>("users")
|
||||
.select("*")
|
||||
.eq("status", "ONLINE");
|
||||
res.status(200).json(allOnlineUsers);
|
||||
};
|
||||
```
|
||||
@@ -1,81 +0,0 @@
|
||||
---
|
||||
id: getsubscriptions
|
||||
title: "getSubscriptions()"
|
||||
slug: getsubscriptions
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Returns an array of all your subscriptions.
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const subscriptions = supabase.getSubscriptions()
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### Remove a subscription
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const subscriptions = supabase.getSubscriptions()
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,226 +0,0 @@
|
||||
---
|
||||
id: gt
|
||||
title: ".gt()"
|
||||
slug: gt
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
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`.
|
||||
|
||||
<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')
|
||||
.select('name, country_id')
|
||||
.gt('country_id', 250)
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
column
|
||||
</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">
|
||||
|
||||
The column to filter on.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
value
|
||||
</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">
|
||||
|
||||
The value to filter with.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### With `select()`
|
||||
|
||||
|
||||
|
||||
<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')
|
||||
.select('name, country_id')
|
||||
.gt('country_id', 250)
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `update()`
|
||||
|
||||
|
||||
|
||||
<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')
|
||||
.update({ name: 'Mordor' })
|
||||
.gt('country_id', 250)
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `delete()`
|
||||
|
||||
|
||||
|
||||
<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()
|
||||
.gt('country_id', 250)
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `rpc()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
// Only valid if the Stored Procedure returns a table type.
|
||||
const { data, error } = await supabase
|
||||
.rpc('echo_all_cities')
|
||||
.gt('country_id', 250)
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,226 +0,0 @@
|
||||
---
|
||||
id: gte
|
||||
title: ".gte()"
|
||||
slug: gte
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
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`.
|
||||
|
||||
<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')
|
||||
.select('name, country_id')
|
||||
.gte('country_id', 250)
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
column
|
||||
</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">
|
||||
|
||||
The column to filter on.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
value
|
||||
</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">
|
||||
|
||||
The value to filter with.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### With `select()`
|
||||
|
||||
|
||||
|
||||
<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')
|
||||
.select('name, country_id')
|
||||
.gte('country_id', 250)
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `update()`
|
||||
|
||||
|
||||
|
||||
<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')
|
||||
.update({ name: 'Mordor' })
|
||||
.gte('country_id', 250)
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `delete()`
|
||||
|
||||
|
||||
|
||||
<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()
|
||||
.gte('country_id', 250)
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `rpc()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
// Only valid if the Stored Procedure returns a table type.
|
||||
const { data, error } = await supabase
|
||||
.rpc('echo_all_cities')
|
||||
.gte('country_id', 250)
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,226 +0,0 @@
|
||||
---
|
||||
id: ilike
|
||||
title: ".ilike()"
|
||||
slug: ilike
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
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).
|
||||
|
||||
<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')
|
||||
.select('name, country_id')
|
||||
.ilike('name', '%la%')
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
column
|
||||
</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">
|
||||
|
||||
The column to filter on.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
pattern
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>string</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The pattern to filter with.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### With `select()`
|
||||
|
||||
|
||||
|
||||
<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')
|
||||
.select('name, country_id')
|
||||
.ilike('name', '%la%')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `update()`
|
||||
|
||||
|
||||
|
||||
<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')
|
||||
.update({ name: 'Mordor' })
|
||||
.ilike('name', '%la%')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `delete()`
|
||||
|
||||
|
||||
|
||||
<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()
|
||||
.ilike('name', '%la%')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `rpc()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
// Only valid if the Stored Procedure returns a table type.
|
||||
const { data, error } = await supabase
|
||||
.rpc('echo_all_cities')
|
||||
.ilike('name', '%la%')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,226 +0,0 @@
|
||||
---
|
||||
id: in
|
||||
title: ".in()"
|
||||
slug: in
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
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`.
|
||||
|
||||
<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')
|
||||
.select('name, country_id')
|
||||
.in('name', ['Rio de Janeiro', 'San Francisco'])
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
column
|
||||
</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">
|
||||
|
||||
The column to filter on.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
values
|
||||
</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">
|
||||
|
||||
The values to filter with.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### With `select()`
|
||||
|
||||
|
||||
|
||||
<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')
|
||||
.select('name, country_id')
|
||||
.in('name', ['Rio de Janeiro', 'San Francisco'])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `update()`
|
||||
|
||||
|
||||
|
||||
<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')
|
||||
.update({ name: 'Mordor' })
|
||||
.in('name', ['Rio de Janeiro', 'San Francisco'])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `delete()`
|
||||
|
||||
|
||||
|
||||
<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()
|
||||
.in('name', ['Rio de Janeiro', 'San Francisco'])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `rpc()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
// Only valid if the Stored Procedure returns a table type.
|
||||
const { data, error } = await supabase
|
||||
.rpc('echo_all_cities')
|
||||
.in('name', ['Rio de Janeiro', 'San Francisco'])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,20 +0,0 @@
|
||||
---
|
||||
id: index
|
||||
title: "Supabase Client"
|
||||
slug: supabase-client
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
|
||||
Our client library is modular. Each sub-library is a standalone implementation for a single external system. This is one of the ways we support existing tools.
|
||||
|
||||
|
||||
| Repo | Official | Community |
|
||||
|-----------------------|--------------------------------------------------|------------------|
|
||||
| **`supabase-{lang}`** <br /> Combines libraries and adds enrichments. | [`JavaScript`](https://github.com/supabase/supabase-js) | [`C#`](https://github.com/supabase/supabase-csharp), [`Python`](https://github.com/supabase/supabase-py), `Rust` |
|
||||
| `postgrest-{lang}` <br /> Client library to work with [PostgREST](https://github.com/postgrest/postgrest) | [`JavaScript`](https://github.com/supabase/postgrest-js) | [`C#`](https://github.com/supabase/postgrest-csharp), [`Python`](https://github.com/supabase/postgrest-py), [`Rust`](https://github.com/supabase/postgrest-rs) |
|
||||
| `realtime-{lang}` <br /> Client library to work with [Realtime](https://github.com/supabase/realtime) | [`JavaScript`](https://github.com/supabase/realtime-js) | `C#`, `Python`, `Rust` |
|
||||
| `gotrue-{lang}` <br /> Client library to work with [GoTrue](https://github.com/netlify/gotrue) | [`JavaScript`](https://github.com/supabase/gotrue-js) | `C#`, `Python`, `Rust` |
|
||||
@@ -1,160 +0,0 @@
|
||||
---
|
||||
id: initializing
|
||||
title: "Initializing"
|
||||
slug: initializing
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
You can initialize a new Supabase client using the `createClient()` method.
|
||||
|
||||
|
||||
|
||||
|
||||
## Parameters
|
||||
|
||||
|
||||
<ul className="method-list-group">
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
supabaseUrl
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>string</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The unique Supabase URL which is supplied when you create a new project in your project dashboard.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
supabaseKey
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>string</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The unique Supabase Key which is supplied when you create a new project in your project dashboard.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
options
|
||||
</span>
|
||||
<span className="method-list-item-label-badge false">
|
||||
optional
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>SupabaseClientOptions</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### createClient()
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
import { createClient } from '@supabase/supabase-js'
|
||||
|
||||
// Create a single supabase client for interacting with your database
|
||||
const supabase = createClient("https://xyzcompany.supabase.co", "public-anon-key")
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With additional parameters
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
import { createClient } from '@supabase/supabase-js'
|
||||
|
||||
const options = { }
|
||||
const supabase = createClient("https://xyzcompany.supabase.co", "public-anon-key", options)
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,296 +0,0 @@
|
||||
---
|
||||
id: insert
|
||||
title: "Create data: insert()"
|
||||
slug: insert
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Performs an INSERT into 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')
|
||||
.insert([
|
||||
{ name: 'The Shire', country_id: 554 }
|
||||
])
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
values
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>Partial</code> | <code>array</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The values to insert.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<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">
|
||||
upsert
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>boolean</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
If `true`, performs an UPSERT.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<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">
|
||||
|
||||
By default the new record is returned. Set this to 'minimal' if you don't need this value.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
onConflict
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>undefined</code> | <code>string</code>
|
||||
</span>
|
||||
</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">
|
||||
count
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>null</code> | <code>exact</code> | <code>planned</code> | <code>estimated</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### Create a record
|
||||
|
||||
|
||||
|
||||
<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')
|
||||
.insert([
|
||||
{ name: 'The Shire', country_id: 554 }
|
||||
])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### Bulk create
|
||||
|
||||
|
||||
|
||||
<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')
|
||||
.insert([
|
||||
{ name: 'The Shire', country_id: 554 },
|
||||
{ name: 'Rohan', country_id: 555 },
|
||||
])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### Upsert
|
||||
|
||||
For upsert, if set to true, primary key columns would need to be included
|
||||
in the data parameter in order for an update to properly happen. Also, primary keys
|
||||
used must be natural, not surrogate. There are however,
|
||||
[workarounds](https://github.com/PostgREST/postgrest/issues/1118)
|
||||
for surrogate primary keys.
|
||||
|
||||
|
||||
<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')
|
||||
.insert(
|
||||
[
|
||||
{ name: 'The Shire', country_id: 554 },
|
||||
{ name: 'Rohan', country_id: 555 },
|
||||
{ name: 'City by the Bay', country_id:840}
|
||||
],
|
||||
{ upsert: true })
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,26 +0,0 @@
|
||||
---
|
||||
id: installing
|
||||
title: "Installing"
|
||||
slug: installing
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
All JavaScript libraries are built directly by the Supabase team.
|
||||
|
||||
Other languages are built by the community and supported by Supabase.
|
||||
|
||||
## JavaScript
|
||||
|
||||
```bash
|
||||
npm install @supabase/supabase-js
|
||||
```
|
||||
|
||||
Find the source code on [GitHub](https://github.com/supabase/supabase-js).
|
||||
|
||||
## Python
|
||||
|
||||
```bash
|
||||
# Not yet implemented
|
||||
@@ -1,226 +0,0 @@
|
||||
---
|
||||
id: is
|
||||
title: ".is()"
|
||||
slug: is
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
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`.
|
||||
|
||||
<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')
|
||||
.select('name, country_id')
|
||||
.is('name', null)
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
column
|
||||
</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">
|
||||
|
||||
The column to filter on.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
value
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>boolean</code> | <code>null</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The value to filter with.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### With `select()`
|
||||
|
||||
|
||||
|
||||
<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')
|
||||
.select('name, country_id')
|
||||
.is('name', null)
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `update()`
|
||||
|
||||
|
||||
|
||||
<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')
|
||||
.update({ name: 'Mordor' })
|
||||
.is('name', null)
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `delete()`
|
||||
|
||||
|
||||
|
||||
<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()
|
||||
.is('name', null)
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `rpc()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
// Only valid if the Stored Procedure returns a table type.
|
||||
const { data, error } = await supabase
|
||||
.rpc('echo_all_cities')
|
||||
.is('name', null)
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,226 +0,0 @@
|
||||
---
|
||||
id: like
|
||||
title: ".like()"
|
||||
slug: like
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
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).
|
||||
|
||||
<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')
|
||||
.select('name, country_id')
|
||||
.like('name', '%la%')
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
column
|
||||
</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">
|
||||
|
||||
The column to filter on.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
pattern
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>string</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The pattern to filter with.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### With `select()`
|
||||
|
||||
|
||||
|
||||
<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')
|
||||
.select('name, country_id')
|
||||
.like('name', '%la%')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `update()`
|
||||
|
||||
|
||||
|
||||
<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')
|
||||
.update({ name: 'Mordor' })
|
||||
.like('name', '%la%')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `delete()`
|
||||
|
||||
|
||||
|
||||
<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()
|
||||
.like('name', '%la%')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `rpc()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
// Only valid if the Stored Procedure returns a table type.
|
||||
const { data, error } = await supabase
|
||||
.rpc('echo_all_cities')
|
||||
.like('name', '%la%')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,189 +0,0 @@
|
||||
---
|
||||
id: limit
|
||||
title: "limit()"
|
||||
slug: limit
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Limits the result with the specified `count`.
|
||||
|
||||
<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')
|
||||
.select('name, country_id')
|
||||
.limit(1)
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
count
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>number</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The maximum no. of rows to limit to.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<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">
|
||||
foreignTable
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>undefined</code> | <code>string</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The foreign table to use (for foreign columns).
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### With `select()`
|
||||
|
||||
|
||||
|
||||
<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')
|
||||
.select('name, country_id')
|
||||
.limit(1)
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With embedded resources
|
||||
|
||||
|
||||
|
||||
<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')
|
||||
.select('name, cities(name)')
|
||||
.eq('name', 'United States')
|
||||
.limit(1, 'cities')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,226 +0,0 @@
|
||||
---
|
||||
id: lt
|
||||
title: ".lt()"
|
||||
slug: lt
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
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`.
|
||||
|
||||
<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')
|
||||
.select('name, country_id')
|
||||
.lt('country_id', 250)
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
column
|
||||
</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">
|
||||
|
||||
The column to filter on.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
value
|
||||
</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">
|
||||
|
||||
The value to filter with.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### With `select()`
|
||||
|
||||
|
||||
|
||||
<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')
|
||||
.select('name, country_id')
|
||||
.lt('country_id', 250)
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `update()`
|
||||
|
||||
|
||||
|
||||
<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')
|
||||
.update({ name: 'Mordor' })
|
||||
.lt('country_id', 250)
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `delete()`
|
||||
|
||||
|
||||
|
||||
<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()
|
||||
.lt('country_id', 250)
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `rpc()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
// Only valid if the Stored Procedure returns a table type.
|
||||
const { data, error } = await supabase
|
||||
.rpc('echo_all_cities')
|
||||
.lt('country_id', 250)
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,226 +0,0 @@
|
||||
---
|
||||
id: lte
|
||||
title: ".lte()"
|
||||
slug: lte
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
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`.
|
||||
|
||||
<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')
|
||||
.select('name, country_id')
|
||||
.lte('country_id', 250)
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
column
|
||||
</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">
|
||||
|
||||
The column to filter on.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
value
|
||||
</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">
|
||||
|
||||
The value to filter with.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### With `select()`
|
||||
|
||||
|
||||
|
||||
<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')
|
||||
.select('name, country_id')
|
||||
.lte('country_id', 250)
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `update()`
|
||||
|
||||
|
||||
|
||||
<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')
|
||||
.update({ name: 'Mordor' })
|
||||
.lte('country_id', 250)
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `delete()`
|
||||
|
||||
|
||||
|
||||
<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()
|
||||
.lte('country_id', 250)
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `rpc()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
// Only valid if the Stored Procedure returns a table type.
|
||||
const { data, error } = await supabase
|
||||
.rpc('echo_all_cities')
|
||||
.lte('country_id', 250)
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,205 +0,0 @@
|
||||
---
|
||||
id: match
|
||||
title: ".match()"
|
||||
slug: match
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Finds all rows whose columns match the specified `query` object.
|
||||
|
||||
<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')
|
||||
.select('name, country_id')
|
||||
.match({name: 'Beijing', country_id: 156})
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
query
|
||||
</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">
|
||||
|
||||
The object to filter with, with column names as keys mapped
|
||||
to their filter values.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### With `select()`
|
||||
|
||||
|
||||
|
||||
<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')
|
||||
.select('name, country_id')
|
||||
.match({name: 'Beijing', country_id: 156})
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `update()`
|
||||
|
||||
|
||||
|
||||
<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')
|
||||
.update({ name: 'Mordor' })
|
||||
.match({name: 'Beijing', country_id: 156})
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `delete()`
|
||||
|
||||
|
||||
|
||||
<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({name: 'Beijing', country_id: 156})
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `rpc()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
// Only valid if the Stored Procedure returns a table type.
|
||||
const { data, error } = await supabase
|
||||
.rpc('echo_all_cities')
|
||||
.match({name: 'Beijing', country_id: 156})
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,226 +0,0 @@
|
||||
---
|
||||
id: neq
|
||||
title: ".neq()"
|
||||
slug: neq
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
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`.
|
||||
|
||||
<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')
|
||||
.select('name, country_id')
|
||||
.neq('name', 'The shire')
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
column
|
||||
</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">
|
||||
|
||||
The column to filter on.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
value
|
||||
</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">
|
||||
|
||||
The value to filter with.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### With `select()`
|
||||
|
||||
|
||||
|
||||
<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')
|
||||
.select('name, country_id')
|
||||
.neq('name', 'The shire')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `update()`
|
||||
|
||||
|
||||
|
||||
<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')
|
||||
.update({ name: 'Mordor' })
|
||||
.neq('name', 'San Francisco')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `delete()`
|
||||
|
||||
|
||||
|
||||
<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()
|
||||
.neq('name', 'Mordor')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `rpc()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
// Only valid if the Stored Procedure returns a table type.
|
||||
const { data, error } = await supabase
|
||||
.rpc('echo_all_cities')
|
||||
.neq('name', 'Lagos')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,246 +0,0 @@
|
||||
---
|
||||
id: not
|
||||
title: ".not()"
|
||||
slug: not
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Finds all rows which doesn't satisfy the filter.
|
||||
|
||||
<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')
|
||||
.select('name, country_id')
|
||||
.not('name', 'eq', 'Paris')
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
column
|
||||
</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">
|
||||
|
||||
The column to filter on.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
operator
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>FilterOperator</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The operator to filter with.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
value
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>any</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The value to filter with.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### With `select()`
|
||||
|
||||
|
||||
|
||||
<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')
|
||||
.select('name, country_id')
|
||||
.not('name', 'eq', 'Paris')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `update()`
|
||||
|
||||
|
||||
|
||||
<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')
|
||||
.update({ name: 'Mordor' })
|
||||
.not('name', 'eq', 'Paris')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `delete()`
|
||||
|
||||
|
||||
|
||||
<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()
|
||||
.not('name', 'eq', 'Paris')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `rpc()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
// Only valid if the Stored Procedure returns a table type.
|
||||
const { data, error } = await supabase
|
||||
.rpc('echo_all_cities)
|
||||
.not('name', 'eq', 'Paris')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,226 +0,0 @@
|
||||
---
|
||||
id: nxl
|
||||
title: ".nxl()"
|
||||
slug: nxl
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
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`.
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase
|
||||
.from('countries')
|
||||
.select('name, id, population_range_millions')
|
||||
.nxl('population_range_millions', [150, 250])
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
column
|
||||
</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">
|
||||
|
||||
The column to filter on.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
range
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>string</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The range to filter with.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### With `select()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase
|
||||
.from('countries')
|
||||
.select('name, id, population_range_millions')
|
||||
.nxl('population_range_millions', [150, 250])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `update()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase
|
||||
.from('countries')
|
||||
.update({ name: 'Mordor' })
|
||||
.nxl('population_range_millions', [150, 250])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `delete()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase
|
||||
.from('countries')
|
||||
.delete()
|
||||
.nxl('population_range_millions', [150, 250])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `rpc()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
// Only valid if the Stored Procedure returns a table type.
|
||||
const { data, error } = await supabase
|
||||
.rpc('echo_all_countries')
|
||||
.nxl('population_range_millions', [150, 250])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,226 +0,0 @@
|
||||
---
|
||||
id: nxr
|
||||
title: ".nxr()"
|
||||
slug: nxr
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
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`.
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase
|
||||
.from('countries')
|
||||
.select('name, id, population_range_millions')
|
||||
.nxr('population_range_millions', [150, 250])
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
column
|
||||
</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">
|
||||
|
||||
The column to filter on.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
range
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>string</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The range to filter with.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### With `select()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase
|
||||
.from('countries')
|
||||
.select('name, id, population_range_millions')
|
||||
.nxr('population_range_millions', [150, 250])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `update()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase
|
||||
.from('countries')
|
||||
.update({ name: 'Mordor' })
|
||||
.nxr('population_range_millions', [150, 250])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `delete()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase
|
||||
.from('countries')
|
||||
.delete()
|
||||
.nxr('population_range_millions', [150, 250])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `rpc()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
// Only valid if the Stored Procedure returns a table type.
|
||||
const { data, error } = await supabase
|
||||
.rpc('echo_all_countries')
|
||||
.nxr('population_range_millions', [150, 250])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,293 +0,0 @@
|
||||
---
|
||||
id: on
|
||||
title: "Subscribing: on()"
|
||||
slug: on
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Subscribe to realtime changes in your databse.
|
||||
|
||||
<Tabs
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const mySubscription = supabase
|
||||
.from('*')
|
||||
.on('*', payload => {
|
||||
console.log('Change received!', payload)
|
||||
})
|
||||
.subscribe()
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
event
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
INSERT | UPDATE | DELETE | *
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The database event which you would like to receive updates for, or you can use the special wildcard `*` to listen to all changes.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
callback
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
object
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
A callback that will handle the payload that is sent whenever your database changes.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
## Notes
|
||||
|
||||
- If you want to receive the "previous" data for updates and deletes, you will need to set `REPLICA IDENTITY` to `FULL`, like this: `ALTER TABLE your_table REPLICA IDENTITY FULL;`
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### Listen to all database changes
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const mySubscription = supabase
|
||||
.from('*')
|
||||
.on('*', payload => {
|
||||
console.log('Change received!', payload)
|
||||
})
|
||||
.subscribe()
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### Listening to a specific table
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const mySubscription = supabase
|
||||
.from('countries')
|
||||
.on('*', payload => {
|
||||
console.log('Change received!', payload)
|
||||
})
|
||||
.subscribe()
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### Listening to inserts
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const mySubscription = supabase
|
||||
.from('countries')
|
||||
.on('INSERT', payload => {
|
||||
console.log('Change received!', payload)
|
||||
})
|
||||
.subscribe()
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### Listening to updates
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const mySubscription = supabase
|
||||
.from('countries')
|
||||
.on('UPDATE', payload => {
|
||||
console.log('Change received!', payload)
|
||||
})
|
||||
.subscribe()
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### Listening to deletes
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const mySubscription = supabase
|
||||
.from('countries')
|
||||
.on('DELETE', payload => {
|
||||
console.log('Change received!', payload)
|
||||
})
|
||||
.subscribe()
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### Listening to multiple events
|
||||
|
||||
You can chain listeners if you want to listen to multiple events for each table.
|
||||
|
||||
<Tabs
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const mySubscription = supabase
|
||||
.from('countries')
|
||||
.on('INSERT', handleRecordInserted)
|
||||
.on('DELETE', handleRecordDeleted)
|
||||
.subscribe()
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,142 +0,0 @@
|
||||
---
|
||||
id: or
|
||||
title: ".or()"
|
||||
slug: or
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Finds all rows satisfying at least one of the filters.
|
||||
|
||||
<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')
|
||||
.select('name, country_id')
|
||||
.or('id.eq.20,id.eq.30')
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
filters
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>string</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The filters to use, separated by commas.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### With `select()`
|
||||
|
||||
|
||||
|
||||
<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')
|
||||
.select('name, country_id')
|
||||
.or('id.eq.20,id.eq.30')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### User `or` with `and`
|
||||
|
||||
|
||||
|
||||
<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')
|
||||
.select('name, country_id')
|
||||
.or('id.gt.20,and(name.eq.New Zealand,name.eq.France)')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,231 +0,0 @@
|
||||
---
|
||||
id: order
|
||||
title: "order()"
|
||||
slug: order
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Orders the result with the specified `column`.
|
||||
|
||||
<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')
|
||||
.select('name', 'country_id')
|
||||
.order('id', { ascending: false })
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
column
|
||||
</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">
|
||||
|
||||
The column to order on.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<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">
|
||||
nullsFirst
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>boolean</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
If `true`, `null`s appear first.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
foreignTable
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>undefined</code> | <code>string</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The foreign table to use (if `column` is a foreign column).
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
ascending
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>boolean</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
If `true`, the result will be in ascending order.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### With `select()`
|
||||
|
||||
|
||||
|
||||
<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')
|
||||
.select('name', 'country_id')
|
||||
.order('id', { ascending: false })
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With embedded resources
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase
|
||||
.from('countries')
|
||||
.select('name, cities(name)')
|
||||
.eq('name', 'United States')
|
||||
.order('cities.name')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,226 +0,0 @@
|
||||
---
|
||||
id: ov
|
||||
title: ".ov()"
|
||||
slug: ov
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Finds all rows whose array or range value on the stated `column` is
|
||||
contained by the specified `value`.
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase
|
||||
.from('countries')
|
||||
.select('name, id, main_exports')
|
||||
.ova('main_exports', ['computers', 'minerals'])
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
column
|
||||
</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">
|
||||
|
||||
The column to filter on.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
value
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>string</code> | <code>array</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The value to filter with.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### With `select()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase
|
||||
.from('countries')
|
||||
.select('name, id, main_exports')
|
||||
.ova('main_exports', ['computers', 'minerals'])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `update()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
let countries = await supabase
|
||||
.from('countries')
|
||||
.update({ name: 'Mordor' })
|
||||
.ova('main_exports', ['computers', 'minerals'])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `delete()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase
|
||||
.from('countries')
|
||||
.delete()
|
||||
.ova('main_exports', ['computers', 'minerals'])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `rpc()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
// Only valid if the Stored Procedure returns a table type.
|
||||
const { data, error } = await supabase
|
||||
.rpc('echo_all_countries')
|
||||
.ova('main_exports', ['computers', 'minerals'])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,108 +0,0 @@
|
||||
---
|
||||
id: phfts
|
||||
title: ".phfts()"
|
||||
slug: phfts
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Finds all rows whose tsvector value on the stated `column` matches
|
||||
phraseto_tsquery(`query`).
|
||||
|
||||
|
||||
|
||||
## Parameters
|
||||
|
||||
|
||||
<ul className="method-list-group">
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
column
|
||||
</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">
|
||||
|
||||
The column to filter on.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
query
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>string</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The Postgres tsquery string to filter with.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<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">
|
||||
config
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>undefined</code> | <code>string</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The text search configuration to use.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
@@ -1,108 +0,0 @@
|
||||
---
|
||||
id: plfts
|
||||
title: ".plfts()"
|
||||
slug: plfts
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Finds all rows whose tsvector value on the stated `column` matches
|
||||
plainto_tsquery(`query`).
|
||||
|
||||
|
||||
|
||||
## Parameters
|
||||
|
||||
|
||||
<ul className="method-list-group">
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
column
|
||||
</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">
|
||||
|
||||
The column to filter on.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
query
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>string</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The Postgres tsquery string to filter with.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<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">
|
||||
config
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>undefined</code> | <code>string</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The text search configuration to use.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
@@ -1,178 +0,0 @@
|
||||
---
|
||||
id: range
|
||||
title: "range()"
|
||||
slug: range
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Limits the result to rows within the specified range, inclusive.
|
||||
|
||||
<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')
|
||||
.select('name, country_id')
|
||||
.range(0,3)
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
from
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>number</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The starting index from which to limit the result, inclusive.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
to
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>number</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The last index to which to limit the result, inclusive.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<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">
|
||||
foreignTable
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>undefined</code> | <code>string</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The foreign table to use (for foreign columns).
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### With `select()`
|
||||
|
||||
|
||||
|
||||
<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')
|
||||
.select('name, country_id')
|
||||
.range(0,3)
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,105 +0,0 @@
|
||||
---
|
||||
id: removesubscription
|
||||
title: "removeSubscription()"
|
||||
slug: removesubscription
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Removes an active subscription and returns the number of open connections.
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
supabase.removeSubscription(mySubscription)
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
subscription
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>RealtimeSubscription</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The subscription you want to remove.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### Remove a subscription
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
supabase.removeSubscription(mySubscription)
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,119 +0,0 @@
|
||||
---
|
||||
id: reset-password-email
|
||||
title: "Reset Password (Email)"
|
||||
slug: reset-password-email
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Sends a reset request to an email address.
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = supabase.auth.api.resetPasswordForEmail('user@email.com')
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
email
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>string</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The email address of the user.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
## Notes
|
||||
|
||||
Sends a reset request to an email address.
|
||||
|
||||
When the user clicks the reset link in the email they will be forwarded to:
|
||||
|
||||
`<SITE_URL>#access_token=x&refresh_token=y&expires_in=z&token_type=bearer&type=recovery`
|
||||
|
||||
Your app must detect `type=recovery` in the fragment and display a password reset form to the user.
|
||||
|
||||
You should then use the access_token in the url and new password to update the user as follows:
|
||||
|
||||
```js
|
||||
const { error, data } = await auth.api
|
||||
.updateUser(access_token, { password : new_password })
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### Reset password
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = supabase.auth.api.resetPasswordForEmail('user@email.com')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,263 +0,0 @@
|
||||
---
|
||||
id: rpc
|
||||
title: "Stored Procedures: rpc()"
|
||||
slug: rpc
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
You can call stored procedures as a "Remote Procedure Call".
|
||||
|
||||
That's a fancy way of saying that you can put some logic into your database then call it from anywhere.
|
||||
It's especially useful when the logic rarely changes - like password resets and updates.
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase
|
||||
.rpc('hello_world')
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
fn
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>string</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The function name to call.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
params
|
||||
</span>
|
||||
<span className="method-list-item-label-badge false">
|
||||
optional
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>undefined</code> | <code>object</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The parameters to pass to the function call.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### Call a stored procedure
|
||||
|
||||
This is an example invoking a stored procedure.
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase
|
||||
.rpc('hello_world')
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With Parameters
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase
|
||||
.rpc('echo_city', { name: 'The Shire' })
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### Bulk call
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase
|
||||
.rpc('echo_city', [
|
||||
{ name: 'The Shire' },
|
||||
{ name: 'Mordor' }
|
||||
])
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With filters.
|
||||
|
||||
Stored procedures that return tables can also be combined with
|
||||
[Modifiers](/docs/client/using-modifiers) and
|
||||
[Filters](/docs/client/using-filters).
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase
|
||||
.rpc('echo_all_cities')
|
||||
.eq('name', 'The Shire')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With count option
|
||||
|
||||
You can specify a count option to get the row count along with your data.
|
||||
Allowed values for count option are `null`, `exact`, `planned` and `estimated`.
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error, count } = await postgrest
|
||||
.from('cities')
|
||||
.rpc('hello_world', { count: 'exact' })
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,354 +0,0 @@
|
||||
---
|
||||
id: select
|
||||
title: "Fetch data: select()"
|
||||
slug: select
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Performs vertical filtering with SELECT.
|
||||
|
||||
<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')
|
||||
.select()
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
columns
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>string</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The columns to retrieve, separated by commas.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<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">
|
||||
head
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>boolean</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
When set to true, select will void data.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
count
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>null</code> | <code>exact</code> | <code>planned</code> | <code>estimated</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
Count algorithm to use to count rows in a table.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
## Notes
|
||||
|
||||
- `select()` can be combined with [Modifiers](/docs/client/using-modifiers)
|
||||
- `select()` can be combined with [Filters](/docs/client/using-filters)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### Getting your data
|
||||
|
||||
|
||||
|
||||
<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')
|
||||
.select()
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### Selecting specific columns
|
||||
|
||||
You can select specific fields from your tables.
|
||||
|
||||
<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')
|
||||
.select('name')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### Query foreign tables
|
||||
|
||||
If your database has relationships, you can query related tables too.
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase
|
||||
.from('countries')
|
||||
.select(`
|
||||
name,
|
||||
cities (
|
||||
name
|
||||
)
|
||||
`)
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### Query the same foreign table multiple times
|
||||
|
||||
Sometimes you will need to query the same foreign table twice.
|
||||
In this case, you can use the name of the joined column to identify
|
||||
which join you intend to use. For convenience, you can also give an
|
||||
alias for each column. For example, if we had a shop of products,
|
||||
and we wanted to get the supplier and the purchaser at the same time
|
||||
(both in the users) 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('products')
|
||||
.select(`
|
||||
id,
|
||||
supplier:supplier_id ( name ),
|
||||
purchaser:purchaser_id ( name )
|
||||
`)
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### Querying with count option
|
||||
|
||||
You can get the number of rows by using the count option.
|
||||
Allowed values for count option are `null`, `exact`, `planned` and `estimated`.
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error, count } = await postgrest
|
||||
.from('cities')
|
||||
.select('name', { count: 'exact' })
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### Quering JSON data
|
||||
|
||||
If you have data inside of a JSONB column, you can apply select
|
||||
and query filters to the data values. Postgres offers a
|
||||
[number of operators](https://www.postgresql.org/docs/current/functions-json.html)
|
||||
for querying JSON data. Also see
|
||||
[PostgREST docs](http://postgrest.org/en/v7.0.0/api.html#json-columns) for more details.
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase
|
||||
.from('users')
|
||||
.select(`
|
||||
id, name,
|
||||
address->street
|
||||
`)
|
||||
.eq('address->postcode', 90210)
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,88 +0,0 @@
|
||||
---
|
||||
id: single
|
||||
title: "single()"
|
||||
slug: single
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
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.
|
||||
|
||||
<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')
|
||||
.select('name, country_id')
|
||||
.single()
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### With `select()`
|
||||
|
||||
|
||||
|
||||
<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')
|
||||
.select('name, country_id')
|
||||
.single()
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,226 +0,0 @@
|
||||
---
|
||||
id: sl
|
||||
title: ".sl()"
|
||||
slug: sl
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
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`.
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase
|
||||
.from('countries')
|
||||
.select('name, id, population_range_millions')
|
||||
.sl('population_range_millions', [150, 250])
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
column
|
||||
</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">
|
||||
|
||||
The column to filter on.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
range
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>string</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The range to filter with.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### With `select()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase
|
||||
.from('countries')
|
||||
.select('name, id, population_range_millions')
|
||||
.sl('population_range_millions', [150, 250])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `update()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase
|
||||
.from('countries')
|
||||
.update({ name: 'Mordor' })
|
||||
.sl('population_range_millions', [150, 250])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `delete()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase
|
||||
.from('countries')
|
||||
.delete()
|
||||
.sl('population_range_millions', [150, 250])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `rpc()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
// Only valid if the Stored Procedure returns a table type.
|
||||
const { data, error } = await supabase
|
||||
.rpc('echo_all_countries')
|
||||
.sl('population_range_millions', [150, 250])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,226 +0,0 @@
|
||||
---
|
||||
id: sr
|
||||
title: ".sr()"
|
||||
slug: sr
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
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`.
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase
|
||||
.from('countries')
|
||||
.select('name, id, population_range_millions')
|
||||
.sr('population_range_millions', [150, 250])
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
column
|
||||
</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">
|
||||
|
||||
The column to filter on.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
range
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>string</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The range to filter with.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### With `select()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase
|
||||
.from('countries')
|
||||
.select('name, id, population_range_millions')
|
||||
.sr('population_range_millions', [150, 250])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `update()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase
|
||||
.from('countries')
|
||||
.update({ name: 'Mordor' })
|
||||
.sr('population_range_millions', [150, 250])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `delete()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase
|
||||
.from('countries')
|
||||
.delete()
|
||||
.sr('population_range_millions', [150, 250])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `rpc()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
// Only valid if the Stored Procedure returns a table type.
|
||||
const { data, error } = await supabase
|
||||
.rpc('echo_all_countries')
|
||||
.sr('population_range_millions', [150, 250])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,344 +0,0 @@
|
||||
---
|
||||
id: subscribe
|
||||
title: "on().subscribe()"
|
||||
slug: subscribe
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Subscribe to realtime changes in your databse.
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const mySubscription = supabase
|
||||
.from('*')
|
||||
.on('*', payload => {
|
||||
console.log('Change received!', payload)
|
||||
})
|
||||
.subscribe()
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
event
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>INSERT</code> | <code>UPDATE</code> | <code>DELETE</code> | <code>*</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The database event which you would like to receive updates for, or you can use the special wildcard `*` to listen to all changes.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
callback
|
||||
</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">
|
||||
|
||||
A callback that will handle the payload that is sent whenever your database changes.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
## Notes
|
||||
|
||||
- If you want to receive the "previous" data for updates and deletes, you will need to set `REPLICA IDENTITY` to `FULL`, like this: `ALTER TABLE your_table REPLICA IDENTITY FULL;`
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### Listen to all database changes
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const mySubscription = supabase
|
||||
.from('*')
|
||||
.on('*', payload => {
|
||||
console.log('Change received!', payload)
|
||||
})
|
||||
.subscribe()
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### Listening to a specific table
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const mySubscription = supabase
|
||||
.from('countries')
|
||||
.on('*', payload => {
|
||||
console.log('Change received!', payload)
|
||||
})
|
||||
.subscribe()
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### Listening to inserts
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const mySubscription = supabase
|
||||
.from('countries')
|
||||
.on('INSERT', payload => {
|
||||
console.log('Change received!', payload)
|
||||
})
|
||||
.subscribe()
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### Listening to updates
|
||||
|
||||
By default Supabase will send only the updated record. If you want to receive the previous values as well you can
|
||||
enable full replication for the table you are listening too:
|
||||
|
||||
```sql
|
||||
alter table "your_table" replica identity full;
|
||||
```
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const mySubscription = supabase
|
||||
.from('countries')
|
||||
.on('UPDATE', payload => {
|
||||
console.log('Change received!', payload)
|
||||
})
|
||||
.subscribe()
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### Listening to deletes
|
||||
|
||||
By default Supabase not send deleted records. If you want to receive the deleted record you can
|
||||
enable full replication for the table you are listening too:
|
||||
|
||||
```sql
|
||||
alter table "your_table" replica identity full;
|
||||
```
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const mySubscription = supabase
|
||||
.from('countries')
|
||||
.on('DELETE', payload => {
|
||||
console.log('Change received!', payload)
|
||||
})
|
||||
.subscribe()
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### Listening to multiple events
|
||||
|
||||
You can chain listeners if you want to listen to multiple events for each table.
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const mySubscription = supabase
|
||||
.from('countries')
|
||||
.on('INSERT', handleRecordInserted)
|
||||
.on('DELETE', handleRecordDeleted)
|
||||
.subscribe()
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### Listening to row level changes
|
||||
|
||||
You can listen to individual rows using the format `{table}:{col}=eq.{val}` - where `{col}` is the column name, and `{val}` is the value which you want to match.
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const mySubscription = supabase
|
||||
.from('countries:id=eq.200')
|
||||
.on('UPDATE', handleRecordUpdated)
|
||||
.subscribe()
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,219 +0,0 @@
|
||||
---
|
||||
id: update
|
||||
title: "Modify data: update()"
|
||||
slug: update
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Performs an UPDATE 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')
|
||||
.update({ name: 'Middle Earth' })
|
||||
.match({ name: 'Auckland' })
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
values
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>Partial</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The values to update.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<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">
|
||||
|
||||
By default the updated record is returned. Set this to 'minimal' if you don't need this value.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
count
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>null</code> | <code>exact</code> | <code>planned</code> | <code>estimated</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
## Notes
|
||||
|
||||
- `update()` should always be combined with [Filters](/docs/client/using-filters) to target the item(s) you wish to update.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### Updating your data
|
||||
|
||||
|
||||
|
||||
<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')
|
||||
.update({ name: 'Middle Earth' })
|
||||
.match({ name: 'Auckland' })
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### Updating JSON data
|
||||
|
||||
Postgres offers a
|
||||
[number of operators](https://www.postgresql.org/docs/current/functions-json.html)
|
||||
for working with JSON data. Right now it is only possible to update an entire JSON document,
|
||||
but we are [working on ideas](https://github.com/PostgREST/postgrest/issues/465) for updating individual keys.
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await supabase
|
||||
.from('users')
|
||||
.update(`
|
||||
address: {
|
||||
street: 'Melrose Place',
|
||||
postcode: 90210
|
||||
}
|
||||
`)
|
||||
.eq('address->postcode', 90210)
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,13 +0,0 @@
|
||||
---
|
||||
id: using-filters
|
||||
title: "Using Filters"
|
||||
slug: using-filters
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Filters can be used on `select()`, `update()`, and `delete()` queries.
|
||||
|
||||
If a Stored Procedure returns a table response, you can also apply filters.
|
||||
@@ -1,13 +0,0 @@
|
||||
---
|
||||
id: using-modifiers
|
||||
title: "Using Modifiers"
|
||||
slug: using-modifiers
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Modifiers can be used on `select()` queries.
|
||||
|
||||
If a Stored Procedure returns a table response, you can also apply modifiers to the `rpc()` function.
|
||||
@@ -1,108 +0,0 @@
|
||||
---
|
||||
id: wfts
|
||||
title: ".wfts()"
|
||||
slug: wfts
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supabase.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Finds all rows whose tsvector value on the stated `column` matches
|
||||
websearch_to_tsquery(`query`).
|
||||
|
||||
|
||||
|
||||
## Parameters
|
||||
|
||||
|
||||
<ul className="method-list-group">
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
column
|
||||
</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">
|
||||
|
||||
The column to filter on.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
query
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>string</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The Postgres tsquery string to filter with.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<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">
|
||||
config
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>undefined</code> | <code>string</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The text search configuration to use.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
Whitespace-only changes.
@@ -1,85 +0,0 @@
|
||||
---
|
||||
id: api-getuser
|
||||
title: "api.getUser"
|
||||
slug: api-getuser
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/gotrue.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Gets the user details.
|
||||
|
||||
|
||||
|
||||
## Parameters
|
||||
|
||||
|
||||
<ul className="method-list-group">
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
jwt
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>string</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
A valid, logged-in JWT.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### Get the user details for a given user
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { error, data } = await auth.api
|
||||
.getUser(access_token)
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
|
||||
```
|
||||
Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,85 +0,0 @@
|
||||
---
|
||||
id: api-inviteuserbyemail
|
||||
title: "api.inviteUserByEmail"
|
||||
slug: api-inviteuserbyemail
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/gotrue.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Sends an invite link to an email address.
|
||||
|
||||
|
||||
|
||||
## Parameters
|
||||
|
||||
|
||||
<ul className="method-list-group">
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
email
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>string</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The email address of the user.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### Send a user an invite link to sign up via email
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { error, data } = await auth.api
|
||||
.inviteUserByEmail('example@email.com')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
|
||||
```
|
||||
Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,85 +0,0 @@
|
||||
---
|
||||
id: api-refreshaccesstoken
|
||||
title: "api.refreshAccessToken"
|
||||
slug: api-refreshaccesstoken
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/gotrue.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Generates a new JWT.
|
||||
|
||||
|
||||
|
||||
## Parameters
|
||||
|
||||
|
||||
<ul className="method-list-group">
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
refreshToken
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>string</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
A valid refresh token that was returned on login.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### Get a new access and refresh token using a valid refresh_token
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { error, data } = await auth.api
|
||||
.refreshAccessToken(refresh_token)
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
|
||||
```
|
||||
Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,99 +0,0 @@
|
||||
---
|
||||
id: api-resetpasswordforemail
|
||||
title: "api.resetPasswordForEmail"
|
||||
slug: api-resetpasswordforemail
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/gotrue.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Sends a reset request to an email address.
|
||||
|
||||
|
||||
|
||||
## Parameters
|
||||
|
||||
|
||||
<ul className="method-list-group">
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
email
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>string</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The email address of the user.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
## Notes
|
||||
|
||||
Sends a reset request to an email address.
|
||||
|
||||
When the user clicks the reset link in the email they will be forwarded to:
|
||||
|
||||
`<SITE_URL>#access_token=x&refresh_token=y&expires_in=z&token_type=bearer&type=recovery`
|
||||
|
||||
Your app must detect `type=recovery` in the fragment and display a password reset form to the user.
|
||||
|
||||
You should then use the access_token in the url and new password to update the user as follows:
|
||||
|
||||
```js
|
||||
const { error, data } = await auth.api
|
||||
.updateUser(access_token, { password : new_password })
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### Send a user a password reset email
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { error, data } = await auth.api
|
||||
.resetPasswordForEmail('example@email.com')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
|
||||
```
|
||||
Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,85 +0,0 @@
|
||||
---
|
||||
id: api-sendmagiclinkemail
|
||||
title: "api.sendMagicLinkEmail"
|
||||
slug: api-sendmagiclinkemail
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/gotrue.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Sends a magic login link to an email address.
|
||||
|
||||
|
||||
|
||||
## Parameters
|
||||
|
||||
|
||||
<ul className="method-list-group">
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
email
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>string</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The email address of the user.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### Send user a passwordless login link via email
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { error, data } = await auth.api
|
||||
.sendMagicLinkEmail('example@email.com')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
|
||||
```
|
||||
Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,106 +0,0 @@
|
||||
---
|
||||
id: api-signinwithemail
|
||||
title: "api.signInWithEmail"
|
||||
slug: api-signinwithemail
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/gotrue.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Logs in an existing user using their email address.
|
||||
|
||||
|
||||
|
||||
## Parameters
|
||||
|
||||
|
||||
<ul className="method-list-group">
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
email
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>string</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The email address of the user.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
password
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>string</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The password of the user.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### Sign in a user with email
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { error, data } = await auth.api
|
||||
.signInWithEmail('example@email.com', 'example-password')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
|
||||
```
|
||||
Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,85 +0,0 @@
|
||||
---
|
||||
id: api-signout
|
||||
title: "api.signOut"
|
||||
slug: api-signout
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/gotrue.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Removes a logged-in session.
|
||||
|
||||
|
||||
|
||||
## Parameters
|
||||
|
||||
|
||||
<ul className="method-list-group">
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
jwt
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>string</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
A valid, logged-in JWT.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### Sign a user out
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { error, data } = await auth.api
|
||||
.signOut(access_token)
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
|
||||
```
|
||||
Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,106 +0,0 @@
|
||||
---
|
||||
id: api-signupwithemail
|
||||
title: "api.signUpWithEmail"
|
||||
slug: api-signupwithemail
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/gotrue.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Creates a new user using their email address.
|
||||
|
||||
|
||||
|
||||
## Parameters
|
||||
|
||||
|
||||
<ul className="method-list-group">
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
email
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>string</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The email address of the user.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
password
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>string</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The password of the user.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### Sign up a new user with email
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { error, data } = await auth.api
|
||||
.signUpWithEmail('example@email.com', 'example-password')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
|
||||
```
|
||||
Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,106 +0,0 @@
|
||||
---
|
||||
id: api-updateuser
|
||||
title: "api.updateUser"
|
||||
slug: api-updateuser
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/gotrue.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Updates the user data.
|
||||
|
||||
|
||||
|
||||
## Parameters
|
||||
|
||||
|
||||
<ul className="method-list-group">
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
jwt
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>string</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
A valid, logged-in JWT.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
attributes
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>UserAttributes</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The data you want to update.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### Update user info that Gotrue holds (also used for setting new passwords)
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { error, data } = await auth.api
|
||||
.updateUser(access_token, { password : 'Why Shinji?' })
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
|
||||
```
|
||||
Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,13 +0,0 @@
|
||||
---
|
||||
id: index
|
||||
title: "GoTrue Client"
|
||||
slug: gotrue-client
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/gotrue.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
GoTrue is an authentication server.
|
||||
|
||||
Supabase provides client libraries to interact with the server
|
||||
@@ -1,276 +0,0 @@
|
||||
---
|
||||
id: initializing
|
||||
title: "Initializing"
|
||||
slug: initializing
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/gotrue.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Create a new client for use in the browser.
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
import { GoTrueClient } from '@supabase/gotrue-js'
|
||||
|
||||
const auth = new GoTrueClient({
|
||||
url: "https://your-gotrue-url.com",
|
||||
headers: {
|
||||
apikey:
|
||||
"<SOME-API-KEY>",
|
||||
Authorization:
|
||||
"Bearer <SOME-JWT>",
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
options
|
||||
</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">
|
||||
autoRefreshToken
|
||||
</span>
|
||||
<span className="method-list-item-label-badge false">
|
||||
optional
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>undefined</code> | <code>false</code> | <code>true</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
Set to "true" if you want to automatically refresh the token before expiring.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
cookieOptions
|
||||
</span>
|
||||
<span className="method-list-item-label-badge false">
|
||||
optional
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>CookieOptions</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
detectSessionInUrl
|
||||
</span>
|
||||
<span className="method-list-item-label-badge false">
|
||||
optional
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>undefined</code> | <code>false</code> | <code>true</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
Set to "true" if you want to automatically detects OAuth grants in the URL and signs in the user.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
headers
|
||||
</span>
|
||||
<span className="method-list-item-label-badge false">
|
||||
optional
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>undefined</code> | <code>reflection</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
Any additional headers to send to the GoTrue server.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
localStorage
|
||||
</span>
|
||||
<span className="method-list-item-label-badge false">
|
||||
optional
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>Storage</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
persistSession
|
||||
</span>
|
||||
<span className="method-list-item-label-badge false">
|
||||
optional
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>undefined</code> | <code>false</code> | <code>true</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
Set to "true" if you want to automatically save the user session into local storage.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
url
|
||||
</span>
|
||||
<span className="method-list-item-label-badge false">
|
||||
optional
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>undefined</code> | <code>string</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The URL of the GoTrue server.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### Initialize a GoTrue client
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
import { GoTrueClient } from '@supabase/gotrue-js'
|
||||
|
||||
const auth = new GoTrueClient({
|
||||
url: "https://your-gotrue-url.com",
|
||||
headers: {
|
||||
apikey:
|
||||
"<SOME-API-KEY>",
|
||||
Authorization:
|
||||
"Bearer <SOME-JWT>",
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,25 +0,0 @@
|
||||
---
|
||||
id: installing
|
||||
title: "Installing"
|
||||
slug: installing
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/gotrue.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
All JavaScript libraries are built directly by the Supabase team.
|
||||
|
||||
Other languages are built by the community and supported by Supabase.
|
||||
|
||||
## JavaScript
|
||||
|
||||
```bash
|
||||
npm install @supabase/gotrue-js
|
||||
```
|
||||
|
||||
## Python
|
||||
|
||||
```bash
|
||||
# Not yet implemented
|
||||
```
|
||||
@@ -1,9 +0,0 @@
|
||||
---
|
||||
id: onauthstatechange
|
||||
title: "onAuthStateChange"
|
||||
slug: onauthstatechange
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/gotrue.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
@@ -1,60 +0,0 @@
|
||||
---
|
||||
id: session
|
||||
title: "session"
|
||||
slug: session
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/gotrue.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Returns the session data, if there is an active session.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### Get user
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const session = auth.session()
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
|
||||
```
|
||||
Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,190 +0,0 @@
|
||||
---
|
||||
id: signin
|
||||
title: "signIn"
|
||||
slug: signin
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/gotrue.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Log in an existing user, or login via a third-party provider.
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
// with email and password
|
||||
const { user, error } = await auth.signIn({
|
||||
email: 'example@email.com',
|
||||
password: 'example-password',
|
||||
})
|
||||
|
||||
// send magic link (passwordless link)
|
||||
const { user, error } = await auth.signIn({
|
||||
email: 'example@email.com',
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
credentials
|
||||
</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">
|
||||
|
||||
The user login details.
|
||||
|
||||
</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">
|
||||
email
|
||||
</span>
|
||||
<span className="method-list-item-label-badge false">
|
||||
optional
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>undefined</code> | <code>string</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The user's email address.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
password
|
||||
</span>
|
||||
<span className="method-list-item-label-badge false">
|
||||
optional
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>undefined</code> | <code>string</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The user's password.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
provider
|
||||
</span>
|
||||
<span className="method-list-item-label-badge false">
|
||||
optional
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>Provider</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
One of the providers supported by GoTrue.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### Sign in
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
// with email and password
|
||||
const { user, error } = await auth.signIn({
|
||||
email: 'example@email.com',
|
||||
password: 'example-password',
|
||||
})
|
||||
|
||||
// send magic link (passwordless link)
|
||||
const { user, error } = await auth.signIn({
|
||||
email: 'example@email.com',
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,60 +0,0 @@
|
||||
---
|
||||
id: signout
|
||||
title: "signOut"
|
||||
slug: signout
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/gotrue.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Signs out the current user, if there is a logged in user.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### Sign out
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { error } = await auth.signOut()
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
|
||||
```
|
||||
Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,135 +0,0 @@
|
||||
---
|
||||
id: signup
|
||||
title: "signUp"
|
||||
slug: signup
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/gotrue.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Creates a new user.
|
||||
|
||||
|
||||
|
||||
## Parameters
|
||||
|
||||
|
||||
<ul className="method-list-group">
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
credentials
|
||||
</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">
|
||||
|
||||
The user login details.
|
||||
|
||||
</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">
|
||||
password
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>string</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The user's password.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
email
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>string</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The user's email address.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
## Notes
|
||||
|
||||
- A user can sign up either via email or OAuth.
|
||||
- If you provide `email`, `password` is also required
|
||||
- If you provide `access_token`, `password` is also required
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### Sign up
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { error, data } = await auth.signUp({
|
||||
email: 'example@email.com',
|
||||
password: 'example-password',
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,109 +0,0 @@
|
||||
---
|
||||
id: update
|
||||
title: "update"
|
||||
slug: update
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/gotrue.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Updates user data, if there is a logged in user.
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { user, error } = await auth.update({
|
||||
data: { hello: 'world' }
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
attributes
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>UserAttributes</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### Update a user's metadata.
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { user, error } = await auth.update({
|
||||
data: { hello: 'world' }
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,60 +0,0 @@
|
||||
---
|
||||
id: user
|
||||
title: "user"
|
||||
slug: user
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/gotrue.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Returns the user data, if there is a logged in user.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### Get user
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const user = auth.user()
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
|
||||
```
|
||||
Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
Whitespace-only changes.
@@ -1,226 +0,0 @@
|
||||
---
|
||||
id: adj
|
||||
title: "adj"
|
||||
slug: adj
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/postgrest.yml
|
||||
---
|
||||
|
||||
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`.
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('countries')
|
||||
.select('name, id, population_range_millions')
|
||||
.adj('population_range_millions', [70, 185])
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
column
|
||||
</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">
|
||||
|
||||
The column to filter on.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
range
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>string</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The range to filter with.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### With `select()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('countries')
|
||||
.select('name, id, population_range_millions')
|
||||
.adj('population_range_millions', [70, 185])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `update()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('countries')
|
||||
.update({ name: 'Mordor' })
|
||||
.adj('population_range_millions', [70, 185])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `delete()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('countries')
|
||||
.delete()
|
||||
.adj('population_range_millions', [70, 185])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `rpc()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
// Only valid if the Stored Procedure returns a table type.
|
||||
const { data, error } = await postgrest
|
||||
.rpc('echo_all_countries')
|
||||
.adj('population_range_millions', [70, 185])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,226 +0,0 @@
|
||||
---
|
||||
id: cd
|
||||
title: "cd"
|
||||
slug: cd
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/postgrest.yml
|
||||
---
|
||||
|
||||
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`.
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('countries')
|
||||
.select('name, id, main_exports')
|
||||
.cd('main_exports', ['cars', 'food', 'machine'])
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
column
|
||||
</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">
|
||||
|
||||
The column to filter on.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
value
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>string</code> | <code>array</code> | <code>object</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The value to filter with.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### With `select()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('countries')
|
||||
.select('name, id, main_exports')
|
||||
.cd('main_exports', ['cars', 'food', 'machine'])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `update()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('countries')
|
||||
.update({ name: 'Mordor' })
|
||||
.cd('main_exports', ['orks', 'surveillance', 'evil'])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `delete()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('countries')
|
||||
.delete()
|
||||
.cd('main_exports', ['cars', 'food', 'machine'])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `rpc()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
// Only valid if the Stored Procedure returns a table type.
|
||||
const { data, error } = await postgrest
|
||||
.rpc('echo_all_countries')
|
||||
.cd('main_exports', ['cars', 'food', 'machine'])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,226 +0,0 @@
|
||||
---
|
||||
id: cs
|
||||
title: "cs"
|
||||
slug: cs
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/postgrest.yml
|
||||
---
|
||||
|
||||
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`.
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('countries')
|
||||
.select('name, id, main_exports')
|
||||
.cs('main_exports', ['oil'])
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
column
|
||||
</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">
|
||||
|
||||
The column to filter on.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
value
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>string</code> | <code>array</code> | <code>object</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The value to filter with.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### With `select()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('countries')
|
||||
.select('name, id, main_exports')
|
||||
.cs('main_exports', ['oil'])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `update()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('countries')
|
||||
.update({ name: 'Mordor' })
|
||||
.cs('main_exports', ['oil'])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `delete()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('countries')
|
||||
.delete()
|
||||
.cs('main_exports', ['oil'])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `rpc()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
// Only valid if the Stored Procedure returns a table type.
|
||||
const { data, error } = await postgrest
|
||||
.rpc('echo_all_countries')
|
||||
.cs('main_exports', ['oil'])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,157 +0,0 @@
|
||||
---
|
||||
id: delete
|
||||
title: "delete"
|
||||
slug: delete
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/postgrest.yml
|
||||
---
|
||||
|
||||
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 postgrest
|
||||
.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>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
count
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>null</code> | <code>exact</code> | <code>planned</code> | <code>estimated</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## 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 postgrest
|
||||
.from('cities')
|
||||
.delete()
|
||||
.match({ id: 666 })
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,226 +0,0 @@
|
||||
---
|
||||
id: eq
|
||||
title: "eq"
|
||||
slug: eq
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/postgrest.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Finds all rows whose value on the stated `column` exactly matches the
|
||||
specified `value`.
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('cities')
|
||||
.select('name, country_id')
|
||||
.eq('name', 'The shire')
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
column
|
||||
</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">
|
||||
|
||||
The column to filter on.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
value
|
||||
</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">
|
||||
|
||||
The value to filter with.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### With `select()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('cities')
|
||||
.select('name, country_id')
|
||||
.eq('name', 'The shire')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `update()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('cities')
|
||||
.update({ name: 'Mordor' })
|
||||
.eq('name', 'San Francisco')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `delete()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('cities')
|
||||
.delete()
|
||||
.eq('name', 'Mordor')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `rpc()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
// Only valid if the Stored Procedure returns a table type.
|
||||
const { data, error } = await postgrest
|
||||
.rpc('echo_all_cities')
|
||||
.eq('name', 'San Francisco')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,277 +0,0 @@
|
||||
---
|
||||
id: filter
|
||||
title: "filter"
|
||||
slug: filter
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/postgrest.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Finds all rows whose `column` satisfies the filter.
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('cities')
|
||||
.select('name, country_id')
|
||||
.filter('name', 'eq', 'Paris')
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
column
|
||||
</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">
|
||||
|
||||
The column to filter on.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
operator
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>FilterOperator</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The operator to filter with.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
value
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>any</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The value to filter with.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### With `select()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('cities')
|
||||
.select('name, country_id')
|
||||
.filter('name', 'eq', 'Paris')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `update()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('cities')
|
||||
.update({ name: 'Mordor' })
|
||||
.filter('name', 'eq', 'Paris')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `delete()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('cities')
|
||||
.delete()
|
||||
.filter('name', 'eq', 'Paris')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `rpc()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
// Only valid if the Stored Procedure returns a table type.
|
||||
const { data, error } = await postgrest
|
||||
.rpc('echo_all_cities')
|
||||
.filter('name', 'eq', 'Paris')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### Filter embedded resources
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('cities')
|
||||
.select('name, countries ( name )')
|
||||
.filter('countries.name', 'eq', 'France')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,40 +0,0 @@
|
||||
---
|
||||
id: from
|
||||
title: "from"
|
||||
slug: from
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/postgrest.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Perform a table operation.
|
||||
|
||||
|
||||
|
||||
## Parameters
|
||||
|
||||
|
||||
<ul className="method-list-group">
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
table
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>string</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The table name to operate on.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
@@ -1,108 +0,0 @@
|
||||
---
|
||||
id: fts
|
||||
title: "fts"
|
||||
slug: fts
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/postgrest.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Finds all rows whose tsvector value on the stated `column` matches
|
||||
to_tsquery(`query`).
|
||||
|
||||
|
||||
|
||||
## Parameters
|
||||
|
||||
|
||||
<ul className="method-list-group">
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
column
|
||||
</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">
|
||||
|
||||
The column to filter on.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
query
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>string</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The Postgres tsquery string to filter with.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<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">
|
||||
config
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>undefined</code> | <code>string</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The text search configuration to use.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
@@ -1,226 +0,0 @@
|
||||
---
|
||||
id: gt
|
||||
title: "gt"
|
||||
slug: gt
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/postgrest.yml
|
||||
---
|
||||
|
||||
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`.
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('cities')
|
||||
.select('name, country_id')
|
||||
.gt('country_id', 250)
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
column
|
||||
</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">
|
||||
|
||||
The column to filter on.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
value
|
||||
</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">
|
||||
|
||||
The value to filter with.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### With `select()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('cities')
|
||||
.select('name, country_id')
|
||||
.gt('country_id', 250)
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `update()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('cities')
|
||||
.update({ name: 'Mordor' })
|
||||
.gt('country_id', 250)
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `delete()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('cities')
|
||||
.delete()
|
||||
.gt('country_id', 250)
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `rpc()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
// Only valid if the Stored Procedure returns a table type.
|
||||
const { data, error } = await postgrest
|
||||
.rpc('echo_all_cities')
|
||||
.gt('country_id', 250)
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,226 +0,0 @@
|
||||
---
|
||||
id: gte
|
||||
title: "gte"
|
||||
slug: gte
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/postgrest.yml
|
||||
---
|
||||
|
||||
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`.
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('cities')
|
||||
.select('name, country_id')
|
||||
.gte('country_id', 250)
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
column
|
||||
</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">
|
||||
|
||||
The column to filter on.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
value
|
||||
</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">
|
||||
|
||||
The value to filter with.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### With `select()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('cities')
|
||||
.select('name, country_id')
|
||||
.gte('country_id', 250)
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `update()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('cities')
|
||||
.update({ name: 'Mordor' })
|
||||
.gte('country_id', 250)
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `delete()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('cities')
|
||||
.delete()
|
||||
.gte('country_id', 250)
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `rpc()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
// Only valid if the Stored Procedure returns a table type.
|
||||
const { data, error } = await postgrest
|
||||
.rpc('echo_all_cities')
|
||||
.gte('country_id', 250)
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,226 +0,0 @@
|
||||
---
|
||||
id: ilike
|
||||
title: "ilike"
|
||||
slug: ilike
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/postgrest.yml
|
||||
---
|
||||
|
||||
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).
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('cities')
|
||||
.select('name, country_id')
|
||||
.ilike('name', '%la%')
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
column
|
||||
</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">
|
||||
|
||||
The column to filter on.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
pattern
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>string</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The pattern to filter with.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### With `select()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('cities')
|
||||
.select('name, country_id')
|
||||
.ilike('name', '%la%')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `update()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('cities')
|
||||
.update({ name: 'Mordor' })
|
||||
.ilike('name', '%la%')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `delete()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('cities')
|
||||
.delete()
|
||||
.ilike('name', '%la%')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `rpc()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
// Only valid if the Stored Procedure returns a table type.
|
||||
const { data, error } = await postgrest
|
||||
.rpc('echo_all_cities')
|
||||
.ilike('name', '%la%')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,226 +0,0 @@
|
||||
---
|
||||
id: in
|
||||
title: "in"
|
||||
slug: in
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/postgrest.yml
|
||||
---
|
||||
|
||||
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`.
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('cities')
|
||||
.select('name, country_id')
|
||||
.in('name', ['Rio de Janeiro', 'San Francisco'])
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
column
|
||||
</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">
|
||||
|
||||
The column to filter on.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
values
|
||||
</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">
|
||||
|
||||
The values to filter with.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### With `select()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('cities')
|
||||
.select('name, country_id')
|
||||
.in('name', ['Rio de Janeiro', 'San Francisco'])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `update()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('cities')
|
||||
.update({ name: 'Mordor' })
|
||||
.in('name', ['Rio de Janeiro', 'San Francisco'])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `delete()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('cities')
|
||||
.delete()
|
||||
.in('name', ['Rio de Janeiro', 'San Francisco'])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `rpc()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
// Only valid if the Stored Procedure returns a table type.
|
||||
const { data, error } = await postgrest
|
||||
.rpc('echo_all_cities')
|
||||
.in('name', ['Rio de Janeiro', 'San Francisco'])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,13 +0,0 @@
|
||||
---
|
||||
id: index
|
||||
title: "PostgREST Client"
|
||||
slug: postgrest-client
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/postgrest.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
PostgREST is a standalone web server that turns your PostgreSQL database directly into a RESTful API.
|
||||
|
||||
Supabase provides client libraries to interact with the PostgREST.
|
||||
@@ -1,107 +0,0 @@
|
||||
---
|
||||
id: initializing
|
||||
title: "Initializing"
|
||||
slug: initializing
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/postgrest.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Creates a PostgREST client.
|
||||
|
||||
|
||||
|
||||
## Parameters
|
||||
|
||||
|
||||
<ul className="method-list-group">
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
url
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>string</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
URL of the PostgREST endpoint.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<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">
|
||||
schema
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>undefined</code> | <code>string</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
Postgres schema to switch to.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
headers
|
||||
</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">
|
||||
|
||||
Custom headers.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
@@ -1,296 +0,0 @@
|
||||
---
|
||||
id: insert
|
||||
title: "insert"
|
||||
slug: insert
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/postgrest.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Performs an INSERT into the table.
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('cities')
|
||||
.insert([
|
||||
{ name: 'The Shire', country_id: 554 }
|
||||
])
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
values
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>Partial</code> | <code>array</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The values to insert.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<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">
|
||||
upsert
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>boolean</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
If `true`, performs an UPSERT.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<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">
|
||||
|
||||
By default the new record is returned. Set this to 'minimal' if you don't need this value.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
onConflict
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>undefined</code> | <code>string</code>
|
||||
</span>
|
||||
</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">
|
||||
count
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>null</code> | <code>exact</code> | <code>planned</code> | <code>estimated</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
No description provided.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### Create a record
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('cities')
|
||||
.insert([
|
||||
{ name: 'The Shire', country_id: 554 }
|
||||
])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### Bulk create
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('cities')
|
||||
.insert([
|
||||
{ name: 'The Shire', country_id: 554 },
|
||||
{ name: 'Rohan', country_id: 555 },
|
||||
])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### Upsert
|
||||
|
||||
For upsert, if set to true, primary key columns would need to be included
|
||||
in the data parameter in order for an update to properly happen. Also, primary keys
|
||||
used must be natural, not surrogate. There are however,
|
||||
[workarounds](https://github.com/PostgREST/postgrest/issues/1118)
|
||||
for surrogate primary keys.
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('cities')
|
||||
.insert(
|
||||
[
|
||||
{ name: 'The Shire', country_id: 554 },
|
||||
{ name: 'Rohan', country_id: 555 },
|
||||
{ name: 'City by the Bay', country_id:840}
|
||||
],
|
||||
{ upsert: true })
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,26 +0,0 @@
|
||||
---
|
||||
id: installing
|
||||
title: "Installing"
|
||||
slug: installing
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/postgrest.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
All JavaScript libraries are built directly by the Supabase team.
|
||||
|
||||
Other languages are built by the community and supported by Supabase.
|
||||
|
||||
## JavaScript
|
||||
|
||||
```bash
|
||||
npm install @supabase/postgrest-js
|
||||
```
|
||||
|
||||
- [Source code](https://github.com/supabase/postgrest-js)
|
||||
|
||||
## Python
|
||||
|
||||
```bash
|
||||
# Not yet implemented
|
||||
@@ -1,226 +0,0 @@
|
||||
---
|
||||
id: is
|
||||
title: "is"
|
||||
slug: is
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/postgrest.yml
|
||||
---
|
||||
|
||||
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`.
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('cities')
|
||||
.select('name, country_id')
|
||||
.is('name', null)
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
column
|
||||
</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">
|
||||
|
||||
The column to filter on.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
value
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>boolean</code> | <code>null</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The value to filter with.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### With `select()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('cities')
|
||||
.select('name, country_id')
|
||||
.is('name', null)
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `update()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('cities')
|
||||
.update({ name: 'Mordor' })
|
||||
.is('name', null)
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `delete()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('cities')
|
||||
.delete()
|
||||
.is('name', null)
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `rpc()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
// Only valid if the Stored Procedure returns a table type.
|
||||
const { data, error } = await postgrest
|
||||
.rpc('echo_all_cities')
|
||||
.is('name', null)
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,226 +0,0 @@
|
||||
---
|
||||
id: like
|
||||
title: "like"
|
||||
slug: like
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/postgrest.yml
|
||||
---
|
||||
|
||||
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).
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('cities')
|
||||
.select('name, country_id')
|
||||
.like('name', '%la%')
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
column
|
||||
</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">
|
||||
|
||||
The column to filter on.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
pattern
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>string</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The pattern to filter with.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### With `select()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('cities')
|
||||
.select('name, country_id')
|
||||
.like('name', '%la%')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `update()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('cities')
|
||||
.update({ name: 'Mordor' })
|
||||
.like('name', '%la%')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `delete()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('cities')
|
||||
.delete()
|
||||
.like('name', '%la%')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `rpc()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
// Only valid if the Stored Procedure returns a table type.
|
||||
const { data, error } = await postgrest
|
||||
.rpc('echo_all_cities')
|
||||
.like('name', '%la%')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,226 +0,0 @@
|
||||
---
|
||||
id: lt
|
||||
title: "lt"
|
||||
slug: lt
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/postgrest.yml
|
||||
---
|
||||
|
||||
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`.
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('cities')
|
||||
.select('name, country_id')
|
||||
.lt('country_id', 250)
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
column
|
||||
</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">
|
||||
|
||||
The column to filter on.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
value
|
||||
</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">
|
||||
|
||||
The value to filter with.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### With `select()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('cities')
|
||||
.select('name, country_id')
|
||||
.lt('country_id', 250)
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `update()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('cities')
|
||||
.update({ name: 'Mordor' })
|
||||
.lt('country_id', 250)
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `delete()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('cities')
|
||||
.delete()
|
||||
.lt('country_id', 250)
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `rpc()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
// Only valid if the Stored Procedure returns a table type.
|
||||
const { data, error } = await postgrest
|
||||
.rpc('echo_all_cities')
|
||||
.lt('country_id', 250)
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,226 +0,0 @@
|
||||
---
|
||||
id: lte
|
||||
title: "lte"
|
||||
slug: lte
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/postgrest.yml
|
||||
---
|
||||
|
||||
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`.
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('cities')
|
||||
.select('name, country_id')
|
||||
.lte('country_id', 250)
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
column
|
||||
</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">
|
||||
|
||||
The column to filter on.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
value
|
||||
</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">
|
||||
|
||||
The value to filter with.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### With `select()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('cities')
|
||||
.select('name, country_id')
|
||||
.lte('country_id', 250)
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `update()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('cities')
|
||||
.update({ name: 'Mordor' })
|
||||
.lte('country_id', 250)
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `delete()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('cities')
|
||||
.delete()
|
||||
.lte('country_id', 250)
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `rpc()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
// Only valid if the Stored Procedure returns a table type.
|
||||
const { data, error } = await postgrest
|
||||
.rpc('echo_all_cities')
|
||||
.lte('country_id', 250)
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,226 +0,0 @@
|
||||
---
|
||||
id: neq
|
||||
title: "neq"
|
||||
slug: neq
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/postgrest.yml
|
||||
---
|
||||
|
||||
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`.
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('cities')
|
||||
.select('name, country_id')
|
||||
.neq('name', 'The shire')
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
column
|
||||
</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">
|
||||
|
||||
The column to filter on.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
value
|
||||
</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">
|
||||
|
||||
The value to filter with.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### With `select()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('cities')
|
||||
.select('name, country_id')
|
||||
.neq('name', 'The shire')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `update()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('cities')
|
||||
.update({ name: 'Mordor' })
|
||||
.neq('name', 'San Francisco')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `delete()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('cities')
|
||||
.delete()
|
||||
.neq('name', 'Mordor')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `rpc()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
// Only valid if the Stored Procedure returns a table type.
|
||||
const { data, error } = await postgrest
|
||||
.rpc('echo_all_cities')
|
||||
.neq('name', 'Lagos')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,246 +0,0 @@
|
||||
---
|
||||
id: not
|
||||
title: "not"
|
||||
slug: not
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/postgrest.yml
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Finds all rows which doesn't satisfy the filter.
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('cities')
|
||||
.select('name, country_id')
|
||||
.not('name', 'eq', 'Paris')
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
column
|
||||
</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">
|
||||
|
||||
The column to filter on.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
operator
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>FilterOperator</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The operator to filter with.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
value
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>any</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The value to filter with.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### With `select()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('cities')
|
||||
.select('name, country_id')
|
||||
.not('name', 'eq', 'Paris')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `update()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('cities')
|
||||
.update({ name: 'Mordor' })
|
||||
.not('name', 'eq', 'Paris')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `delete()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('cities')
|
||||
.delete()
|
||||
.not('name', 'eq', 'Paris')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `rpc()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
// Only valid if the Stored Procedure returns a table type.
|
||||
const { data, error } = await postgrest
|
||||
.rpc('echo_all_cities)
|
||||
.not('name', 'eq', 'Paris')
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
@@ -1,226 +0,0 @@
|
||||
---
|
||||
id: nxl
|
||||
title: "nxl"
|
||||
slug: nxl
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/postgrest.yml
|
||||
---
|
||||
|
||||
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`.
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('countries')
|
||||
.select('name, id, population_range_millions')
|
||||
.nxl('population_range_millions', [150, 250])
|
||||
```
|
||||
|
||||
|
||||
</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">
|
||||
column
|
||||
</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">
|
||||
|
||||
The column to filter on.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li className="method-list-item">
|
||||
<h4 className="method-list-item-label">
|
||||
<span className="method-list-item-label-name">
|
||||
range
|
||||
</span>
|
||||
<span className="method-list-item-label-badge required">
|
||||
required
|
||||
</span>
|
||||
<span className="method-list-item-validation">
|
||||
<code>string</code>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="method-list-item-description">
|
||||
|
||||
The range to filter with.
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
### With `select()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('countries')
|
||||
.select('name, id, population_range_millions')
|
||||
.nxl('population_range_millions', [150, 250])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `update()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('countries')
|
||||
.update({ name: 'Mordor' })
|
||||
.nxl('population_range_millions', [150, 250])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `delete()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
const { data, error } = await postgrest
|
||||
.from('countries')
|
||||
.delete()
|
||||
.nxl('population_range_millions', [150, 250])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
### With `rpc()`
|
||||
|
||||
|
||||
|
||||
<Tabs
|
||||
defaultValue="js"
|
||||
groupId="libraries"
|
||||
values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>
|
||||
|
||||
<TabItem value="js">
|
||||
|
||||
```js
|
||||
// Only valid if the Stored Procedure returns a table type.
|
||||
const { data, error } = await postgrest
|
||||
.rpc('echo_all_countries')
|
||||
.nxl('population_range_millions', [150, 250])
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="py">
|
||||
|
||||
```py
|
||||
# Not yet implemented
|
||||
```
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
Loaded 100 of 120 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user