Colton Idle
10/03/2024, 12:50 AMio.github.jan.supabase.exceptions.BadRequestRestException: null value in column "type" of relation "config" violates not-null constraint
supabase.from("config").insert(Config())
is the failing code
data class has a hardcoded type field
@Serializable
data class Config(
val type: String = "abc"
)
but if I keep everything else the same, but change the invocation to have an explicit type
supabase.from("config").insert(Config("xyz"))
then it works.
Seems like supabase-kt doesn't pick up the default value of a data class?Jan
10/03/2024, 10:07 AMJson
instance:
val supabase = createSupabaseClient(url, key) {
defaultSerializer = KotlinXSerializer(Json { encodeDefaults = true })
}
Jan
10/03/2024, 10:08 AMColton Idle
10/03/2024, 12:31 PM