6 ms·
This explanation is extremely misleading. For many of my projects, vast majority of the operations do not use the database . And the few that does, contains lon
by SCLeo 2y ago
This explanation is extremely misleading. For many of my projects, vast majority of the operations do not use the database . And the few that does, contains long running huge joins/aggregates. Using the sync API is just straight up terrible because the task will block literally everything else that does not use the db in js, meaning generating a report in the background can literally prevent you from handling any requests. (I did end up using better sqlite 3 because they are personal projects and getting stuck for 2 seconds when the scheduled report generation happens is ok ish for the a few people using it. But I will not consider using better sqlite 3 for any future projects)
- tobyhinloopen 2y agoI suppose you want to run the longer, expensive queries in the background, EG a worker, or a separate process. Shouldn't be _that_ hard to setup. Maybe you can even create your own async wrapper that delegates any query to a separate process.