Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Starting Documentation for New Filters - For all new filters introduced in postgrest-js 0.12.0 - Started with .select() first, the rest should be quicker from here. - Took the liberty as well to group common snippets as well to minimise surface area. - Surface area of examples could be further reduced.

Angelico0e28187f6454
diff --git a/web/docs/common/CommonFilters.js b/web/docs/common/CommonFilters.js
index 219bb11c4cf..d570cdd3586 100644
--- a/web/docs/common/CommonFilters.js
+++ b/web/docs/common/CommonFilters.js
@@ -1,7 +1,9 @@
import React from 'react'
import Filter from './filters/filter.mdx'
+import Not from './filters/not.mdx'
import Match from './filters/match.mdx'
import Eq from './filters/eq.mdx'
+import Neq from './filters/neq.mdx'
import Gt from './filters/gt.mdx'
import Lt from './filters/lt.mdx'
import Gte from './filters/gte.mdx'
@@ -10,12 +12,23 @@ import Like from './filters/like.mdx'
import Ilike from './filters/ilike.mdx'
import Is from './filters/is.mdx'
import In from './filters/in.mdx'
-import Neq from './filters/neq.mdx'
+import Cs from './filters/cs.mdx'
+import Cd from './filters/cd.mdx'
+import Ova from './filters/ova.mdx'
+import Ovr from './filters/ovr.mdx'
+import Sl from './filters/sl.mdx'
+import Sr from './filters/sr.mdx'
+import Nxl from './filters/nxl.mdx'
+import Nxr from './filters/nxr.mdx'
+import Adj from './filters/adj.mdx'
+
const filters = {
filter: <Filter />,
+ not: <Not />,
match: <Match />,
eq: <Eq />,
+ neq: <Neq />,
gt: <Gt />,
lt: <Lt />,
gte: <Gte />,
@@ -24,7 +37,15 @@ const filters = {
ilike: <Ilike />,
is: <Is />,
in: <In />,
- neq: <Neq />,
+ cs: <Cs />,
+ cd: <Cd />,
+ ova: <Ova />,
+ ovr: <Ovr />,
+ sl: <Sl />,
+ sr: <Sr />,
+ nxl: <Nxl />,
+ nxr: <Nxr />,
+ adj: <Adj />
}
function CommonFilters(props) {
diff --git a/web/docs/common/DummyData.mdx b/web/docs/common/DummyData.mdx
index e02777a1db3..cf6a1c7c7ce 100644
--- a/web/docs/common/DummyData.mdx
+++ b/web/docs/common/DummyData.mdx
@@ -10,27 +10,27 @@ We will be fictional "world" database in all of our examples.
<div className="">
<strong>Countries</strong>
-| id | name | iso2 | continent |
-| --- | ------------- | :--: | ------------- |
-| 76 | Brazil | BR | South America |
-| 156 | China | CN | Asia |
-| 250 | France | FR | Europe |
-| 554 | New Zealand | NZ | Oceania |
-| 566 | Nigeria | NG | Africa |
-| 840 | United States | US | North America |
+| id | name | iso2 | population_range_millions | main_exports |
+| --- | ------------- | :--: | ------------------------- | --------------------- |
+| 76 | Brazil | BR | ( 205, 215 ) | [ beans, minerals ] |
+| 156 | China | CN | ( 1380, 1390 ) | [ computers, phones ] |
+| 250 | France | FR | ( 60, 70 ) | [ cars, machines ] |
+| 554 | New Zealand | NZ | ( 4, 6 ) | [ food, machines ] |
+| 556 | Nigeria | NG | ( 185, 195 ) | [ oil, beans ] |
+| 840 | United States | US | ( 320, 330 ) | [ oil, cars, food ] |
</div>
<div className="">
<strong>Cities</strong>
-| name | country_id |
-| -------------- | :--------: |
-| Rio de Janeiro | 76 |
-| Beijing | 156 |
-| Paris | 250 |
-| Auckland | 554 |
-| Lagos | 556 |
-| San Francisco | 840 |
+| name | country_id | miscellaneous |
+| -------------- | :--------: | -------------------- |
+| Rio de Janeiro | 76 | { isCapital: false } |
+| Beijing | 156 | { isCapital: true } |
+| Paris | 250 | { isCapital: true } |
+| Auckland | 554 | { isCapital: false } |
+| Lagos | 556 | { isCapital: false } |
+| San Francisco | 840 | { isCapital: false } |
</div>
</div>
diff --git a/web/docs/common/filters/adj.mdx b/web/docs/common/filters/adj.mdx
new file mode 100644
index 00000000000..7124f074b59
--- /dev/null
+++ b/web/docs/common/filters/adj.mdx
@@ -0,0 +1,19 @@
+import Collapsable from '../../../src/components/Collapsable'
+
+#### General form
+<!-- prettier-ignore -->
+```js {3}
+supabase
+ .from(tableName)
+ .adj(columnName, filterRange)
+```
+
+Finds all rows whose range value on the stated columnName is adjacent to the specified filterRange. Equivalent of `filter(columnName, 'adj', criteria)`.
+
+#### `columnName: string`
+Name of the database column.
+
+#### `filterRange: array`
+Array to compare to. Returns an error if length of array provided is not equal to 2.
+
+---
\ No newline at end of file
diff --git a/web/docs/common/filters/cd.mdx b/web/docs/common/filters/cd.mdx
new file mode 100644
index 00000000000..1cb445adc3f
--- /dev/null
+++ b/web/docs/common/filters/cd.mdx
@@ -0,0 +1,19 @@
+import Collapsable from '../../../src/components/Collapsable'
+
+#### General form
+<!-- prettier-ignore -->
+```js {3}
+supabase
+ .from(tableName)
+ .cd(columnName, filterObject)
+```
+
+Finds all rows whose json, array, or range value on the stated columnName is contained by the specific filterObject. Equivalent of `filter(columName, 'cd', criteria)`.
+
+#### `columnName: string`
+Name of the database column.
+
+#### `filterObject: { array | object }`
+Value to compare to.
+
+---
\ No newline at end of file
diff --git a/web/docs/common/filters/cs.mdx b/web/docs/common/filters/cs.mdx
new file mode 100644
index 00000000000..ffff4ac6f87
--- /dev/null
+++ b/web/docs/common/filters/cs.mdx
@@ -0,0 +1,19 @@
+import Collapsable from '../../../src/components/Collapsable'
+
+#### General form
+<!-- prettier-ignore -->
+```js {3}
+supabase
+ .from(tableName)
+ .cs(columnName, filterObject)
+```
+
+Finds all rows whose json, array, or range value on the stated columnName contains the items specified in the filterObject. Equivalent of `filter(columName, 'cs', criteria)`.
+
+#### `columnName: string`
+Name of the database column.
+
+#### `filterObject: { array | object }`
+Value to compare to.
+
+---
\ No newline at end of file
diff --git a/web/docs/common/filters/eq.mdx b/web/docs/common/filters/eq.mdx
index 1eb458f33d5..944b7105edb 100644
--- a/web/docs/common/filters/eq.mdx
+++ b/web/docs/common/filters/eq.mdx
@@ -8,7 +8,7 @@ supabase
.eq(columnName, filterValue)
```
-Finds all rows whose value on the stated columnName exactly matches the specified filterValue. Equivalent of `filter(columName, 'eq', criteria)`.
+Finds all rows whose value on the stated columnName exactly matches the specified filterValue. Equivalent of `filter(columnName, 'eq', criteria)`.
#### `columnName: string`
Name of the database column.
diff --git a/web/docs/common/filters/not.mdx b/web/docs/common/filters/not.mdx
new file mode 100644
index 00000000000..d09a2576728
--- /dev/null
+++ b/web/docs/common/filters/not.mdx
@@ -0,0 +1,22 @@
+import Collapsable from '../../../src/components/Collapsable'
+
+#### General form
+<!-- prettier-ignore -->
+```js {3}
+supabase
+ .from(tableName)
+ .not(columnName, operator, criteria)
+```
+
+Reverse of `.filter()`. Returns rows that do not meet the criteria specified using the columnName and operator provided.
+
+#### `columnName: string`
+Name of the database column.
+
+#### `operator: string`
+Name of filter operator to be utilised.
+
+#### `criteria: { object | array | string | integer | boolean | null }`
+Value to compare to. Exact data type of criteria would depend on the operator used.
+
+---
\ No newline at end of file
diff --git a/web/docs/common/filters/nxl.mdx b/web/docs/common/filters/nxl.mdx
new file mode 100644
index 00000000000..e0dfc9a46ed
--- /dev/null
+++ b/web/docs/common/filters/nxl.mdx
@@ -0,0 +1,19 @@
+import Collapsable from '../../../src/components/Collapsable'
+
+#### General form
+<!-- prettier-ignore -->
+```js {3}
+supabase
+ .from(tableName)
+ .nxl(columnName, filterRange)
+```
+
+Finds all rows whose range value on the stated columnName does not extend to the left of the specified filterRange. Equivalent of `filter(columnName, 'nxl', criteria)`.
+
+#### `columnName: string`
+Name of the database column.
+
+#### `filterRange: array`
+Array to compare to. Returns an error if length of array provided is not equal to 2.
+
+---
\ No newline at end of file
diff --git a/web/docs/common/filters/nxr.mdx b/web/docs/common/filters/nxr.mdx
new file mode 100644
index 00000000000..44febd36ea0
--- /dev/null
+++ b/web/docs/common/filters/nxr.mdx
@@ -0,0 +1,19 @@
+import Collapsable from '../../../src/components/Collapsable'
+
+#### General form
+<!-- prettier-ignore -->
+```js {3}
+supabase
+ .from(tableName)
+ .nxr(columnName, filterRange)
+```
+
+Finds all rows whose range value on the stated columnName does not extend to the right of the specified filterRange. Equivalent of `filter(columnName, 'nxr', criteria)`.
+
+#### `columnName: string`
+Name of the database column.
+
+#### `filterRange: array`
+Array to compare to. Returns an error if length of array provided is not equal to 2.
+
+---
\ No newline at end of file
diff --git a/web/docs/common/filters/ova.mdx b/web/docs/common/filters/ova.mdx
new file mode 100644
index 00000000000..68ae6862b35
--- /dev/null
+++ b/web/docs/common/filters/ova.mdx
@@ -0,0 +1,19 @@
+import Collapsable from '../../../src/components/Collapsable'
+
+#### General form
+<!-- prettier-ignore -->
+```js {3}
+supabase
+ .from(tableName)
+ .ova(columnName, filterArray)
+```
+
+Finds all rows whose array value on the stated columnName overlaps with the specified filterArray. Equivalent of `filter(columnName, 'ova', criteria)`.
+
+#### `columnName: string`
+Name of the database column.
+
+#### `filterArray: array`
+Value to compare to.
+
+---
\ No newline at end of file
diff --git a/web/docs/common/filters/ovr.mdx b/web/docs/common/filters/ovr.mdx
new file mode 100644
index 00000000000..011ad4a83a8
--- /dev/null
+++ b/web/docs/common/filters/ovr.mdx
@@ -0,0 +1,19 @@
+import Collapsable from '../../../src/components/Collapsable'
+
+#### General form
+<!-- prettier-ignore -->
+```js {3}
+supabase
+ .from(tableName)
+ .ovr(columnName, filterRange)
+```
+
+Finds all rows whose range value on the stated columnName overlaps with the specified filterRange. Equivalent of `filter(columnName, 'ovr', criteria)`.
+
+#### `columnName: string`
+Name of the database column.
+
+#### `filterRange: array`
+Array to compare to. Returns an error if length of array provided is not equal to 2.
+
+---
\ No newline at end of file
diff --git a/web/docs/common/filters/sl.mdx b/web/docs/common/filters/sl.mdx
new file mode 100644
index 00000000000..7fb07dbad23
--- /dev/null
+++ b/web/docs/common/filters/sl.mdx
@@ -0,0 +1,19 @@
+import Collapsable from '../../../src/components/Collapsable'
+
+#### General form
+<!-- prettier-ignore -->
+```js {3}
+supabase
+ .from(tableName)
+ .sl(columnName, filterRange)
+```
+
+Finds all rows whose range value on the stated columnName is strictly on the left hand side of the specified filterRange. Equivalent of `filter(columnName, 'sl', criteria)`.
+
+#### `columnName: string`
+Name of the database column.
+
+#### `filterRange: array`
+Array to compare to. Returns an error if length of array provided is not equal to 2.
+
+---
\ No newline at end of file
diff --git a/web/docs/common/filters/sr.mdx b/web/docs/common/filters/sr.mdx
new file mode 100644
index 00000000000..5babd652a32
--- /dev/null
+++ b/web/docs/common/filters/sr.mdx
@@ -0,0 +1,19 @@
+import Collapsable from '../../../src/components/Collapsable'
+
+#### General form
+<!-- prettier-ignore -->
+```js {3}
+supabase
+ .from(tableName)
+ .sr(columnName, filterRange)
+```
+
+Finds all rows whose range value on the stated columnName is strictly on the right hand side of the specified filterRange. Equivalent of `filter(columnName, 'sr', criteria)`.
+
+#### `columnName: string`
+Name of the database column.
+
+#### `filterRange: array`
+Array to compare to. Returns an error if length of array provided is not equal to 2.
+
+---
\ No newline at end of file
diff --git a/web/docs/library/examples/common.js b/web/docs/library/examples/common.js
new file mode 100644
index 00000000000..974aa95c1ae
--- /dev/null
+++ b/web/docs/library/examples/common.js
@@ -0,0 +1,17 @@
+/**
+ * Common snippets shared across all examples
+ */
+
+export const importJs = `
+import { createClient } from '@supabase/supabase-js'
+
+const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE')
+`
+
+export const errorJs = `
+ } catch (error) {
+ console.log('Error: ', error)
+ }
+}
+`.trim()
+
diff --git a/web/docs/library/examples/get.js b/web/docs/library/examples/get.js
index fd9fe643c9d..e385c36cf7f 100644
--- a/web/docs/library/examples/get.js
+++ b/web/docs/library/examples/get.js
@@ -1,46 +1,33 @@
+import {importJs, errorJs} from './common'
+
/**
* get.mdx examples
*/
export const getSimpleJs = `
-import { createClient } from '@supabase/supabase-js'
-
-const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE')
-
+${importJs}
const getCities = async () => {
try {
let cities = await supabase
.from('cities')
- .select('*')
+ .select('name', 'country_id')
return cities
- } catch (error) {
- console.log('Error: ', error)
- }
-}
+ ${errorJs}
`.trim()
export const getColumnsJs = `
-import { createClient } from '@supabase/supabase-js'
-
-const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE')
-
+${importJs}
const getCities = async () => {
try {
let cities = await supabase
.from('cities')
.select('name')
return cities
- } catch (error) {
- console.log('Error: ', error)
- }
-}
+ ${errorJs}
`.trim()
export const getForeignJs = `
-import { createClient } from '@supabase/supabase-js'
-
-const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE')
-
+${importJs}
const getCountries = async () => {
try {
let countries = await supabase
@@ -52,17 +39,11 @@ const getCountries = async () => {
)
\`)
return countries
- } catch (error) {
- console.log('Error: ', error)
- }
-}
+ ${errorJs}
`.trim()
export const getForeignMultipleJs = `
-import { createClient } from '@supabase/supabase-js'
-
-const supabase = createClient('https://shop.supabase.co', 'public-key-bOYapLADERfE')
-
+${importJs}
const getProducts = async () => {
try {
let products = await supabase
@@ -73,279 +54,306 @@ const getProducts = async () => {
purchaser:purchaser_id ( name )
\`)
return products
- } catch (error) {
- console.log('Error: ', error)
- }
-}
+ ${errorJs}
`.trim()
export const getOrderJs = `
-import { createClient } from '@supabase/supabase-js'
-
-const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE')
-
+${importJs}
const getCities = async () => {
try {
let cities = await supabase
.from('cities')
.order('id')
- .select('*')
+ .select('name', 'country_id')
return cities
- } catch (error) {
- console.log('Error: ', error)
- }
-}
+ ${errorJs}
`.trim()
export const getRangeJs = `
-import { createClient } from '@supabase/supabase-js'
-
-const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE')
-
+${importJs}
const getCities = async () => {
try {
let cities = await supabase
.from('cities')
.range(0,3)
- .select('*')
+ .select('name', 'country_id')
return cities
- } catch (error) {
- console.log('Error: ', error)
- }
-}
+ ${errorJs}
`.trim()
export const getSingleJs = `
-import { createClient } from '@supabase/supabase-js'
-
-const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE')
-
+${importJs}
const getCities = async () => {
try {
let cities = await supabase
.from('cities')
.range(0)
.single()
- .select('*')
+ .select('name', 'country_id')
return cities
- } catch (error) {
- console.log('Error: ', error)
- }
-}
+ ${errorJs}
`.trim()
export const getFilterJs = `
-import { createClient } from '@supabase/supabase-js'
-
-const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE')
+${importJs}
+const getCities = async () => {
+ try {
+ let cities = await supabase
+ .from('cities')
+ .filter('name', 'eq', 'Paris')
+ .select('name', 'country_id')
+ return cities
+ ${errorJs}
+`.trim()
+export const getNotJs = `
+${importJs}
const getCities = async () => {
try {
let cities = await supabase
.from('cities')
- .filter({'name', 'eq', 'Paris'})
- .select('*')
+ .not('name', 'eq', 'Paris')
+ .select('name', 'country_id')
return cities
- } catch (error) {
- console.log('Error: ', error)
- }
-}
+ ${errorJs}
`.trim()
export const getMatchJs = `
-import { createClient } from '@supabase/supabase-js'
-
-const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE')
-
+${importJs}
const getCities = async () => {
try {
let cities = await supabase
.from('cities')
.match({name: 'Beijing', country_id: 156})
- .select('*')
+ .select('name', 'country_id')
return cities
- } catch (error) {
- console.log('Error: ', error)
- }
-}
+ ${errorJs}
`.trim()
export const getEqJs = `
-import { createClient } from '@supabase/supabase-js'
-
-const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE')
-
+${importJs}
const getCities = async () => {
try {
let cities = await supabase
.from('cities')
.eq('name', 'San Francisco')
- .select('*')
+ .select('name', 'country_id')
return cities
- } catch (error) {
- console.log('Error: ', error)
- }
-}
+ ${errorJs}
`.trim()
-export const getGtJs = `
-import { createClient } from '@supabase/supabase-js'
-
-const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE')
+export const getNeqJs = `
+${importJs}
+const getCities = async () => {
+ try {
+ let cities = await supabase
+ .from('cities')
+ .neq('name', 'Lagos')
+ .select('name', 'country_id')
+ return cities
+ ${errorJs}
+`.trim()
+export const getGtJs = `
+${importJs}
const getCities = async () => {
try {
let cities = await supabase
.from('cities')
.gt('country_id', 250)
- .select('*')
+ .select('name', 'country_id')
return cities
- } catch (error) {
- console.log('Error: ', error)
- }
-}
+ ${errorJs}
`.trim()
export const getLtJs = `
-import { createClient } from '@supabase/supabase-js'
-
-const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE')
-
+${importJs}
const getCities = async () => {
try {
let cities = await supabase
.from('cities')
.lt('country_id', 250)
- .select('*')
+ .select('name', 'country_id')
return cities
- } catch (error) {
- console.log('Error: ', error)
- }
-}
+ ${errorJs}
`.trim()
export const getGteJs = `
-import { createClient } from '@supabase/supabase-js'
-
-const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE')
-
+${importJs}
const getCities = async () => {
try {
let cities = await supabase
.from('cities')
.gte('country_id', 250)
- .select('*')
+ .select('name', 'country_id')
return cities
- } catch (error) {
- console.log('Error: ', error)
- }
-}
+ ${errorJs}
`.trim()
export const getLteJs = `
-import { createClient } from '@supabase/supabase-js'
-
-const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE')
-
+${importJs}
const getCities = async () => {
try {
let cities = await supabase
.from('cities')
.lte('country_id', 250)
- .select('*')
+ .select('name', 'country_id')
return cities
- } catch (error) {
- console.log('Error: ', error)
- }
-}
+ ${errorJs}
`.trim()
export const getLikeJs = `
-import { createClient } from '@supabase/supabase-js'
-
-const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE')
-
+${importJs}
const getCities = async () => {
try {
let cities = await supabase
.from('cities')
.like('name', '%la%')
- .select('*')
+ .select('name', 'country_id')
return cities
- } catch (error) {
- console.log('Error: ', error)
- }
-}
+ ${errorJs}
`.trim()
export const getIlikeJs = `
-import { createClient } from '@supabase/supabase-js'
-
-const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE')
-
+${importJs}
const getCities = async () => {
try {
let cities = await supabase
.from('cities')
.ilike('name', '%la%')
- .select('*')
+ .select('name', 'country_id')
return cities
- } catch (error) {
- console.log('Error: ', error)
- }
-}
+ ${errorJs}
`.trim()
export const getIsJs = `
-import { createClient } from '@supabase/supabase-js'
-
-const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE')
-
+${importJs}
const getCities = async () => {
try {
let cities = await supabase
.from('cities')
.is('name', null)
- .select('*')
+ .select('name', 'country_id')
return cities
- } catch (error) {
- console.log('Error: ', error)
- }
-}
+ ${errorJs}
`.trim()
export const getInJs = `
-import { createClient } from '@supabase/supabase-js'
-
-const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE')
-
+${importJs}
const getCities = async () => {
try {
let cities = await supabase
.from('cities')
.in('name', ['Rio de Janeiro', 'San Francisco'])
- .select('*')
+ .select('name', 'country_id')
return cities
- } catch (error) {
- console.log('Error: ', error)
- }
-}
+ ${errorJs}
`.trim()
-export const getNeqJs = `
-import { createClient } from '@supabase/supabase-js'
+export const getCsJs = `
+${importJs}
+const getCountries = async () => {
+ try {
+ let countries = await supabase
+ .from('countries')
+ .cs('main_exports', ['oil'])
+ .select('name', 'id', 'main_exports')
+ return countries
+ ${errorJs}
+`.trim()
-const supabase = createClient('https://world.supabase.co', 'public-key-bOYapLADERfE')
+export const getCdJs = `
+${importJs}
+const getCountries = async () => {
+ try {
+ let countries = await supabase
+ .from('countries')
+ .cd('main_exports', ['cars', 'food', 'machine'])
+ .select('name', 'id', 'main_exports')
+ return countries
+ ${errorJs}
+`.trim()
-const getCities = async () => {
+export const getOvaJs = `
+${importJs}
+const getCountries = async () => {
try {
- let cities = await supabase
- .from('cities')
- .neq('name', 'Lagos')
- .select('*')
- return cities
- } catch (error) {
- console.log('Error: ', error)
- }
-}
+ let countries = await supabase
+ .from('countries')
+ .ova('main_exports', ['computers', 'minerals'])
+ .select('name', 'id', 'main_exports')
+ return countries
+ ${errorJs}
+`.trim()
+
+export const getOvrJs = `
+${importJs}
+const getCountries = async () => {
+ try {
+ let countries = await supabase
+ .from('countries')
+ .ovr('population_range_millions', [150, 250])
+ .select('name', 'id', 'population_range_millions')
+ return countries
+ ${errorJs}
+`.trim()
+
+export const getSlJs = `
+${importJs}
+const getCountries = async () => {
+ try {
+ let countries = await supabase
+ .from('countries')
+ .sl('population_range_millions', [150, 250])
+ .select('name', 'id', 'main_exports')
+ return countries
+ ${errorJs}
+`.trim()
+
+export const getSrJs = `
+${importJs}
+const getCountries = async () => {
+ try {
+ let countries = await supabase
+ .from('countries')
+ .sr('population_range_millions', [150, 250])
+ .select('name', 'id', 'main_exports')
+ return countries
+ ${errorJs}
+`.trim()
+
+export const getNxlJs = `
+${importJs}
+const getCountries = async () => {
+ try {
+ let countries = await supabase
+ .from('countries')
+ .nxl('population_range_millions', [150, 250])
+ .select('name', 'id', 'main_exports')
+ return countries
+ ${errorJs}
+`.trim()
+
+export const getNxrJs = `
+${importJs}
+const getCountries = async () => {
+ try {
+ let countries = await supabase
+ .from('countries')
+ .nxr('population_range_millions', [150, 250])
+ .select('name', 'id', 'main_exports')
+ return countries
+ ${errorJs}
+`.trim()
+
+export const getAdjJs = `
+${importJs}
+const getCountries = async () => {
+ try {
+ let countries = await supabase
+ .from('countries')
+ .adj('population_range_millions', [70, 185])
+ .select('name', 'id', 'main_exports')
+ return countries
+ ${errorJs}
`.trim()
diff --git a/web/docs/library/get.mdx b/web/docs/library/get.mdx
index 505f15f0c85..05533144754 100644
--- a/web/docs/library/get.mdx
+++ b/web/docs/library/get.mdx
@@ -18,8 +18,10 @@ import { getSimpleJs,
getRangeJs,
getSingleJs,
getFilterJs,
+ getNotJs,
getMatchJs,
getEqJs,
+ getNeqJs,
getGtJs,
getLtJs,
getGteJs,
@@ -28,7 +30,15 @@ import { getSimpleJs,
getIlikeJs,
getIsJs,
getInJs,
- getNeqJs
+ getCsJs,
+ getCdJs,
+ getOvaJs,
+ getOvrJs,
+ getSlJs,
+ getSrJs,
+ getNxlJs,
+ getNxrJs,
+ getAdjJs
} from './examples/get'
@@ -336,6 +346,30 @@ with `200 OK`. Otherwise, it will return an error with `406 Not Acceptable`.
<CommonFilters filter='filter'/>
+### `not()`
+
+<CustomCodeBlock
+ header="Shows how to use not( ) with select( )"
+ js={getNotJs}
+ jsHighlight="{9}"
+ response={`{
+ "body": [
+ { "name": "Rio de Janeiro", "country_id": 76 },
+ { "name": "Beijing", "country_id": 156 },
+ { "name": "Auckland", "country_id": 554 },
+ { "name": "Lagos", "country_id": 556 },
+ { "name": "San Francisco", "country_id": 840 }
+ ],
+ "status": 200,
+ "statusCode": 200,
+ "statusText": "OK"
+}`}
+/>
+
+<br/>
+
+<CommonFilters filter='not'/>
+
### `match()`
<CustomCodeBlock
@@ -570,6 +604,199 @@ with `200 OK`. Otherwise, it will return an error with `406 Not Acceptable`.
<CommonFilters filter='in'/>
+### `cs()`
+
+<CustomCodeBlock
+ header="Shows how to use cs( ) with select( )"
+ js={getCsJs}
+ jsHighlight="{9}"
+ response={`{
+ "body": [
+ { "name": "Nigeria", "id": 556, "main_exports": [ "oil", "beans" ] },
+ { "name": "United States", "id": 840, "main_exports": [ "oil", "cars", "food" ] },
+ ],
+ "status": 200,
+ "statusCode": 200,
+ "statusText": "OK"
+}`}
+/>
+
+<br/>
+
+<CommonFilters filter='cs'/>
+
+### `cd()`
+
+<CustomCodeBlock
+ header="Shows how to use cd( ) with select( )"
+ js={getCdJs}
+ jsHighlight="{9}"
+ response={`{
+ "body": [
+ { "name": "France", "id": 250, "main_exports": [ "cars", "machines" ] },
+ { "name": "New Zealand", "id": 554, "main_exports": [ "food", "machines" ] },
+ ],
+ "status": 200,
+ "statusCode": 200,
+ "statusText": "OK"
+}`}
+/>
+
+<br/>
+
+<CommonFilters filter='cd'/>
+
+### `ova()`
+
+<CustomCodeBlock
+ header="Shows how to use ova( ) with select( )"
+ js={getOvaJs}
+ jsHighlight="{9}"
+ response={`{
+ "body": [
+ { "name": "Brazil", "id": 76, "main_exports": [ "beans", "minerals" ] },
+ { "name": "China", "id": 156, "main_exports": [ "computers", "phones" ] },
+ ],
+ "status": 200,
+ "statusCode": 200,
+ "statusText": "OK"
+}`}
+/>
+
+<br/>
+
+<CommonFilters filter='ova'/>
+
+### `ovr()`
+
+<CustomCodeBlock
+ header="Shows how to use ovr( ) with select( )"
+ js={getOvrJs}
+ jsHighlight="{9}"
+ response={`{
+ "body": [
+ { "name": "Brazil", "id": 76, "population_range_millions": [ 205, 215 ] },
+ { "name": "Nigeria", "id": 556, "population_range_millions": [ 185, 195 ] },
+ ],
+ "status": 200,
+ "statusCode": 200,
+ "statusText": "OK"
+}`}
+/>
+
+<br/>
+
+<CommonFilters filter='ovr'/>
+
+### `sl()`
+
+<CustomCodeBlock
+ header="Shows how to use sl( ) with select( )"
+ js={getSlJs}
+ jsHighlight="{9}"
+ response={`{
+ "body": [
+ { "name": "France", "id": 250, "population_range_millions": [ 60, 70 ] },
+ { "name": "New Zealand", "id": 554, "population_range_millions": [ 4, 6 ] },
+ ],
+ "status": 200,
+ "statusCode": 200,
+ "statusText": "OK"
+}`}
+/>
+
+<br/>
+
+<CommonFilters filter='sl'/>
+
+### `sr()`
+
+<CustomCodeBlock
+ header="Shows how to use sr( ) with select( )"
+ js={getSrJs}
+ jsHighlight="{9}"
+ response={`{
+ "body": [
+ { "name": "China", "id": 156, "population_range_millions": [ 1380, 1390 ] },
+ { "name": "United States", "id": 840, "population_range_millions": [ 320, 330 ] },
+ ],
+ "status": 200,
+ "statusCode": 200,
+ "statusText": "OK"
+}`}
+/>
+
+<br/>
+
+<CommonFilters filter='sr'/>
+
+### `nxl()`
+
+<CustomCodeBlock
+ header="Shows how to use nxl( ) with select( )"
+ js={getNxlJs}
+ jsHighlight="{9}"
+ response={`{
+ "body": [
+ { "name": "Brazil", "id": 76, "population_range_millions": [ 205, 215 ] },
+ { "name": "China", "id": 156, "population_range_millions": [ 1380, 1390 ] },
+ { "name": "Nigeria", "id": 556, "population_range_millions": [ 185, 195 ] },
+ { "name": "United States", "id": 840, "population_range_millions": [ 320, 330 ] },
+ ],
+ "status": 200,
+ "statusCode": 200,
+ "statusText": "OK"
+}`}
+/>
+
+<br/>
+
+<CommonFilters filter='nxl'/>
+
+### `nxr()`
+
+<CustomCodeBlock
+ header="Shows how to use nxr( ) with select( )"
+ js={getNxrJs}
+ jsHighlight="{9}"
+ response={`{
+ "body": [
+ { "name": "Brazil", "id": 76, "population_range_millions": [ 205, 215 ] },
+ { "name": "France", "id": 250, "population_range_millions": [ 60, 70 ] },
+ { "name": "New Zealand", "id": 554, "population_range_millions": [ 4, 6 ] },
+ { "name": "Nigeria", "id": 556, "population_range_millions": [ 185, 195 ] },
+ ],
+ "status": 200,
+ "statusCode": 200,
+ "statusText": "OK"
+}`}
+/>
+
+<br/>
+
+<CommonFilters filter='nxr'/>
+
+### `adj()`
+
+<CustomCodeBlock
+ header="Shows how to use adj( ) with select( )"
+ js={getAdjJs}
+ jsHighlight="{9}"
+ response={`{
+ "body": [
+ { "name": "France", "id": 250, "population_range_millions": [ 60, 70 ] },
+ { "name": "Nigeria", "id": 556, "population_range_millions": [ 185, 195 ] },
+ ],
+ "status": 200,
+ "statusCode": 200,
+ "statusText": "OK"
+}`}
+/>
+
+<br/>
+
+<CommonFilters filter='adj'/>
+
## Responses
#### 200 OK
diff --git a/web/docs/library/subscribe.mdx b/web/docs/library/subscribe.mdx
index 34746e099a5..46f1999127e 100644
--- a/web/docs/library/subscribe.mdx
+++ b/web/docs/library/subscribe.mdx
@@ -214,9 +214,10 @@ Upon inserting or creating a new row, the following will be returned by our list
"eventType": "INSERT",
"new":{
"id": 533,
- "name": "Aruba",
- "iso2": "AW",
- "continent": "South America"
+ "name": "Columbia",
+ "iso2": "CO",
+ "population_range_millions": [40, 50],
+ "main_exports": ["oil", "minerals"]
}
}
```
@@ -237,7 +238,8 @@ Upon updating a row, the following will be returned by our listener:
"id": 76,
"name": "Brazil",
"iso2": "BR",
- "continent": "South America"
+ "population_range_millions": [205, 215],
+ "main_exports": ["beans", "minerals"]
}
}
```
diff --git a/web/src/css/custom.css b/web/src/css/custom.css
index 235af597017..e3e3d99c7e8 100755
--- a/web/src/css/custom.css
+++ b/web/src/css/custom.css
@@ -531,7 +531,6 @@ div[class^='sidebar_'] .menu__link.menu__link--active:not(.menu__link--sublist)
}
.DummyData {
- display: flex;
overflow-x: auto;
}
.DummyData div {