Drizzle error with React Query

Hello, I'm trying to get real time updates for my event log that im keeping in supabase. I had no issues accessing data trough Drizzle till i tried to make React query . I'm adding a code where i have simple supabase data fetch and drizzle (commented). when trying wtih drizzle one im getting the error with postgres picture bellow.
import { eventsBLC } from "~/schema/eventsBLC";
import { db } from "./drizzleClient";
import { users } from "~/schema/users";
import { desc, eq } from "drizzle-orm";
import { useQuery } from "@tanstack/react-query";
import { supabase } from "~/lib/supabaseClient";

// export const getBLCLogs = async () => {
//   const data = await db
//     .select()
//     .from(eventsBLC)
//     .limit(4)
//     .orderBy(desc(eventsBLC.created_at))
//     .leftJoin(users, eq(eventsBLC.userId, users.id));
//   return data;
// };
export const supabaseBLC = async () => {
  const { data: eventsBLC, error } = await supabase
    .from("eventsBLC")
    .select("*")
    .limit(4)
    .order("id", { ascending: false });
  return eventsBLC;
};

export function useGetBLCPosts() {
  return useQuery({
    queryFn: async () => supabaseBLC(),
    queryKey: ["logs"],
  });
}
image_2024-02-08_11-27-26.png
Was this page helpful?