website icon indicating copy to clipboard operation
website copied to clipboard

Is it possible to add "Using Drizzle on Cloudflare Workers" to website?

Open rxliuli opened this issue 8 months ago • 4 comments

There are some issues when using Prisma together with D1, such as

  1. Batch processing for D1 is not supported, and there are no transactions at all https://www.prisma.io/docs/orm/overview/databases/cloudflare-d1#transactions-not-supported
  2. Complex queries are not supported, such as multi-table Join SQL syntax https://github.com/prisma/prisma/discussions/12715
  3. Single queries are very slow, usually over 200ms, which is quite strange. I believe this is related to the longer initialization time caused by Prisma internally using WASM https://github.com/prisma/prisma/discussions/23646#discussioncomment-9059560

I previously used Prisma + D1 because of the documentation, but later had to migrate to Drizzle, so maybe when using D1 it should recommend Drizzle instead of Prisma?

rxliuli avatar Apr 28 '25 13:04 rxliuli

@rxliuli

Thank you for the issue. I think we should not recommend one specific library on our official website. But we can add a "Drizzle on Cloudflare" page on /examples/drizzle.

yusukebe avatar Apr 30 '25 09:04 yusukebe

so there's a better auth example that uses drizzle + neon already

just in case anyone stumbles on this issue also looking for Drizzle + D1 guidance, the HONC docs (and corresponding templates) provide some guidance on how to use Drizzle + D1 locally and in prod. it's kind of a non-trivial setup!

brettimus avatar Jul 16 '25 16:07 brettimus

Ah, there is no document for Drizzle on the examples page! I really want to have it.

yusukebe avatar Jul 16 '25 20:07 yusukebe

so there's a better auth example that uses drizzle + neon already

just in case anyone stumbles on this issue also looking for Drizzle + D1 guidance, the HONC docs (and corresponding templates) provide some guidance on how to use Drizzle + D1 locally and in prod. it's kind of a non-trivial setup!

Thanks a lot I was just looking for that! You saved my day!

chainyo avatar Jul 24 '25 14:07 chainyo