4 ms·
Is there a nodejs SQLite driver wrapper than does that hides the one writer concurrency issue for you without having to think about it? I never used SQLite on a
by anonzzzies 3y ago
Is there a nodejs SQLite driver wrapper than does that hides the one writer concurrency issue for you without having to think about it? I never used SQLite on a server because of it (many times on desktop and other clients), but I do have reasons to do so, especially with them being so easy to snapshot and move around.
- plugin-baby 3y agoMaybe https://www.npmjs.com/package/better-sqlite3 https://www.npmjs.com/package/better-sqlite3? Hide concurrency issues by blocking!?
- config_yml 3y agoSQLite serializes writes for you, there’s no need to think about it apart from handling SQLITE_BUSY
- bawolff 3y agoOne thing that really confused me with sqlite is how read transactions that are upgraded to write transactions half way through tend to fail very easiltly under high write load and cannot be automatically restarted by sqlite. It all makes sense in their concurrency model but it was surprising to me. The tl;dr is if you know you are going to write data in a transaction but the first operation is a read,use begin immddiate, so you dont have to worry about having to restart things manually.