mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 09:25:06 +03:00
Fix missing modifiers entry and invalid syntax in Kotlin docs (#19945)
* fix kotlin docs * fix example * Apply suggestions from code review --------- Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>
This commit is contained in:
1 parent
734049feb8
commit
8bd805fb92
1 file changed
+52
-2
+52
-2
@@ -518,7 +518,7 @@ functions:
|
||||
isSpotlight: true
|
||||
code: |
|
||||
```kotlin
|
||||
let toUpsert = User(username = "supabot")
|
||||
val toUpsert = User(username = "supabot")
|
||||
supabase.from("users").upsert(toUpsert, onConflict = "username")
|
||||
```
|
||||
- id: upsert-return-row-count
|
||||
@@ -526,7 +526,7 @@ functions:
|
||||
isSpotlight: true
|
||||
code: |
|
||||
```kotlin
|
||||
let toUpsert = User(username = "supabot")
|
||||
val toUpsert = User(username = "supabot")
|
||||
val count = supabase.from("users").upsert(toUpsert, onConflict = "username") {
|
||||
count(Count.EXACT)
|
||||
}.count()
|
||||
@@ -1963,6 +1963,56 @@ functions:
|
||||
}
|
||||
```
|
||||
hideCodeBlock: true
|
||||
- id: using-modifiers
|
||||
title: Using Modifiers
|
||||
description: |
|
||||
Filters work on the row level—they allow you to return rows that
|
||||
only match certain conditions without changing the shape of the rows.
|
||||
Modifiers are everything that don't fit that definition—allowing you to
|
||||
change the format of the response (e.g., returning a CSV string).
|
||||
|
||||
Modifiers are be specified next to the filter block. Some modifiers only apply for
|
||||
queries that return rows (e.g., `select()` or `rpc()` on a function that
|
||||
returns a table response).
|
||||
- id: db-modifiers-select
|
||||
title: select()
|
||||
$ref: '@supabase/postgrest-js.PostgrestTransformBuilder.select'
|
||||
examples:
|
||||
- id: with-upsert
|
||||
name: With `upsert()`
|
||||
code: |
|
||||
```kotlin
|
||||
val toUpsert = Country(id = 2, name = "Algeria")
|
||||
val count = supabase.from("countries").upsert(toUpsert) {
|
||||
select()
|
||||
}.decodeSingle<Country>()
|
||||
```
|
||||
data:
|
||||
sql: |
|
||||
```sql
|
||||
create table
|
||||
countries (id int8 primary key, name text);
|
||||
|
||||
insert into
|
||||
countries (id, name)
|
||||
values
|
||||
(1, 'Afghanistan');
|
||||
```
|
||||
response: |
|
||||
```json
|
||||
{
|
||||
"data": [
|
||||
{
|
||||
"id": 2,
|
||||
"name": "Algeria"
|
||||
}
|
||||
],
|
||||
"status": 201,
|
||||
"statusText": "Created"
|
||||
}
|
||||
```
|
||||
hideCodeBlock: true
|
||||
isSpotlight: true
|
||||
- id: order
|
||||
title: order()
|
||||
description: |
|
||||
|
||||
Reference in new issue
Block a user