For AI agents: the documentation index is at llms.txt. Guide pages have a markdown version at the same path with .md appended, before any query string or fragment.
values to use upsert.upsert() returns no rows by default. Add select() to the chain to get the rows back.upsert(). Modifiers such as select() and single() still work.struct Instrument: Encodable {
let id: Int
let name: String
}
try await supabase
.from("instruments")
.upsert(Instrument(id: 1, name: "piano"))
.execute()
struct Instrument: Encodable {
let id: Int
let name: String
}
try await supabase
.from("instruments")
.upsert([
Instrument(id: 1, name: "piano"),
Instrument(id: 2, name: "harp"),
])
.execute()
struct User: Encodable {
let handle: String
let displayName: String
enum CodingKeys: String, CodingKey {
case handle
case displayName = "display_name"
}
}
try await supabase
.from("users")
.upsert(
User(handle: "saoirse", displayName: "Saoirse"),
onConflict: "handle"
)
.select()
.execute()