drizzle-orm icon indicating copy to clipboard operation
drizzle-orm copied to clipboard

Change Durable Object SQLite migrate function to be sync

Open ttmx opened this issue 5 months ago • 0 comments

Change DO SQLite migrate function to be in line with other existing sync SQL adapters

This change was motivated by noticing that the setup in Durable Objects was more complicated than required as seen in the docs.

Since migrate is currently async, it seems to require the usage of ctx.blockConcurrencyWhile in the setup step of the object, which introduces more things the user has to understand before using the drizzle with Durable Objects. (In reality, I believe no microtasks are actually ever scheduled since no await is encountered inside migrate, so you wouldn't need to use ctx.blockConcurrencyWhile to guarentee the setup working, but the function being async makes it seem like you do)

I also intend to make a PR on the docs to simplify the setup for new users of Drizzle + Cloudflare Durable Objects.

ttmx avatar Nov 05 '25 17:11 ttmx