From 2df761a28cab2ae8d01b3ab1fb956843cd2ba77b Mon Sep 17 00:00:00 2001 From: Angelico Date: Tue, 14 Jan 2020 11:50:30 +0800 Subject: [PATCH] Clean up Documentation The following changes were made: - Edit all reference to api endpoints from supabase.io to supabase.co. - Clean up function calls for .update(), insert() and .delete(). --- web/docs/library/delete.mdx | 5 +++-- web/docs/library/get.mdx | 6 +++--- web/docs/library/getting-started.mdx | 2 +- web/docs/library/patch.mdx | 9 +++++---- web/docs/library/post.mdx | 7 ++++--- web/docs/library/stored-procedures.mdx | 6 +++--- web/docs/library/subscribe.mdx | 16 ++++++++-------- web/src/pages/index.js | 10 +++++----- 8 files changed, 32 insertions(+), 29 deletions(-) diff --git a/web/docs/library/delete.mdx b/web/docs/library/delete.mdx index 4ab3d8971c..84e2ab56aa 100644 --- a/web/docs/library/delete.mdx +++ b/web/docs/library/delete.mdx @@ -25,7 +25,7 @@ This example how to delete a city: ```js {7-10} import { createClient } from '@supabase/supabase-js' -const supabase = createClient('https://world.supabase.io', '1a2b-3c4d-5e6f-7g8h') +const supabase = createClient('https://world.supabase.co', '1a2b-3c4d-5e6f-7g8h') const updateCountryName = async () => { try { @@ -54,8 +54,9 @@ const updateCountryName = async () => { ### `delete()` -```js {2} +```js {3} supabase + .from(tableName) .delete(options?) ``` diff --git a/web/docs/library/get.mdx b/web/docs/library/get.mdx index 88d8b02a96..6d1c08d900 100644 --- a/web/docs/library/get.mdx +++ b/web/docs/library/get.mdx @@ -23,7 +23,7 @@ This example shows how to get all the countries in our database: ```js {7-8} import { createClient } from '@supabase/supabase-js' -const supabase = createClient('https://world.supabase.io', '1a2b-3c4d-5e6f-7g8h') +const supabase = createClient('https://world.supabase.co', '1a2b-3c4d-5e6f-7g8h') const getCities = async () => { try { @@ -61,7 +61,7 @@ This example shows how to get all cities but only return the name: ```js {9} import { createClient } from '@supabase/supabase-js' -const supabase = createClient('https://world.supabase.io', '1a2b-3c4d-5e6f-7g8h') +const supabase = createClient('https://world.supabase.co', '1a2b-3c4d-5e6f-7g8h') const getCities = async () => { try { @@ -101,7 +101,7 @@ This example shows how to get all countries and the cities their cities: ```js {9-14} import { createClient } from '@supabase/supabase-js' -const supabase = createClient('https://world.supabase.io', '1a2b-3c4d-5e6f-7g8h') +const supabase = createClient('https://world.supabase.co', '1a2b-3c4d-5e6f-7g8h') const getCountries = async () => { try { diff --git a/web/docs/library/getting-started.mdx b/web/docs/library/getting-started.mdx index 444d7bd38a..ab62ac8eff 100755 --- a/web/docs/library/getting-started.mdx +++ b/web/docs/library/getting-started.mdx @@ -19,7 +19,7 @@ yarn install @supabase/supabase-js import { createClient } from '@supabase/supabase-js' // Create a single supabase client for interacting with your database -const supabase = createClient("https://xyzcompany.supabase.io", "1a2b-3c4d-5e6f-7g8h"); +const supabase = createClient("https://xyzcompany.supabase.co", "1a2b-3c4d-5e6f-7g8h"); ``` diff --git a/web/docs/library/patch.mdx b/web/docs/library/patch.mdx index f087898227..01ba8af197 100644 --- a/web/docs/library/patch.mdx +++ b/web/docs/library/patch.mdx @@ -23,7 +23,7 @@ This example how to update a country: ```js {7-10} import { createClient } from '@supabase/supabase-js' -const supabase = createClient('https://world.supabase.io', '1a2b-3c4d-5e6f-7g8h') +const supabase = createClient('https://world.supabase.co', '1a2b-3c4d-5e6f-7g8h') const updateCountryName = async () => { try { @@ -51,10 +51,11 @@ const updateCountryName = async () => { ### `from()` -### `patch()` -```js {2} +### `update()` +```js {3} supabase - .patch(tableName, data, options?) + .from(tableName) + .udpate(data, options?) ``` #### `data: object` diff --git a/web/docs/library/post.mdx b/web/docs/library/post.mdx index 4361573e2c..d8c59636ff 100644 --- a/web/docs/library/post.mdx +++ b/web/docs/library/post.mdx @@ -24,7 +24,7 @@ This example how to create a new city: ```js {7-11} import { createClient } from '@supabase/supabase-js' -const supabase = createClient('https://world.supabase.io', '1a2b-3c4d-5e6f-7g8h') +const supabase = createClient('https://world.supabase.co', '1a2b-3c4d-5e6f-7g8h') const getCities = async () => { try { @@ -54,7 +54,7 @@ This example how to create multiple cities with one request: ```js {7-12} import { createClient } from '@supabase/supabase-js' -const supabase = createClient('https://world.supabase.io', '1a2b-3c4d-5e6f-7g8h') +const supabase = createClient('https://world.supabase.co', '1a2b-3c4d-5e6f-7g8h') const createCities = async () => { try { @@ -86,8 +86,9 @@ const createCities = async () => { ### `insert()` -```js {2} +```js {3} supabase + .from(tableName) .insert(data, options?) ``` diff --git a/web/docs/library/stored-procedures.mdx b/web/docs/library/stored-procedures.mdx index 75f7e72bbd..6c5477d82e 100644 --- a/web/docs/library/stored-procedures.mdx +++ b/web/docs/library/stored-procedures.mdx @@ -20,7 +20,7 @@ This example shows how to call a stored function that takes in a name of a city ```js {7-8} import { createClient } from '@supabase/supabase-js' -const supabase = createClient('https://world.supabase.io', '1a2b-3c4d-5e6f-7g8h') +const supabase = createClient('https://world.supabase.co', '1a2b-3c4d-5e6f-7g8h') const echoCity = async () => { try{ @@ -49,7 +49,7 @@ This example shows how to call a stored function that takes in a names of cities ```js {7-11} import { createClient } from '@supabase/supabase-js' -const supabase = createClient('https://world.supabase.io', '1a2b-3c4d-5e6f-7g8h') +const supabase = createClient('https://world.supabase.co', '1a2b-3c4d-5e6f-7g8h') const echoCities = async () => { try{ @@ -84,7 +84,7 @@ This example shows how to call a stored function that returns a table type respo ```js {7-8} import { createClient } from '@supabase/supabase-js' -const supabase = createClient('https://world.supabase.io', '1a2b-3c4d-5e6f-7g8h') +const supabase = createClient('https://world.supabase.co', '1a2b-3c4d-5e6f-7g8h') const echoCities = async () => { try{ diff --git a/web/docs/library/subscribe.mdx b/web/docs/library/subscribe.mdx index 5244b5c240..f8823675ee 100644 --- a/web/docs/library/subscribe.mdx +++ b/web/docs/library/subscribe.mdx @@ -20,7 +20,7 @@ We will be using these tables as reference for our examples. import { createClient } from '@supabase/supabase-js' // Create a single supabase client for interacting with your database -const supabase = createClient('https://world.supabase.io', '1a2b-3c4d-5e6f-7g8h') +const supabase = createClient('https://world.supabase.co', '1a2b-3c4d-5e6f-7g8h') // Listen to changes const mySubscription = supabase @@ -38,7 +38,7 @@ const mySubscription = supabase import { createClient } from '@supabase/supabase-js' // Create a single supabase client for interacting with your database -const supabase = createClient('https://world.supabase.io', '1a2b-3c4d-5e6f-7g8h') +const supabase = createClient('https://world.supabase.co', '1a2b-3c4d-5e6f-7g8h') // Listen to changes const mySubscription = supabase @@ -56,7 +56,7 @@ const mySubscription = supabase import { createClient } from '@supabase/supabase-js' // Create a single supabase client for interacting with your database -const supabase = createClient('https://world.supabase.io', '1a2b-3c4d-5e6f-7g8h') +const supabase = createClient('https://world.supabase.co', '1a2b-3c4d-5e6f-7g8h') // Listen to changes const mySubscription = supabase @@ -74,7 +74,7 @@ const mySubscription = supabase import { createClient } from '@supabase/supabase-js' // Create a single supabase client for interacting with your database -const supabase = createClient('https://world.supabase.io', '1a2b-3c4d-5e6f-7g8h') +const supabase = createClient('https://world.supabase.co', '1a2b-3c4d-5e6f-7g8h') // Listen to changes const mySubscription = supabase @@ -92,7 +92,7 @@ const mySubscription = supabase import { createClient } from '@supabase/supabase-js' // Create a single supabase client for interacting with your database -const supabase = createClient('https://world.supabase.io', '1a2b-3c4d-5e6f-7g8h') +const supabase = createClient('https://world.supabase.co', '1a2b-3c4d-5e6f-7g8h') // Listen to changes const mySubscription = supabase @@ -110,7 +110,7 @@ const mySubscription = supabase import { createClient } from '@supabase/supabase-js' // Create a single supabase client for interacting with your database -const supabase = createClient('https://world.supabase.io', '1a2b-3c4d-5e6f-7g8h') +const supabase = createClient('https://world.supabase.co', '1a2b-3c4d-5e6f-7g8h') // Listen to changes const mySubscription = supabase @@ -127,7 +127,7 @@ const mySubscription = supabase import { createClient } from '@supabase/supabase-js' // Create a single supabase client for interacting with your database -const supabase = createClient('https://world.supabase.io', '1a2b-3c4d-5e6f-7g8h') +const supabase = createClient('https://world.supabase.co', '1a2b-3c4d-5e6f-7g8h') // Listen to changes const mySubscription = supabase @@ -148,7 +148,7 @@ mySubscription.unsubscribe() import { createClient } from '@supabase/supabase-js' // Create a single supabase client for interacting with your database -const supabase = createClient('https://world.supabase.io', '1a2b-3c4d-5e6f-7g8h') +const supabase = createClient('https://world.supabase.co', '1a2b-3c4d-5e6f-7g8h') // Listen to changes const mySubscription = supabase diff --git a/web/src/pages/index.js b/web/src/pages/index.js index 43aa6c3185..c7a7d0cbd8 100755 --- a/web/src/pages/index.js +++ b/web/src/pages/index.js @@ -11,7 +11,7 @@ const heroExample = ` import { createClient } from '@supabase/supabase-js' // Connect to your own PostgreSQL database -const supabase = createClient('https://your-db.supabase.io', '1a2b-3c4d-5e6f-7g8h') +const supabase = createClient('https://your-db.supabase.co', '1a2b-3c4d-5e6f-7g8h') // Receive updates when a new record is inserted into your database const realtime = supabase @@ -25,7 +25,7 @@ const subscribeExample = ` import { createClient } from '@supabase/supabase-js' // Connect to the chat room -const supabase = createClient('https://chat-room.supabase.io', '1a2b-3c4d-5e6f-7g8h') +const supabase = createClient('https://chat-room.supabase.co', '1a2b-3c4d-5e6f-7g8h') // Get notified of all new chat messages const realtime = supabase @@ -39,7 +39,7 @@ const readExample = ` import { createClient } from '@supabase/supabase-js' // Connect to the chat room -const supabase = createClient('https://chat-room.supabase.io', '1a2b-3c4d-5e6f-7g8h') +const supabase = createClient('https://chat-room.supabase.co', '1a2b-3c4d-5e6f-7g8h') // Get public rooms and their messages const publicRooms = await supabase @@ -54,7 +54,7 @@ const createExample = ` import { createClient } from '@supabase/supabase-js' // Connect to the chat room -const supabase = createClient('https://chat-room.supabase.io', '1a2b-3c4d-5e6f-7g8h') +const supabase = createClient('https://chat-room.supabase.co', '1a2b-3c4d-5e6f-7g8h') // Create a new chat room const newRoom = supabase @@ -65,7 +65,7 @@ const updateExample = ` import { createClient } from '@supabase/supabase-js' // Connect to the chat room -const supabase = createClient('https://chat-room.supabase.io', '1a2b-3c4d-5e6f-7g8h') +const supabase = createClient('https://chat-room.supabase.co', '1a2b-3c4d-5e6f-7g8h') // Update a user const updatedUser = supabase