pudo / dataset

Easy-to-use data handling for SQL data stores with support for implicit table creation, bulk loading, and transactions.
https://dataset.readthedocs.org/
MIT License
4.76k stars 297 forks source link

If the database is SQLite, enable WAL #346

Closed kapily closed 3 years ago

kapily commented 3 years ago

Since 2010, SQLite has supported WAL (Write Ahead Log) mode that supports multi-threaded writes. Without this mode enabled, SQLite throws errors when there are concurrent writes to a database and generally has poorer concurrent performance.

More background here: http://www.sqlite.org/wal.html

In this PR, I enabled WAL for non-in-memory SQLite databases.

See also: https://github.com/pudo/dataset/issues/239

DataGreed commented 3 years ago

@pudo could you please review it? It seems like a very useful feature

pudo commented 3 years ago

Sorry for the ultra-slow reaction. This looks well-engineered :)