db in the query options. However, this gets ran in the client so - pg can't be called there. What is the proper way to handle this in Tanstack Start with useQuery or queryClient perhaps? // some file
import { db } from "~/server/db";
export const MESSAGE_LIST_QUERY_KEY = ["messages"];
const sessionHistoryQueryOptions = () =>
queryOptions({
queryKey: MESSAGE_LIST_QUERY_KEY,
queryFn: () => getAllSessionHistory(db),
});
export default sessionHistoryQueryOptions;
// in another file
// does not work. pg can't be called in the client
const { data: messages } = useQuery(sessionHistoryQueryOptions());https://x.com/tan_stack/status/2031128535470104577?s=20
dry-scarlet · 4h ago
https://x.com/powersync_/status/2010721010006552775?s=20
dry-scarlet · 2mo ago
You can now submit your website/app/project to http://TanStack.com 's new showcase and have it seen by the TanStack community! - Global showcase browser - Per-library filters - Category filters Submit here: https://tanstack.com/showcase/submit View all here: https://tanstack.com/showcase
dry-scarlet · 3mo ago