Turborepo setup with D1 and Drizzle

For Workers & Pages, what is the name of the domain?

What is the issue or error you’re encountering

Is it possible to have a D1 database as a separate Tuborepo’s package, set up with Drizzle, so that the other applications (api with Hono and web with Vite/React) could both use it? The reason I would like such setup is that I would like to keep zod schemas in that package too and import them in both apps. I wouldn’t need to import the db itself in the frontend. I know how to set such thing up with a URL, for something like Neon’s Postgres, but I am struggling to understand how to achieve what I want with D1. Is it even possible? How do I set this up and deploy on Cloudflare? Thank you

1 Like

There was never an answer to this? or did you manage to solve it? I was able to do what you need but in turkey, I’m too interested to do it with D1!