Hi folks, need some help for creating D1 binding using Drizzle. I have this code. I want to get the

Hi folks, need some help for creating D1 binding using Drizzle. I have this code.

I want to get the DB dynamically based on the client who user ID. Is there a solution?

I have a solution which is to create a mapping like const mapping = { [tenantId1] : env.DB_TENANT_1 and so on, but is there something better?

Thanks
Capture-2024-06-29_at_11.09.18.png
Was this page helpful?