Hacker News new | past | comments | ask | show | jobs | submit login

You need to explicitly set the “busy_timeout” PRAGMA to allow concurrent write queries to block under WAL mode. Otherwise the query will return a BUSY error.

I wrote up some tips/caveats on the Litestream site with more explanation. https://litestream.io/tips/

Generally there’s just a few settings you want to set when developing with SQLite:

PRAGMA journal_mode = wal;

PRAGMA busy_timeout = 5000;

Also worth setting STRICT mode and setting SYNCHRONOUS to NORMAL but those are less important.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: