Kotlin: Upsert data

Parameters

Examples

Upsert your data

val toUpsert = Message(id = 3, message = "foo", username = "supabot")
supabase.from("messages").upsert(toUpsert)

Upserting into tables with constraints

val toUpsert = User(username = "supabot")
supabase.from("users").upsert(toUpsert, onConflict = "username")

Return the exact number of rows

val toUpsert = User(username = "supabot")
val count = supabase.from("users").upsert(toUpsert, onConflict = "username") \{
    count(Count.EXACT)
\}.count()