Kotlin: Insert data

Perform an INSERT into the table or view.

Parameters

Examples

Create a record

val city = City(name = "The Shire", countryId = 554)
supabase.from("cities").insert(city)

Create a record and return it

val city = City(name = "The Shire", countryId = 554)
val result = supabase.from("cities").insert(city) \{ 
    select() 
\}.decodeSingle<City>()

Bulk create

val theShire = City(name = "The Shire", countryId = 554)
val rohan = City(name = "Rohan", countryId = 554)
supabase.from("cities").insert(listOf(theShire, rohan))