Remix.run Logo
chasil 4 days ago

There is enough going on with WAL mode that it really shouldn't be enabled unless all the limitations are understood.

In addition to the need for all clients to see shared memory, it disables acid transactions on attached databases (2nd to last paragraph below):

https://sqlite.org/lang_attach.html

bawolff 4 days ago | parent | next [-]

> In addition to the need for all clients to see shared memory, it disables acid transactions on attached databases

It only disables global cross-db transactions. It does not disable transactions in the attached db.

The fact that global transactions are a thing at all is the surprising bit to me. I think the WAL mode is the more expected behaviour.

boris 4 days ago | parent [-]

The main reason you would attach a database and then jump through hoops like qualifying tables is to have transactions cover all the attached databases. If you don't need that, then you can just open separate connections to each database without needing to jump through any hoops. So the fact that WAL does not provide that is a big drawback.

SoftTalker 4 days ago | parent | prev [-]

This is true for any database, for any concurrency or durability settings. You must understand the implications of the defaults and your choices if you change them.