-
-
Notifications
You must be signed in to change notification settings - Fork 399
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Include worker threads utility within better-sqlite3 #914
Comments
I doubt such a utility will be integrated. Joshua's philosophy has always been that better-sqlite3 is a thin wrapper around SQLite's core functionalities. Anything else is out-of-scope for the package and would increase repository noise and maintenance cost. The proposed utility is also not really generic enough, nothing beats writing the actual worker code:
What I personally use is https://github.com/piscinajs/piscina . It abstracts away all the details (e.g. |
Great points. I'll make a PR to the docs to recommend that worker lib 👍 |
@Prinzhorn hit the nail on the head |
There are definitely some queries that I need to run that are quite slow and I cannot lock up my server for everyone while a user wants to run a slow query. So I'm looking at the worker threads option, but it seems like that's generic enough to be included as a utility within better-sqlite3. Something like this?
The main difference in what I'm suggesting from what's in the docs is that you'd pass the database file as the first parameter so the worker file could be made more generic. But I'm pretty sure that should work.
The text was updated successfully, but these errors were encountered: