drizzle-team / drizzle-team/drizzle-orm
[BUG]: Drizzle should disconnect on process exit
- 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.29.2
### What version of `drizzle-kit` are you using?
0.20.9
### Describe the Bug
When running integration tests that connect to a docker-based db, it seems like the connection stays alive, thus making my tests hang forever. They all run and pass successfully, but then the process never ends. If I pass --forceExit to jest, it works properly, but this seems like a bandaid. I was able to do a more "correct" approach by "stopping" the test container that I am using (using `testcontainers`), but in Prisma, this step is not necessary.
Drizzle actually does something similar in its tests: https://github.com/drizzle-team/drizzle-orm/blob/main/integration-tests/tests/pg.test.ts
### Expected behavior
Upon shutdown signal being received, the drizzle client should be able to end its connection to any database that it may be connected to.
### Environment & setup
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.