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.
insert() returns no rows by default. Add select() to the chain to get the inserted rows back.insert(). Modifiers such as select() and single() still work.values fails to encode, insert() throws a PostgrestError of kind .invalidRequest and sends no request.struct Instrument: Encodable {
let id: Int
let name: String
}
let instrument = Instrument(id: 1, name: "ukelele")
try await supabase
.from("instruments")
.insert(instrument)
.execute()
struct Instrument: Codable {
let id: Int
let name: String
}
let instrument: Instrument = try await supabase
.from("instruments")
.insert(Instrument(id: 1, name: "banjo"))
.select()
// specify you want a single value returned, otherwise it returns a list.
.single()
.execute()
.value
struct Instrument: Encodable {
let id: Int
let name: String
}
let instruments = [
Instrument(id: 1, name: "xylophone"),
Instrument(id: 2, name: "tuba"),
]
try await supabase
.from("instruments")
.insert(instruments)
.execute()