I am trying to update a row in my Supabase database using Kotlin. However, the update
operation always returns an empty list, and the update does not reflect in the database. I have verified that the SQL query with the same filter works perfectly in the Supabase query editor.
Here's the relevant code snippet:
val apijson = supabase.from("Table_User_Scans").update({
set("ApiJsonOutput", jsonString)
}) {
select()
filter {
and {
eq("user_id", userId)
eq("ScanTimeStamp", LatestScanDate)
}
}
}.decodeSingle<UserScans>()
UserScans Data Class:
package com.indiedev91.looksmaxeai_bebetterversion.Utils
import kotlinx.serialization.Serializable
@Serializable
data class UserScans(
val user_id: String,
val UserName: String,
val ScanTimeStamp: String,
val FrontFaceImageUrl: String,
val SideFaceImageUrl: String,
val ApiJsonOutput: String?
)
Database Schema:
Name | Description | Data Type | Format |
---|---|---|---|
user_id | No description | uuid | uuid |
UserName | No description | character varying | varchar |
ScanTimeStamp | No description | timestamp without time zone | timestamp |
FrontFaceImageUrl | No description | character varying | varchar |
SideFaceImageUrl | No description | character varying | varchar |
ApiJsonOutput | No description | character varying | varchar |