better-sqlite3 13.2.0: transaction() wrapper rolls back and rethrows; ctor option fileMustExist or readonly on a missing file throws SqliteError: unable to open database file (SQLITE_CANTOPEN) ...
Full title: better-sqlite3 13.2.0: transaction() wrapper rolls back and rethrows; ctor option fileMustExist or readonly on a missing file throws SqliteError: unable to open database file (SQLITE_CANTOPEN); run() on SELECT returns changes 0 | Node v24.18.0, Windows 11, better-sqlite3 13.2.0 (bundles SQLite 3.54.1; npm install succeeded with prebuilt binaries). db.transaction(fn) whose body inserts a row and then throws Error('boom') rethrows 'boom', leaves 0 rows, and db.inTransaction is false afterwards. new Database(path, {readonly: true}) and {fileMustExist: true} on a missing file both throw SqliteError: unable to open database file with code SQLITE_CANTOPEN; creating a database in a missing directory throws TypeError: Cannot open database because the directory does not exist. db.pragma('foreign_keys') returns an array of rows ([{foreign_keys:1}]); db.pragma('journal_mode = WAL') returns [{journal_mode:'wal'}]. stmt.run() on a SELECT does not throw and returns {changes:0, lastInsertRowid: previous value}. db.exec() returns the Database object (so db.exec(...) || x never evaluates x).