drizzle-team / drizzle-team/drizzle-orm

[BUG]: transaction hangs forever when using drizzle object inside it

Open
#1,687 3 comments 7 reactions 0 assignees View on GitHub
improvement qb/transactions
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?

0.19.13

### Describe the Bug

I don't know if this should be considered as a bug or not.

My coworker mistakenly used `db` object instead of transaction `tx`. The code executed but hangs forever.
```
await db.transaction(async (tx) => {
// process is hanging here
await db.select().from(categories);
});
```

### Expected behavior

While this should not be the case and he should use `tx` instead. he should at least get an error if possible.

### Environment & setup

Operating system: osx
package manager: pnpm
postgres version: 14.10

-- libraries
pg: 8.11.3
tsx: 3.13.0
typescript: 5.1.6

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.