mirror of
https://github.com/chrisbenincasa/tunarr.git
synced 2026-04-18 09:03:35 -04:00
This is a large scale refactor to run all DB transaction code asynchronsouly. At it's core, better-sqlite3 is a synchronous DB library. Newer versions disallow transaction code that returns Promises completely. As such, we've been stuck on older code (and this is blocking other things, like NodeJS version bumps because of binary interface changes). Here we translate all kysely transaction code to Drizzle, because only the latter supports synchronous execution of queries. This includes a ton of DB migration code, since changing that completely to something Drizzle-first is a much larger undertaking that will be tackled in a follow-up. This change should unblock the following: 1. Bumping better-sqlite3 2. Bumping nodejs version bumps 3. Paves the way towards Drizzle-only migrations 4. Will allow us to switch over from sync => async results using Drizzle builders more easily in the future, should we decide to change the underlying sqlite driver.