The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
Finishing of updates/deletes/creates
Paul Copplestone66529db84001
diff --git a/web/docs/common/CommonFilters.mdx b/web/docs/common/CommonFilters.mdxnew file mode 100644index 00000000000..2a67a511972--- /dev/null+++ b/web/docs/common/CommonFilters.mdx@@ -0,0 +1,865 @@++import Collapsable from '../../src/components/Collapsable'++### `match()`++<div style={{display: props.verb == 'get' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js {3}+supabase+ .get(tableName)+ .match(filterObject)+```++</div>+<div style={{display: props.verb == 'patch' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js {3}+supabase+ .patch(tableName)+ .match(filterObject)+```++</div>+<div style={{display: props.verb == 'delete' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js {3}+supabase+ .delete(tableName)+ .match(filterObject)+```++</div>++Finds rows that exactly match the specified filterObject.++<Collapsable title="Toggle Example">++<div style={{display: props.verb == 'get' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js+supabase+ .get('countries')+ .match({ 'continent': 'Asia' })+```++</div>+<div style={{display: props.verb == 'patch' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js+supabase+ .patch('countries')+ .match({ 'continent': 'Asia' })+```++</div>+<div style={{display: props.verb == 'delete' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js+supabase+ .delete('countries')+ .match({ 'name': 'Mordor' })+```++</div>++</Collapsable>+++##### filterObject `:object`+An object of `{ 'columnName': 'criteria' }`++----++### `eq()`++<div style={{display: props.verb == 'get' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js {3}+supabase+ .get(tableName)+ .eq(columnName, filterValue)+```++</div>+<div style={{display: props.verb == 'patch' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js {3}+supabase+ .patch(tableName)+ .eq(columnName, filterValue)+```++</div>+<div style={{display: props.verb == 'delete' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js {3}+supabase+ .delete(tableName)+ .eq(columnName, filterValue)+```++</div>++Finds all rows whose value on the stated columnName exactly matches the specified filterValue.++<Collapsable title="Toggle Example">++<div style={{display: props.verb == 'get' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js+supabase+ .get('countries')+ .eq('name', 'New Zealand')+```++</div>+<div style={{display: props.verb == 'patch' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js+supabase+ .patch('countries')+ .eq('name', 'New Zealand')+```++</div>+<div style={{display: props.verb == 'delete' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js+supabase+ .delete('countries')+ .eq('name', 'New Zealand')+```++</div>++</Collapsable>++##### columnName `:string`+Name of database column.++##### filterValue `{:string|:integer|:boolean}`+Value to match.++----++### `gt()`++<div style={{display: props.verb == 'get' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js {3}+supabase+ .get(tableName)+ .gt(columnName, filterValue)+```++</div>+<div style={{display: props.verb == 'patch' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js {3}+supabase+ .patch(tableName)+ .gt(columnName, filterValue)+```++</div>+<div style={{display: props.verb == 'delete' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js {3}+supabase+ .delete(tableName)+ .gt(columnName, filterValue)+```++</div>++Finds all rows whose value on the stated columnName exactly matches the specified filterValue.++<Collapsable title="Toggle Example">++<div style={{display: props.verb == 'get' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js+supabase+ .get('countries')+ .gt('id', 20)+```++</div>+<div style={{display: props.verb == 'patch' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js+supabase+ .patch('countries')+ .gt('id', 20)+```++</div>+<div style={{display: props.verb == 'delete' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js+supabase+ .delete('countries')+ .gt('id', 20)+```++</div>++</Collapsable>++##### columnName `:string`+Name of database column.++##### filterValue `{:string|:integer|:boolean}`+Value to compare to.++----+++### `lt()`++<div style={{display: props.verb == 'get' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js {3}+supabase+ .get(tableName)+ .lt(columnName, filterValue)+```++</div>+<div style={{display: props.verb == 'patch' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js {3}+supabase+ .patch(tableName)+ .lt(columnName, filterValue)+```++</div>+<div style={{display: props.verb == 'delete' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js {3}+supabase+ .delete(tableName)+ .lt(columnName, filterValue)+```++</div>++Finds all rows whose value on the stated columnName is less than the specified filterValue.++<Collapsable title="Toggle Example">++<div style={{display: props.verb == 'get' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js+supabase+ .get('countries')+ .lt('id', 20)+```++</div>+<div style={{display: props.verb == 'patch' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js+supabase+ .patch('countries')+ .lt('id', 20)+```++</div>+<div style={{display: props.verb == 'delete' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js+supabase+ .delete('countries')+ .lt('id', 20)+```++</div>++</Collapsable>++##### columnName `:string`+Name of database column.++##### filterValue `{:string|:integer|:boolean}`+Value to compare to.++----++### `gte()`++<div style={{display: props.verb == 'get' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js {3}+supabase+ .get(tableName)+ .gte(columnName, filterValue)+```++</div>+<div style={{display: props.verb == 'patch' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js {3}+supabase+ .patch(tableName)+ .gte(columnName, filterValue)+```++</div>+<div style={{display: props.verb == 'delete' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js {3}+supabase+ .delete(tableName)+ .gte(columnName, filterValue)+```++</div>++Finds all rows whose value on the stated columName is greater than or equal to the specified filterValue.++<Collapsable title="Toggle Example">++<div style={{display: props.verb == 'get' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js+supabase+ .get('countries')+ .gte('id', 20)+```++</div>+<div style={{display: props.verb == 'patch' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js+supabase+ .patch('countries')+ .gte('id', 20)+```++</div>+<div style={{display: props.verb == 'delete' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js+supabase+ .delete('countries')+ .gte('id', 20)+```++</div>++</Collapsable>++##### columnName `:string`+Name of database column.++##### filterValue `{:string|:integer|:boolean}`+Value to compare to.++----++### `lte()`++<div style={{display: props.verb == 'get' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js {3}+supabase+ .get(tableName)+ .lte(columnName, filterValue)+```++</div>+<div style={{display: props.verb == 'patch' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js {3}+supabase+ .patch(tableName)+ .lte(columnName, filterValue)+```++</div>+<div style={{display: props.verb == 'delete' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js {3}+supabase+ .delete(tableName)+ .lte(columnName, filterValue)+```++</div>++Finds all rows whose value on the stated columnName is less than or equal to the specified filterValue.++<Collapsable title="Toggle Example">++<div style={{display: props.verb == 'get' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js+supabase+ .get('countries')+ .gte('id', 20)+```++</div>+<div style={{display: props.verb == 'patch' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js+supabase+ .patch('countries')+ .gte('id', 20)+```++</div>+<div style={{display: props.verb == 'delete' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js+supabase+ .delete('countries')+ .gte('id', 20)+```++</div>++</Collapsable>++##### columnName `:string`+Name of database column.++##### filterValue `{:string|:integer|:boolean}`+Value to compare to.++----++### `like()`++<div style={{display: props.verb == 'get' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js {3}+supabase+ .get(tableName)+ .like(columnName, stringPattern)+```++</div>+<div style={{display: props.verb == 'patch' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js {3}+supabase+ .patch(tableName)+ .like(columnName, stringPattern)+```++</div>+<div style={{display: props.verb == 'delete' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js {3}+supabase+ .delete(tableName)+ .like(columnName, stringPattern)+```++</div>++Finds all rows whose value in the stated columnName matches the supplied pattern.++<Collapsable title="Toggle Example">++<div style={{display: props.verb == 'get' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js+supabase+ .get('countries')+ .like('name', '%United%')+```++</div>+<div style={{display: props.verb == 'patch' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js+supabase+ .patch('countries')+ .like('name', '%United%')+```++</div>+<div style={{display: props.verb == 'delete' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js+supabase+ .delete('countries')+ .like('name', '%United%')+```++</div>++</Collapsable>++##### columnName `:string`+Name of database column.++##### stringPattern `:string`+String pattern to compare to. A comprehensive guide on how to form proper patterns can be found [here](https://www.postgresql.org/docs/current/functions-matching.html).+++----++### `ilike()`+++<div style={{display: props.verb == 'get' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js {3}+supabase+ .get(tableName)+ .ilike(columnName, stringPattern)+```++</div>+<div style={{display: props.verb == 'patch' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js {3}+supabase+ .patch(tableName)+ .ilike(columnName, stringPattern)+```++</div>+<div style={{display: props.verb == 'delete' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js {3}+supabase+ .delete(tableName)+ .ilike(columnName, stringPattern)+```++</div>++A case-insensitive version of `like()`.++<Collapsable title="Toggle Example">++<div style={{display: props.verb == 'get' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js+supabase+ .get('countries')+ .ilike('name', '%united%')+```++</div>+<div style={{display: props.verb == 'patch' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js+supabase+ .patch('countries')+ .ilike('name', '%united%')+```++</div>+<div style={{display: props.verb == 'delete' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js+supabase+ .delete('countries')+ .ilike('name', '%united%')+```++</div>++</Collapsable>++##### columnName `:string`+Name of database column.++##### stringPattern `:string`+String pattern to compare to. A comprehensive guide on how to form proper patterns can be found [here](https://www.postgresql.org/docs/current/functions-matching.html).+++----+++### `is()`++<div style={{display: props.verb == 'get' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js {3}+supabase+ .get(tableName)+ .is(columnName, stringPattern)+```++</div>+<div style={{display: props.verb == 'patch' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js {3}+supabase+ .patch(tableName)+ .is(columnName, stringPattern)+```++</div>+<div style={{display: props.verb == 'delete' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js {3}+supabase+ .delete(tableName)+ .is(columnName, stringPattern)+```++</div>++A check for exact equality (**null**, **true**, **false**), finds all rows whose value on the stated columnName exactly match the specified filterValue.++<Collapsable title="Toggle Example">++<div style={{display: props.verb == 'get' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js+supabase+ .get('countries')+ .is('name', null)+```++</div>+<div style={{display: props.verb == 'patch' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js+supabase+ .patch('countries')+ .is('name', null)+```++</div>+<div style={{display: props.verb == 'delete' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js+supabase+ .delete('countries')+ .is('name', null)+```++</div>++</Collapsable>++##### columnName `:string`+Name of database column.++##### stringPattern `{:null|:boolean}`+Value to match.++----++### `in()`+++<div style={{display: props.verb == 'get' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js {3}+supabase+ .get(tableName)+ .is(columnName, filterArray)+```++</div>+<div style={{display: props.verb == 'patch' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js {3}+supabase+ .patch(tableName)+ .is(columnName, filterArray)+```++</div>+<div style={{display: props.verb == 'delete' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js {3}+supabase+ .delete(tableName)+ .is(columnName, filterArray)+```++</div>++Finds all rows whose value on the stated columnName is found on the specified filterArray.++<Collapsable title="Toggle Example">++<div style={{display: props.verb == 'get' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js+supabase+ .get('countries')+ .in('name', ['China', 'France'])+```++</div>+<div style={{display: props.verb == 'patch' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js+supabase+ .patch('countries')+ .in('name', ['China', 'France'])+```++</div>+<div style={{display: props.verb == 'delete' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js+supabase+ .delete('countries')+ .in('name', ['China', 'France'])+```++</div>++</Collapsable>++##### columnName `:string`+Name of database column.++##### filterArray `:array`+Array of values to find a match. Data type of values is dependent on the columnName specified.+++----++### `not()`++<div style={{display: props.verb == 'get' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js {3}+supabase+ .get(tableName)+ .not(columnName, filterValue)+```++</div>+<div style={{display: props.verb == 'patch' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js {3}+supabase+ .patch(tableName)+ .not(columnName, filterValue)+```++</div>+<div style={{display: props.verb == 'delete' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js {3}+supabase+ .delete(tableName)+ .not(columnName, filterValue)+```++</div>++Returns an array of rows whose value on the stated columnName is found on the specified filterArray.++<Collapsable title="Toggle Example">++<div style={{display: props.verb == 'get' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js+supabase+ .get('countries')+ .not('name', 'China')+```++</div>+<div style={{display: props.verb == 'patch' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js+supabase+ .patch('countries')+ .not('name', 'China')+```++</div>+<div style={{display: props.verb == 'delete' ? 'block' : 'none'}}>++<!-- prettier-ignore -->+```js+supabase+ .delete('countries')+ .not('name', 'China')+```++</div>++</Collapsable>++##### columnName `:string`+Name of database column.++##### filterValue `{:string|:integer|:boolean}`+Value to **not** match.++----diff --git a/web/docs/common/DummyData.mdx b/web/docs/common/DummyData.mdxindex 05e404d988b..f7416d79cc0 100644--- a/web/docs/common/DummyData.mdx+++ b/web/docs/common/DummyData.mdx@@ -1,6 +1,6 @@-<div class="DummyData">-<div class="">+<div className="DummyData">+<div className=""><strong>Countries</strong>| id | name | iso2 | continent |@@ -13,7 +13,7 @@| 840 | United States | US | North America |</div>-<div class="">+<div className=""><strong>Cities</strong>| name | country_id |diff --git a/web/docs/library/delete.mdx b/web/docs/library/delete.mdxindex bf063cd5368..a7f35c91e34 100644--- a/web/docs/library/delete.mdx+++ b/web/docs/library/delete.mdx@@ -1,98 +1,76 @@---id: delete-title: 'Deleting Rows'+title: 'Deleting your data'----import Tabs from '@theme/Tabs';-import TabItem from '@theme/TabItem';-We will be using these tables as reference for our examples:-```json-{- "companies": [- { "Id": 1, "name": "Pied Piper", "employeeCount": 10 },- { "Id": 2, "name": "Hooli", "employeeCount": 1000 },- { "Id": 3, "name": "Yao Net", "employeeCount": 100 },- { "Id": 4, "name": "See Food App", "employeeCount": null }- ],-}-```+import DummyData from '../common/DummyData.mdx'+import Collapsable from '../../src/components/Collapsable'+import CommonResponses from '../common/CommonResponses.mdx'+import CommonFilters from '../common/CommonFilters.mdx'-<Tabs- defaultValue="nodeJs"- values={[- { label: 'Node.js', value: 'nodeJs', },- { label: 'Python', value: 'py', },- ]-}>-<TabItem value="nodeJs">-```js-supabase.delete(tableName, options?)+We will be using these tables as reference for our examples:-```-Given the `options?` set (if any), this delete all rows from the specified `tableName`.-</TabItem>+<DummyData />-<TabItem value="py">-```py-# TODO-```-</TabItem>-</Tabs>-## Method arguments-### tableName-`required` string-Name of table in the database that will have its rows deleted.+### Delete records-### options-`optional` object-All available options and examples it their usage can be found [here](../library/options).+This example how to delete a city:-## Additional filtering-To specifically indicate which resources are to be deleted, additional filters can be used.-They can be found [here](../library/filters).+<!-- prettier-ignore -->+```js {8-10}+import { createClient } from '@supabase/supabase-js'-## Example+const supabase = createClient('https://world.supabase.io', '1a2b-3c4d-5e6f-7g8h')-### Mass delete-Updating employeeCount for all companies.-```js-const deleteCompanies = async () => {- try{- let company = await supabase.delete("companies")- return company+const updateCountryName = async () => {+ try {+ let values = await supabase+ .delete('cities', { name: 'Mordor' })+ .match({ id: 666 })++ return values} catch (error) {- console.log("Error: ", error)+ console.log('Error: ', error)}}```-Upon a successful deletion, the status code `204 Accepted` will be returned.-When getting all companies again, as shown [by this example](../library/get#generic),-the following will be returned with the status code `200 OK`:-```json-[]-```+<Collapsable title="Toggle Example Response">++@todo++</Collapsable>-### Using filters-Deleting companies where its columnName "name" is equal to "See Food App".++## Reference+++### `delete()````js-supabase.delete("companies").eq("name", "See Food App")+supabase+ .post(tableName, options?)```-Upon a successful deletion, the status code `204 Accepted` will be returned.-When getting all companies again, as shown [by this example](../library/get#generic),-the following will be returned with the status code `200 OK`:-```json-[- { "Id": 1, "name": "Pied Piper", "employeeCount": 10 },- { "Id": 2, "name": "Hooli", "employeeCount": 1000 },- { "Id": 3, "name": "Yao Net", "employeeCount": 100 }-]-```+##### tableName `:string`+Name of table in the database with the data that should be deleted.++##### options `:object?`+@todo++----+++## Filtering++<CommonFilters verb="delete" />## Responses-Aside from the status code `204 Accepted`, other common responses can be found [here](../library/responses).\ No newline at end of file++#### 200 OK+Successful++<CommonResponses />\ No newline at end of filediff --git a/web/docs/library/get.mdx b/web/docs/library/get.mdxindex 428479bf5c8..d7b88116ba9 100644--- a/web/docs/library/get.mdx+++ b/web/docs/library/get.mdx@@ -7,6 +7,7 @@ import Tabs from '@theme/Tabs'import TabItem from '@theme/TabItem'import DummyData from '../common/DummyData.mdx'import CommonResponses from '../common/CommonResponses.mdx'+import CommonFilters from '../common/CommonFilters.mdx'import Collapsable from '../../src/components/Collapsable'We will be using these tables as reference for our examples:@@ -272,341 +273,9 @@ Returns the first row of the table as an object and **not** as an array.-----### `match()`--<!-- prettier-ignore -->-```js {3}-supabase- .get(tableName)- .match(filterObject)-```--Returns an array of rows that exactly match the specified filterObject.--<Collapsable title="Toggle Example">--<!-- prettier-ignore -->-```js-supabase- .get('countries')- .match({ 'continent': 'Asia'})-```--</Collapsable>---##### filterObject `:object`-An object of `{ 'columnName': 'criteria' }`--------### `eq()`--<!-- prettier-ignore -->-```js {3}-supabase- .get(tableName)- .eq(columnName, filterValue)-```--"Equals": Returns an array of rows whose value on the stated columnName exactly matches the specified filterValue.--<Collapsable title="Toggle Example">--<!-- prettier-ignore -->-```js-supabase- .get('countries')- .eq('name', 'New Zealand')-```--</Collapsable>--##### columnName `:string`-Name of database column.--##### filterValue `{:string|:integer|:boolean}`-Value to match.--------### `gt()`--<!-- prettier-ignore -->-```js {3}-supabase- .get(tableName)- .gt(columnName, filterValue)-```--"Greater Than": Returns an array of rows whose value on the stated columnName exactly matches the specified filterValue.--<Collapsable title="Toggle Example">--<!-- prettier-ignore -->-```js-supabase- .get('countries')- .gt('id', 20)-```--</Collapsable>--##### columnName `:string`-Name of database column.--##### filterValue `{:string|:integer|:boolean}`-Value to compare to.---------### `lt()`--<!-- prettier-ignore -->-```js {3}-supabase- .get(tableName)- .lt(columnName, filterValue)-```--"Less Than": Returns an array of rows whose value on the stated columnName is less than the specified filterValue.--<Collapsable title="Toggle Example">--<!-- prettier-ignore -->-```js-supabase- .get('countries')- .lt('id', 20)-```--</Collapsable>--##### columnName `:string`-Name of database column.--##### filterValue `{:string|:integer|:boolean}`-Value to compare to.--------### `gte()`--<!-- prettier-ignore -->-```js {3}-supabase- .get(tableName)- .gte(columnName, filterValue)-```--"Greater Than or Equal": Returns an array of rows whose value on the stated columName is greater than or equal to the specified filterValue.--<Collapsable title="Toggle Example">--<!-- prettier-ignore -->-```js-supabase- .get('countries')- .gte('id', 20)-```--</Collapsable>--##### columnName `:string`-Name of database column.--##### filterValue `{:string|:integer|:boolean}`-Value to compare to.--------### `lte()`--<!-- prettier-ignore -->-```js {3}-supabase- .get(tableName)- .lte(columnName, filterValue)-```--"Less Than or Equal": Returns an array of rows whose value on the stated columnName is less than or equal to the specified filterValue.--<Collapsable title="Toggle Example">--<!-- prettier-ignore -->-```js-supabase- .get('countries')- .gte('id', 20)-```--</Collapsable>--##### columnName `:string`-Name of database column.--##### filterValue `{:string|:integer|:boolean}`-Value to compare to.--------### `like()`--<!-- prettier-ignore -->-```js {3}-supabase- .get(tableName)- .like(columnName, stringPattern)-```--Returns an array of rows whose value in the stated columnName matches the supplied pattern.--<Collapsable title="Toggle Example">--<!-- prettier-ignore -->-```js-supabase- .get('countries')- .like('name', '%United%')-```--</Collapsable>--##### columnName `:string`-Name of database column.--##### stringPattern `:string`-String pattern to compare to. A comprehensive guide on how to form proper patterns can be found [here](https://www.postgresql.org/docs/current/functions-matching.html).---------### `ilike()`--<!-- prettier-ignore -->-```js {3}-supabase- .get(tableName)- .ilike(columnName, stringPattern)-```--A case-insensitive version of `like()`.--<Collapsable title="Toggle Example">--<!-- prettier-ignore -->-```js-supabase- .get('countries')- .ilike('name', '%united%')-```--</Collapsable>--##### columnName `:string`-Name of database column.--##### stringPattern `:string`-String pattern to compare to. A comprehensive guide on how to form proper patterns can be found [here](https://www.postgresql.org/docs/current/functions-matching.html).----------### `is()`--<!-- prettier-ignore -->-```js {3}-supabase- .get(tableName)- .is(columnName, stringPattern)-```--A check for exact equality (**null**, **true**, **false**), returns an array of rows whose value on the stated columnName exactly match the specified filterValue.--<Collapsable title="Toggle Example">--<!-- prettier-ignore -->-```js-supabase- .get('countries')- .is('name', null)-```--</Collapsable>--##### columnName `:string`-Name of database column.--##### stringPattern `{:null|:boolean}`-Value to match.--------### `in()`--<!-- prettier-ignore -->-```js {3}-supabase- .get(tableName)- .is(columnName, filterArray)-```--Returns an array of rows whose value on the stated columnName is found on the specified filterArray.--<Collapsable title="Toggle Example">--<!-- prettier-ignore -->-```js-supabase- .get('countries')- .in('name', ['China', 'France'])-```--</Collapsable>--##### columnName `:string`-Name of database column.--##### filterArray `:array`-Array of values to find a match. Data type of values is dependent on the columnName specified.---------### `not()`--<!-- prettier-ignore -->-```js {3}-supabase- .get(tableName)- .not(columnName, filterValue)-```--Returns an array of rows whose value on the stated columnName is found on the specified filterArray.--<Collapsable title="Toggle Example">--<!-- prettier-ignore -->-```js-supabase- .get('countries')- .not('name', 'China')-```--</Collapsable>--##### columnName `:string`-Name of database column.--##### filterValue `{:string|:integer|:boolean}`-Value to **not** match.--------+## Filtering+<CommonFilters verb="get" />## Responsesdiff --git a/web/docs/library/patch.mdx b/web/docs/library/patch.mdxindex e29da71eb6b..d3586f2f99d 100644--- a/web/docs/library/patch.mdx+++ b/web/docs/library/patch.mdx@@ -3,137 +3,78 @@ id: patchtitle: 'Updating your data'----import Tabs from '@theme/Tabs';-import TabItem from '@theme/TabItem';++import DummyData from '../common/DummyData.mdx'+import Collapsable from '../../src/components/Collapsable'+import CommonResponses from '../common/CommonResponses.mdx'+import CommonFilters from '../common/CommonFilters.mdx'+We will be using these tables as reference for our examples:-```json-{- "companies": [- { "Id": 1, "name": "Pied Piper", "employeeCount": 10 },- { "Id": 2, "name": "Hooli", "employeeCount": 1000 },- { "Id": 3, "name": "Yao Net", "employeeCount": 100 },- { "Id": 4, "name": "See Food App", "employeeCount": null }- ],-}-```-<Tabs- defaultValue="nodeJs"- values={[- { label: 'Node.js', value: 'nodeJs', },- { label: 'Python', value: 'py', },- ]-}>-<TabItem value="nodeJs">+<DummyData />-```js-supabase.patch(tableName, data, options?)-```-Given the `options?` set (if any), this **asynchronously** and partially updates all rows from the specified `tableName` in your database-with the specified `data`.-</TabItem>-<TabItem value="py">+### Update record-```py-# TODO-```-</TabItem>-</Tabs>--<Tabs- defaultValue="nodeJs"- values={[- { label: 'Node.js', value: 'nodeJs', },- { label: 'Python', value: 'py', },- ]-}>-<TabItem value="nodeJs">+This example how to update a country:-```js-supabase.put(tableName, data, options?)+<!-- prettier-ignore -->+```js {8}+import { createClient } from '@supabase/supabase-js'-```-Given the `options?` set (if any), this **asynchronously** and fully replaces all rows from the specified `tableName` in your database-with the specified `data`.-</TabItem>+const supabase = createClient('https://world.supabase.io', '1a2b-3c4d-5e6f-7g8h')-<TabItem value="py">+const updateCountryName = async () => {+ try {+ let updates = await supabase+ .patch('countries', { name: 'Middle Earth' })+ .match({ name: 'New Zealand' })-```py-# TODO+ return updates+ } catch (error) {+ console.log('Error: ', error)+ }+}```-</TabItem>-</Tabs>-## Method arguments-Arguments for both types of update are the same.-### tableName-`required` string-Name of table in the database that will be updated.+<Collapsable title="Toggle Example Response">-### data-`required` array-Array of rows of type `object` which contain information to be updated into the selected table.+@todo+</Collapsable>-### options-`optional` object-All available options and examples it their usage can be found [here](../library/options).-## Additional filtering-To specifically indicate which resources are to be updated, additional filters can be used.-They can be found [here](../library/filters).+## Reference-## Example--### Mass update-Updating employeeCount for all companies.-```js {3}-const updateCompanies = async () => {- try{- let companies = await supabse.patch("companies", { employeeCount: 50 })- return companies- } catch (error) {- console.log("Error: ", error)- }-}-supabase.patch("companies", { employeeCount: 50 })+### `patch()`+```js+supabase+ .patch(tableName, data, options?)```-The following will be returned with the status code `200 OK`:-```json-[- { "Id": 1, "name": "Pied Piper", "employeeCount": 50 },- { "Id": 2, "name": "Hooli", "employeeCount": 50 },- { "Id": 3, "name": "Yao Net", "employeeCount": 50 },- { "Id": 4, "name": "See Food App", "employeeCount": 50 }-]-```+##### tableName `:string`+Name of table in the database where data will be saved.-### Using filters-Updating employeeCount for companies where its columnName "name" is equal to "See Food App".-```js {3-4}-const updateCompany = async () => {- try{- let company = await supabase.patch("companies", {employeeCount: 25 })- .eq("name", "See Food App")- return company- } catch (error) {- console.log("Error: ", error)- }-}-```+##### data `:object`+New record values.-The following will be returned with the status code `200 OK`:-```json-[- { "Id": 4, "name": "See Food App", "employeeCount": 50 }-]-```++##### options `:object?`+@todo++----+++## Filtering++<CommonFilters verb="patch" />## Responses-Aside from the status code `200 OK`, other common responses can be found [here](../library/responses).\ No newline at end of file++#### 200 OK+Successful++<CommonResponses />\ No newline at end of filediff --git a/web/docs/library/post.mdx b/web/docs/library/post.mdxindex be5ac80f777..f44e0a8dec0 100644--- a/web/docs/library/post.mdx+++ b/web/docs/library/post.mdx@@ -3,137 +3,105 @@ id: posttitle: 'Creating data'----import Tabs from '@theme/Tabs';-import TabItem from '@theme/TabItem';--<Tabs- defaultValue="nodeJs"- values={[- { label: 'Node.js', value: 'nodeJs', },- { label: 'Python', value: 'py', },- ]-}>-<TabItem value="nodeJs">-```js-supabase.post(tableName, data, options?)+import DummyData from '../common/DummyData.mdx'+import Collapsable from '../../src/components/Collapsable'+import CommonResponses from '../common/CommonResponses.mdx'-```-Given the `options?` set (if any), this **asynchronously** posts `data` into the selected `tableName` in your database.-</TabItem>-<TabItem value="py">+We will be using these tables as reference for our examples:-```py-# TODO-```-</TabItem>-</Tabs>+<DummyData />-## Method arguments-### tableName-`required` string-Name of table in the database where data will be saved.-### data-`required` array-Array of rows of type `object` which contain information to be saved into the selected table.+### Create a record-### options-`optional` object-All available options and examples it their usage can be found [here](../library/options).+This example how to create a new city:-## Example+<!-- prettier-ignore -->+```js {7-8}+import { createClient } from '@supabase/supabase-js'-### Posting a Single Row-<Tabs- defaultValue="nodeJs"- values={[- { label: 'Node.js', value: 'nodeJs', },- { label: 'Python', value: 'py', },- ]-}>-<TabItem value="nodeJs">+const supabase = createClient('https://world.supabase.io', '1a2b-3c4d-5e6f-7g8h')-```js {4-9}-const postUsers = async () => {+const getCities = async () => {try {- let users = await supabase- .post(- "users",- [- { fullName: "Nelson Bighetti" },- ],- )- return users+ let cities = await supabase+ .post('cities', [+ { name: 'The Shire', country_id: 554 }+ ])+ return cities} catch (error) {- console.log('Error:', error)+ console.log('Error: ', error)}}-```-</TabItem>-<TabItem value="py">+<Collapsable title="Toggle Example Response">-```py-# TODO-```-</TabItem>-</Tabs>--### Posting Multiple Rows-<Tabs- defaultValue="nodeJs"- values={[- { label: 'Node.js', value: 'nodeJs', },- { label: 'Python', value: 'py', },- ]-}>-<TabItem value="nodeJs">--```js {4-10}-const postUsers = async () => {+@todo++</Collapsable>++### Bulk create++This example how to create multiple cities with one request:++<!-- prettier-ignore -->+```js {7-8}+import { createClient } from '@supabase/supabase-js'++const supabase = createClient('https://world.supabase.io', '1a2b-3c4d-5e6f-7g8h')++const createCities = async () => {try {- let users = await supabase- .post(- "users",- [- { fullName: "Richard Hendrix" },- { fullName: "Elrich Bachman" }- ],- )- return users+ let cities = await supabase+ .post('cities', [+ { name: 'The Shire', country_id: 554 },+ { name: 'Rohan', country_id: 554 },+ ])+ return cities} catch (error) {- console.log('Error:', error)+ console.log('Error: ', error)}}-```-</TabItem>-<TabItem value="py">+<Collapsable title="Toggle Example Response">++@todo++</Collapsable>-```py-# TODO++++## Reference++++### `post()`+```js+supabase+ .post(tableName, data, options?)```-</TabItem>-</Tabs>++##### tableName `:string`+Name of table in the database where data will be saved.++##### data `:array`+Array of rows of type `object` which contain information to be saved into the selected table.+++##### options `:object?`+@todo++## Responses-### 201 Created-The request has succeeded. New resource created will be returned:--```json-{- "rows": [- { "fullName": "Richard Hendrix" },- { "fullName": "Elrich Bachman"}- ]-}-```+#### 201 Created+Successful-### Common Responses-Other responses can be found [here](../library/responses).\ No newline at end of file+<CommonResponses />\ No newline at end of filediff --git a/web/src/pages/index.js b/web/src/pages/index.jsindex 45e08e2aa8e..e58dd00e41a 100755--- a/web/src/pages/index.js+++ b/web/src/pages/index.js@@ -113,8 +113,8 @@ function Home() {<section className={styles.forDevelopers}><div className="container">- <div class="row">- <div class="col col--8 col--offset-2">+ <div className="row">+ <div className="col col--8 col--offset-2"><h2 className="with-underline text--center">For Developers</h2><p className="text--center">We're a bunch of developers, building tools for developers. Tools that we even use@@ -125,13 +125,13 @@ function Home() {</div></div><div className="row">- <div class="col col--9">+ <div className="col col--9"><p>Code here</p></div>- <div class="col col--3">- <button class="button button--block button--primary">Realtime</button>- <button class="button button--block button--link">Get records</button>- <button class="button button--block button--link">Create Records</button>+ <div className="col col--3">+ <button className="button button--block button--primary">Realtime</button>+ <button className="button button--block button--link">Get records</button>+ <button className="button button--block button--link">Create Records</button></div></div></div>