Kotlin: Insert data

Examples

Create a record

val city = City(name = "The Shire", countryId = 554)
supabase.postgrest["cities"].insert(city, returning = Returning.MINIMAL) //returning defaults to Returning.REPRESENTATION

Bulk create

val theShire = City(name = "The Shire", countryId = 554)
val rohan = City(name = "Rohan", countryId = 554)
supabase.postgrest["cities"].insert(listOf(theShire, rohan), returning = Returning.MINIMAL) //returning defaults to Returning.REPRESENTATION

Fetch inserted record

val theShire = City(name = "The Shire", countryId = 554)
val rohan = City(name = "Rohan", countryId = 554)
val result = supabase.postgrest["cities"].insert(listOf(theShire, rohan)).decodeList<City>()