最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

postgresql - Kotlin Supabase Update Query Always Returns Empty List Despite Working SQL Query - Stack Overflow

programmeradmin1浏览0评论

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
发布评论

评论列表(0)

  1. 暂无评论