Description
Hey there, neat idea to make DB access async by using UNIX sockets and a separate process.
I was wondering about something in regard to this. I'm using the LazyDatabase
primitive, to minimize opening the database when nothing is actually queried.
In regard to SQLite, most of the times I'm using the WAL mode. But I find it a hassle to bother a user of the DatabaseInterface
to always issue the PRAGMA journal_mode=wal
query first, before querying anything else.
So is there any other way to enable the WAL mode? Is it perhaps possible to adapt the journal_mode
using any of the $flags
? (I could not find much information what flags are available.)
If that's not the case, I guess emitting an open
event when the connection was actually opened -- with the DatabaseInterface
instance as the event's first argument -- would really help.
In that case one could:
$db->on('open', function(DatabaseInterface $db) {
$db->exec('PRAGMA journal_mode=wal;'));
});