TanStack Start + Query + db access example
Does anyone have a simple CRUD example app that uses Start and Query with db access? I'm porting a side project from NextJS which uses these + Drizzle and trying to find a tidy way to structure my query functions => server functions => Drizzle functions for best readability and reusability
3 Replies
eastern-cyan•9mo ago
I can't share the repository I'm working on but are you more interested in the architecture or the setup (e.g. how things are wired up)?
rival-blackOP•9mo ago
I'm trying to get things cleanly organised to avoid any accidental direct calling of server code from client code (mostly due to copying across NextJS server actions into the app). What I've come up with for now is -
eastern-cyan•9mo ago
I have the exact same structure; the only difference is that I use
ensureQueryData
in the loader instead of prefetchQuery