Postgres Query finds wrong entry

override suspend fun findByPlan(plan_id: String): Product? {
        return try {
            val columns = Columns.list("*", "prices(*)", "plans(*)")
            val results = supabaseClient.from("products")
                .select(columns = columns) {
                    filter {
                        eq("plans.id", plan_id)
                    }
                }
                .decodeList<Product>()

            results.firstOrNull()
        } catch (e: Exception) {
            println("Error fetching product by plan_id ($plan_id): ${e.message}")
            e.printStackTrace()
            null
        }
    }


I basiclly search for plan id ultimate, or any other string which also could be invalid, and it still returns the pro product.
What is wrong with this code?
Was this page helpful?