drizzle-team / drizzle-team/drizzle-orm
[BUG]: PGLiteWorker does not work
- 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.33.0
### What version of `drizzle-kit` are you using?
None
### Describe the Bug
Cannot instantiate a drizzle pglite based instance with PGLiteWorker. This seems to be due to a structured cloning error.
This is caused by trying to send the functions over the broadcast channel here https://github.com/drizzle-team/drizzle-orm/blob/c8359a16fff4b05aff09445edd63fc65a7430ce9/drizzle-orm/src/pglite/session.ts#L34-L51.
Once I removed those functions it works fine.
If there's interest in fixing this I'd be happy to submit a quick PR for either just removing those lines or having a separate implementation for the worker type.
### Expected behavior
PGLiteWorker (multi tab instance) should work as well as the in memory PGLiteWorker (
### Environment & setup
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.