mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 09:25:06 +03:00
Merge pull request #12218 from supabase/bs/missing-examples
docs(ref/js): add missing examples
This commit is contained in:
2 files changed
+116
-9
No files matched your search
@@ -850,14 +850,14 @@ export const reference = {
|
||||
|
||||
export const reference_javascript_v1 = {
|
||||
icon: 'reference-javascript',
|
||||
title: 'javascript',
|
||||
title: 'JavaScript',
|
||||
url: '/guides/reference/javascript',
|
||||
parent: '/reference',
|
||||
}
|
||||
|
||||
export const reference_javascript_v2 = {
|
||||
icon: 'reference-javascript',
|
||||
title: 'javascript',
|
||||
title: 'JavaScript',
|
||||
url: '/guides/reference/javascript',
|
||||
parent: '/reference',
|
||||
}
|
||||
@@ -878,7 +878,7 @@ export const reference_dart_v1 = {
|
||||
|
||||
export const reference_csharp_v0 = {
|
||||
icon: 'reference-csharp',
|
||||
title: 'c#',
|
||||
title: 'C#',
|
||||
url: 'guides/reference/csharp',
|
||||
parent: '/reference',
|
||||
}
|
||||
|
||||
+113
-6
@@ -972,6 +972,40 @@ functions:
|
||||
.from('countries')
|
||||
.select()
|
||||
```
|
||||
data:
|
||||
sql: |
|
||||
```sql
|
||||
create table
|
||||
countries (id int8 primary key, name text);
|
||||
|
||||
insert into
|
||||
countries (id, name)
|
||||
values
|
||||
(1, 'Afghanistan'),
|
||||
(2, 'Albania'),
|
||||
(3, 'Algeria');
|
||||
```
|
||||
response: |
|
||||
```json
|
||||
{
|
||||
"data": [
|
||||
{
|
||||
"id": 1,
|
||||
"name": "Afghanistan"
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"name": "Albania"
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"name": "Algeria"
|
||||
}
|
||||
],
|
||||
"status": 200,
|
||||
"statusText": "OK"
|
||||
}
|
||||
```
|
||||
- id: selecting-specific-columns
|
||||
name: Selecting specific columns
|
||||
code: |
|
||||
@@ -980,6 +1014,37 @@ functions:
|
||||
.from('countries')
|
||||
.select('name')
|
||||
```
|
||||
data:
|
||||
sql: |
|
||||
```sql
|
||||
create table
|
||||
countries (id int8 primary key, name text);
|
||||
|
||||
insert into
|
||||
countries (id, name)
|
||||
values
|
||||
(1, 'Afghanistan'),
|
||||
(2, 'Albania'),
|
||||
(3, 'Algeria');
|
||||
```
|
||||
response: |
|
||||
```json
|
||||
{
|
||||
"data": [
|
||||
{
|
||||
"name": "Afghanistan"
|
||||
},
|
||||
{
|
||||
"name": "Albania"
|
||||
},
|
||||
{
|
||||
"name": "Algeria"
|
||||
}
|
||||
],
|
||||
"status": 200,
|
||||
"statusText": "OK"
|
||||
}
|
||||
```
|
||||
- id: query-foreign-tables
|
||||
name: Query foreign tables
|
||||
description: |
|
||||
@@ -995,6 +1060,54 @@ functions:
|
||||
)
|
||||
`)
|
||||
```
|
||||
data:
|
||||
sql: |
|
||||
```sql
|
||||
create table
|
||||
countries (id int8 primary key, name text);
|
||||
create table
|
||||
cities (
|
||||
id int8 primary key,
|
||||
country_id int8 not null references countries,
|
||||
name text
|
||||
);
|
||||
|
||||
insert into
|
||||
countries (id, name)
|
||||
values
|
||||
(1, 'Germany'),
|
||||
(2, 'Indonesia');
|
||||
insert into
|
||||
cities (id, country_id, name)
|
||||
values
|
||||
(1, 2, 'Bali'),
|
||||
(2, 1, 'Munich');
|
||||
```
|
||||
response: |
|
||||
```json
|
||||
{
|
||||
"data": [
|
||||
{
|
||||
"name": "Germany",
|
||||
"cities": [
|
||||
{
|
||||
"name": "Munich"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Indonesia",
|
||||
"cities": [
|
||||
{
|
||||
"name": "Bali"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"status": 200,
|
||||
"statusText": "OK"
|
||||
}
|
||||
```
|
||||
- id: query-foreign-tables-through-a-join-table
|
||||
name: Query foreign tables through a join table
|
||||
code: |
|
||||
@@ -1327,12 +1440,6 @@ functions:
|
||||
- id: insert
|
||||
title: 'Create data: insert()'
|
||||
$ref: '@supabase/postgrest-js.PostgrestQueryBuilder.insert'
|
||||
params:
|
||||
- name: values
|
||||
type: object | object []
|
||||
isOptional: false
|
||||
description: |
|
||||
Bobby Bobby Bobby Bobby Bobby Bobby
|
||||
examples:
|
||||
- id: create-a-record
|
||||
name: Create a record
|
||||
|
||||
Reference in new issue
Block a user