drizzle-team / drizzle-team/drizzle-orm
[BUG]: `Update` do not work on Cloudflare workers `waitUntil` normally
- Dominant language
- TypeScript
- Stars
- 35.8k
- Forks
- 1.6k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 4
Description
### What version of `drizzle-orm` are you using?
0.28.6
### What version of `drizzle-kit` are you using?
_No response_
### Describe the Bug
Code
```ts
ctx.ec.waitUntil(
ctx.db
.update(Users)
.set({
otp: null,
})
.where(eq(Users.id, user.id)),
)
```
The update will not run
But When I try
```ts
ctx.ec.waitUntil(
(async () => {
return await ctx.db
.update(Users)
.set({
otp: null,
})
.where(eq(Users.id, user.id))
})(),
)
```
or
```ts
ctx.ec.waitUntil(
ctx.db
.update(Users)
.set({
otp: null,
})
.where(eq(Users.id, user.id))
.execute(),
)
```
It works, but why? Can someone tell me what is the magic behind it?
### Expected behavior
I expected to use `update` as normal when combine with `waitUtil`
### Environment & setup
Cloudflare worker + neon serverless database
Contributor guide
Assessment
This issue has not been assessed yet.