mirror of
https://github.com/supabase/supabase.git
synced 2026-10-11 12:25:05 +03:00
1465 lines
38 KiB
YAML
1465 lines
38 KiB
YAML
openref: 0.1
|
|
|
|
info:
|
|
id: reference/postgrest-js
|
|
title: PostgREST Client
|
|
description: |
|
|
This is an isomorphic JavaScript client for [PostgREST](https://postgrest.org/).
|
|
|
|
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.
|
|
|
|
### Links
|
|
|
|
- [Source code](https://github.com/supabase/postgrest-js)
|
|
- [PostgREST](https://postgrest.org/)
|
|
|
|
definition: spec/postgrest.json
|
|
libraries:
|
|
- name: 'JavaScript'
|
|
id: 'js'
|
|
version: '0.0.1'
|
|
- name: 'Python'
|
|
id: 'py'
|
|
version: '0.0.1'
|
|
docs:
|
|
path: postgrest/client/
|
|
sidebar:
|
|
- name: 'About'
|
|
items:
|
|
- index
|
|
- Installing
|
|
- Initializing
|
|
- name: 'Query Builder'
|
|
items:
|
|
- from
|
|
- select
|
|
- insert
|
|
- update
|
|
- delete
|
|
- rpc
|
|
- name: 'Filters'
|
|
items:
|
|
- filter
|
|
- not
|
|
- eq
|
|
- neq
|
|
- gt
|
|
- gte
|
|
- lt
|
|
- lte
|
|
- like
|
|
- ilike
|
|
- is
|
|
- in
|
|
- cs
|
|
- cd
|
|
- sl
|
|
- sr
|
|
- nxl
|
|
- nxr
|
|
- adj
|
|
- ov
|
|
- fts
|
|
- plfts
|
|
- phfts
|
|
- wfts
|
|
|
|
pages:
|
|
Installing:
|
|
description: |
|
|
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
|
|
```
|
|
|
|
|
|
Initializing:
|
|
$ref: '"PostgrestClient".PostgrestClient.constructor'
|
|
|
|
examples:
|
|
- name: createClient()
|
|
js: |
|
|
```js
|
|
import { PostgrestClient } from '@supabase/postgrest-js'
|
|
|
|
const REST_URL = 'http://localhost:3000'
|
|
const postgrest = new PostgrestClient(REST_URL)
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
|
|
from:
|
|
$ref: '"PostgrestClient".PostgrestClient.from'
|
|
|
|
select:
|
|
$ref: '"lib/PostgrestQueryBuilder".PostgrestQueryBuilder.select'
|
|
examples:
|
|
- name: Getting your data
|
|
isSpotlight: true
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('cities')
|
|
.select()
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: Selecting specific columns
|
|
description: You can select specific fields from your tables.
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('cities')
|
|
.select('name')
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: Query foreign tables
|
|
description: If your database has relationships, you can query related tables too.
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('countries')
|
|
.select(`
|
|
name,
|
|
cities (
|
|
name
|
|
)
|
|
`)
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: Query the same foreign table multiple times
|
|
description: |
|
|
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:
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('products')
|
|
.select(`
|
|
id,
|
|
supplier:supplier_id ( name ),
|
|
purchaser:purchaser_id ( name )
|
|
`)
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: Selecting specific columns
|
|
description: You can select specific fields from your tables.
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('cities')
|
|
.select('name')
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: Querying with count option
|
|
description: |
|
|
You can get the number of rows by using the count option.
|
|
Allowed values for count option are `null`, `exact`, `planned` and `estimated`.
|
|
js: |
|
|
```js
|
|
const { data, error, count } = await postgrest
|
|
.from('cities')
|
|
.select('name', { count: 'exact' })
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: Quering JSON data
|
|
description: |
|
|
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/9.5/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.
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('products')
|
|
.select(`
|
|
id,
|
|
supplier:supplier_id ( name ),
|
|
purchaser:purchaser_id ( name )
|
|
`)
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
|
|
insert:
|
|
$ref: '"lib/PostgrestQueryBuilder".PostgrestQueryBuilder.insert'
|
|
examples:
|
|
- name: Create a record
|
|
isSpotlight: true
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('cities')
|
|
.insert([
|
|
{ name: 'The Shire', country_id: 554 }
|
|
])
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: Bulk create
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('cities')
|
|
.insert([
|
|
{ name: 'The Shire', country_id: 554 },
|
|
{ name: 'Rohan', country_id: 555 },
|
|
])
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: Upsert
|
|
description: |
|
|
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.
|
|
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 })
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
|
|
update:
|
|
$ref: '"lib/PostgrestQueryBuilder".PostgrestQueryBuilder.update'
|
|
examples:
|
|
- name: Updating your data
|
|
isSpotlight: true
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('cities')
|
|
.update({ name: 'Middle Earth' })
|
|
.match({ name: 'Auckland' })
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
|
|
delete:
|
|
$ref: '"lib/PostgrestQueryBuilder".PostgrestQueryBuilder.delete'
|
|
examples:
|
|
- name: Delete records
|
|
isSpotlight: true
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('cities')
|
|
.delete()
|
|
.match({ id: 666 })
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
|
|
rpc:
|
|
title: 'Stored Procedures: rpc()'
|
|
description: |
|
|
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.
|
|
$ref: '"PostgrestClient".PostgrestClient.rpc'
|
|
examples:
|
|
- name: Call a stored procedure
|
|
isSpotlight: true
|
|
description: This is an example invoking a stored procedure.
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.rpc('hello_world')
|
|
}
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With Parameters
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.rpc('echo_city', { name: 'The Shire' })
|
|
}
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: Bulk call
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.rpc('echo_city', [
|
|
{ name: 'The Shire' },
|
|
{ name: 'Mordor' }
|
|
])
|
|
}
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With filters.
|
|
description: |
|
|
Stored procedures that return tables can also be combined with
|
|
`modifiers` and
|
|
`filters`.
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.rpc('echo_all_cities')
|
|
.eq('name', 'The Shire')
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With count option
|
|
description: |
|
|
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`.
|
|
js: |
|
|
```js
|
|
const { data, error, count } = await postgrest
|
|
.rpc('hello_world', { count: 'exact' })
|
|
}
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
filter:
|
|
$ref: '"lib/PostgrestFilterBuilder".PostgrestFilterBuilder.filter'
|
|
examples:
|
|
- name: With `select()`
|
|
isSpotlight: true
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('cities')
|
|
.select('name, country_id')
|
|
.filter('name', 'eq', 'Paris')
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `update()`
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('cities')
|
|
.update({ name: 'Mordor' })
|
|
.filter('name', 'eq', 'Paris')
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `delete()`
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('cities')
|
|
.delete()
|
|
.filter('name', 'eq', 'Paris')
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `rpc()`
|
|
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')
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: Filter embedded resources
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('cities')
|
|
.select('name, countries ( name )')
|
|
.filter('countries.name', 'eq', 'France')
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
|
|
not:
|
|
$ref: '"lib/PostgrestFilterBuilder".PostgrestFilterBuilder.not'
|
|
examples:
|
|
- name: With `select()`
|
|
isSpotlight: true
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('cities')
|
|
.select('name, country_id')
|
|
.not('name', 'eq', 'Paris')
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `update()`
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('cities')
|
|
.update({ name: 'Mordor' })
|
|
.not('name', 'eq', 'Paris')
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `delete()`
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('cities')
|
|
.delete()
|
|
.not('name', 'eq', 'Paris')
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `rpc()`
|
|
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')
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
|
|
eq:
|
|
$ref: '"lib/PostgrestFilterBuilder".PostgrestFilterBuilder.eq'
|
|
examples:
|
|
- name: With `select()`
|
|
isSpotlight: true
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('cities')
|
|
.select('name, country_id')
|
|
.eq('name', 'The shire')
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `update()`
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('cities')
|
|
.update({ name: 'Mordor' })
|
|
.eq('name', 'San Francisco')
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `delete()`
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('cities')
|
|
.delete()
|
|
.eq('name', 'Mordor')
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `rpc()`
|
|
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')
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
|
|
neq:
|
|
$ref: '"lib/PostgrestFilterBuilder".PostgrestFilterBuilder.neq'
|
|
examples:
|
|
- name: With `select()`
|
|
isSpotlight: true
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('cities')
|
|
.select('name, country_id')
|
|
.neq('name', 'The shire')
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `update()`
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('cities')
|
|
.update({ name: 'Mordor' })
|
|
.neq('name', 'San Francisco')
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `delete()`
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('cities')
|
|
.delete()
|
|
.neq('name', 'Mordor')
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `rpc()`
|
|
js: |
|
|
```js
|
|
// Only valid if the Stored Procedure returns a table type.
|
|
const { data, error } = await postgrest
|
|
.rpc('echo_all_cities')
|
|
.neq('name', 'Lagos')
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
|
|
gt:
|
|
$ref: '"lib/PostgrestFilterBuilder".PostgrestFilterBuilder.gt'
|
|
examples:
|
|
- name: With `select()`
|
|
isSpotlight: true
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('cities')
|
|
.select('name, country_id')
|
|
.gt('country_id', 250)
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `update()`
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('cities')
|
|
.update({ name: 'Mordor' })
|
|
.gt('country_id', 250)
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `delete()`
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('cities')
|
|
.delete()
|
|
.gt('country_id', 250)
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `rpc()`
|
|
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)
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
|
|
gte:
|
|
$ref: '"lib/PostgrestFilterBuilder".PostgrestFilterBuilder.gte'
|
|
examples:
|
|
- name: With `select()`
|
|
isSpotlight: true
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('cities')
|
|
.select('name, country_id')
|
|
.gte('country_id', 250)
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `update()`
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('cities')
|
|
.update({ name: 'Mordor' })
|
|
.gte('country_id', 250)
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `delete()`
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('cities')
|
|
.delete()
|
|
.gte('country_id', 250)
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `rpc()`
|
|
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)
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
|
|
lt:
|
|
$ref: '"lib/PostgrestFilterBuilder".PostgrestFilterBuilder.lt'
|
|
examples:
|
|
- name: With `select()`
|
|
isSpotlight: true
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('cities')
|
|
.select('name, country_id')
|
|
.lt('country_id', 250)
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `update()`
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('cities')
|
|
.update({ name: 'Mordor' })
|
|
.lt('country_id', 250)
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `delete()`
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('cities')
|
|
.delete()
|
|
.lt('country_id', 250)
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `rpc()`
|
|
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)
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
|
|
lte:
|
|
$ref: '"lib/PostgrestFilterBuilder".PostgrestFilterBuilder.lte'
|
|
examples:
|
|
- name: With `select()`
|
|
isSpotlight: true
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('cities')
|
|
.select('name, country_id')
|
|
.lte('country_id', 250)
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `update()`
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('cities')
|
|
.update({ name: 'Mordor' })
|
|
.lte('country_id', 250)
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `delete()`
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('cities')
|
|
.delete()
|
|
.lte('country_id', 250)
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `rpc()`
|
|
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)
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
|
|
like:
|
|
$ref: '"lib/PostgrestFilterBuilder".PostgrestFilterBuilder.like'
|
|
examples:
|
|
- name: With `select()`
|
|
isSpotlight: true
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('cities')
|
|
.select('name, country_id')
|
|
.like('name', '%la%')
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `update()`
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('cities')
|
|
.update({ name: 'Mordor' })
|
|
.like('name', '%la%')
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `delete()`
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('cities')
|
|
.delete()
|
|
.like('name', '%la%')
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `rpc()`
|
|
js: |
|
|
```js
|
|
// Only valid if the Stored Procedure returns a table type.
|
|
const { data, error } = await postgrest
|
|
.rpc('echo_all_cities')
|
|
.like('name', '%la%')
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
|
|
ilike:
|
|
$ref: '"lib/PostgrestFilterBuilder".PostgrestFilterBuilder.ilike'
|
|
examples:
|
|
- name: With `select()`
|
|
isSpotlight: true
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('cities')
|
|
.select('name, country_id')
|
|
.ilike('name', '%la%')
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `update()`
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('cities')
|
|
.update({ name: 'Mordor' })
|
|
.ilike('name', '%la%')
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `delete()`
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('cities')
|
|
.delete()
|
|
.ilike('name', '%la%')
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `rpc()`
|
|
js: |
|
|
```js
|
|
// Only valid if the Stored Procedure returns a table type.
|
|
const { data, error } = await postgrest
|
|
.rpc('echo_all_cities')
|
|
.ilike('name', '%la%')
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
|
|
is:
|
|
$ref: '"lib/PostgrestFilterBuilder".PostgrestFilterBuilder.is'
|
|
examples:
|
|
- name: With `select()`
|
|
isSpotlight: true
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('cities')
|
|
.select('name, country_id')
|
|
.is('name', null)
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `update()`
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('cities')
|
|
.update({ name: 'Mordor' })
|
|
.is('name', null)
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `delete()`
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('cities')
|
|
.delete()
|
|
.is('name', null)
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `rpc()`
|
|
js: |
|
|
```js
|
|
// Only valid if the Stored Procedure returns a table type.
|
|
const { data, error } = await postgrest
|
|
.rpc('echo_all_cities')
|
|
.is('name', null)
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
|
|
in:
|
|
$ref: '"lib/PostgrestFilterBuilder".PostgrestFilterBuilder.in'
|
|
examples:
|
|
- name: With `select()`
|
|
isSpotlight: true
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('cities')
|
|
.select('name, country_id')
|
|
.in('name', ['Rio de Janeiro', 'San Francisco'])
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `update()`
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('cities')
|
|
.update({ name: 'Mordor' })
|
|
.in('name', ['Rio de Janeiro', 'San Francisco'])
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `delete()`
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('cities')
|
|
.delete()
|
|
.in('name', ['Rio de Janeiro', 'San Francisco'])
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `rpc()`
|
|
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'])
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
|
|
cs:
|
|
$ref: '"lib/PostgrestFilterBuilder".PostgrestFilterBuilder.cs'
|
|
examples:
|
|
- name: With `select()`
|
|
isSpotlight: true
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('countries')
|
|
.select('name, id, main_exports')
|
|
.cs('main_exports', ['oil'])
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `update()`
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('countries')
|
|
.update({ name: 'Mordor' })
|
|
.cs('main_exports', ['oil'])
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `delete()`
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('countries')
|
|
.delete()
|
|
.cs('main_exports', ['oil'])
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `rpc()`
|
|
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'])
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
|
|
cd:
|
|
$ref: '"lib/PostgrestFilterBuilder".PostgrestFilterBuilder.cd'
|
|
examples:
|
|
- name: With `select()`
|
|
isSpotlight: true
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('countries')
|
|
.select('name, id, main_exports')
|
|
.cd('main_exports', ['cars', 'food', 'machine'])
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `update()`
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('countries')
|
|
.update({ name: 'Mordor' })
|
|
.cd('main_exports', ['orks', 'surveillance', 'evil'])
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `delete()`
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('countries')
|
|
.delete()
|
|
.cd('main_exports', ['cars', 'food', 'machine'])
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `rpc()`
|
|
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'])
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
|
|
sl:
|
|
$ref: '"lib/PostgrestFilterBuilder".PostgrestFilterBuilder.sl'
|
|
examples:
|
|
- name: With `select()`
|
|
isSpotlight: true
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('countries')
|
|
.select('name, id, population_range_millions')
|
|
.sl('population_range_millions', [150, 250])
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `update()`
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('countries')
|
|
.update({ name: 'Mordor' })
|
|
.sl('population_range_millions', [150, 250])
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `delete()`
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('countries')
|
|
.delete()
|
|
.sl('population_range_millions', [150, 250])
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `rpc()`
|
|
js: |
|
|
```js
|
|
// Only valid if the Stored Procedure returns a table type.
|
|
const { data, error } = await postgrest
|
|
.rpc('echo_all_countries')
|
|
.sl('population_range_millions', [150, 250])
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
|
|
sr:
|
|
$ref: '"lib/PostgrestFilterBuilder".PostgrestFilterBuilder.sr'
|
|
examples:
|
|
- name: With `select()`
|
|
isSpotlight: true
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('countries')
|
|
.select('name, id, population_range_millions')
|
|
.sr('population_range_millions', [150, 250])
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `update()`
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('countries')
|
|
.update({ name: 'Mordor' })
|
|
.sr('population_range_millions', [150, 250])
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `delete()`
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('countries')
|
|
.delete()
|
|
.sr('population_range_millions', [150, 250])
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `rpc()`
|
|
js: |
|
|
```js
|
|
// Only valid if the Stored Procedure returns a table type.
|
|
const { data, error } = await postgrest
|
|
.rpc('echo_all_countries')
|
|
.sr('population_range_millions', [150, 250])
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
|
|
nxl:
|
|
$ref: '"lib/PostgrestFilterBuilder".PostgrestFilterBuilder.nxl'
|
|
examples:
|
|
- name: With `select()`
|
|
isSpotlight: true
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('countries')
|
|
.select('name, id, population_range_millions')
|
|
.nxl('population_range_millions', [150, 250])
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `update()`
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('countries')
|
|
.update({ name: 'Mordor' })
|
|
.nxl('population_range_millions', [150, 250])
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `delete()`
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('countries')
|
|
.delete()
|
|
.nxl('population_range_millions', [150, 250])
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `rpc()`
|
|
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])
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
|
|
nxr:
|
|
$ref: '"lib/PostgrestFilterBuilder".PostgrestFilterBuilder.nxr'
|
|
examples:
|
|
- name: With `select()`
|
|
isSpotlight: true
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('countries')
|
|
.select('name, id, population_range_millions')
|
|
.nxr('population_range_millions', [150, 250])
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `update()`
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('countries')
|
|
.update({ name: 'Mordor' })
|
|
.nxr('population_range_millions', [150, 250])
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `delete()`
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('countries')
|
|
.delete()
|
|
.nxr('population_range_millions', [150, 250])
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `rpc()`
|
|
js: |
|
|
```js
|
|
// Only valid if the Stored Procedure returns a table type.
|
|
const { data, error } = await postgrest
|
|
.rpc('echo_all_countries')
|
|
.nxr('population_range_millions', [150, 250])
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
|
|
adj:
|
|
$ref: '"lib/PostgrestFilterBuilder".PostgrestFilterBuilder.adj'
|
|
examples:
|
|
- name: With `select()`
|
|
isSpotlight: true
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('countries')
|
|
.select('name, id, population_range_millions')
|
|
.adj('population_range_millions', [70, 185])
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `update()`
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('countries')
|
|
.update({ name: 'Mordor' })
|
|
.adj('population_range_millions', [70, 185])
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `delete()`
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('countries')
|
|
.delete()
|
|
.adj('population_range_millions', [70, 185])
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `rpc()`
|
|
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])
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
|
|
ov:
|
|
$ref: '"lib/PostgrestFilterBuilder".PostgrestFilterBuilder.ov'
|
|
examples:
|
|
- name: With `select()`
|
|
isSpotlight: true
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('countries')
|
|
.select('name, id, main_exports')
|
|
.ova('main_exports', ['computers', 'minerals'])
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `update()`
|
|
js: |
|
|
```js
|
|
let countries = await postgrest
|
|
.from('countries')
|
|
.update({ name: 'Mordor' })
|
|
.ova('main_exports', ['computers', 'minerals'])
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `delete()`
|
|
js: |
|
|
```js
|
|
const { data, error } = await postgrest
|
|
.from('countries')
|
|
.delete()
|
|
.ova('main_exports', ['computers', 'minerals'])
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
- name: With `rpc()`
|
|
js: |
|
|
```js
|
|
// Only valid if the Stored Procedure returns a table type.
|
|
const { data, error } = await postgrest
|
|
.rpc('echo_all_countries')
|
|
.ova('main_exports', ['computers', 'minerals'])
|
|
```
|
|
py: |
|
|
```py
|
|
# Not yet implemented
|
|
```
|
|
|
|
fts:
|
|
$ref: '"lib/PostgrestFilterBuilder".PostgrestFilterBuilder.fts'
|
|
|
|
plfts:
|
|
$ref: '"lib/PostgrestFilterBuilder".PostgrestFilterBuilder.plfts'
|
|
|
|
phfts:
|
|
$ref: '"lib/PostgrestFilterBuilder".PostgrestFilterBuilder.phfts'
|
|
|
|
wfts:
|
|
$ref: '"lib/PostgrestFilterBuilder".PostgrestFilterBuilder.wfts'
|