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().
This commit is contained in:
Angelico
2020-01-14 11:50:30 +08:00
parent 8a483b7412
commit 2df761a28c
8 changed files with 32 additions and 29 deletions

View File

@@ -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 () => {
<FromFunction verb='delete' />
### `delete()`
```js {2}
```js {3}
supabase
.from(tableName)
.delete(options?)
```

View File

@@ -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 {

View File

@@ -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");
```

View File

@@ -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()`
<FromFunction verb='patch' />
### `patch()`
```js {2}
### `update()`
```js {3}
supabase
.patch(tableName, data, options?)
.from(tableName)
.udpate(data, options?)
```
#### `data: object`

View File

@@ -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 () => {
<FromFunction verb='post' />
### `insert()`
```js {2}
```js {3}
supabase
.from(tableName)
.insert(data, options?)
```

View File

@@ -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{

View File

@@ -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

View File

@@ -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