Use exclusive for mutations and shared for read-only queries. This
shared/exclusive lock pattern allows multiple simultaneous readers but
only one writer. In Evolu, this pattern also ensures that every write can
be immediately read without waiting to complete. For example, we can add
data on one page and then immediately redirect to another, and the data
will be there.
There is also a last mode that ensures no other transaction can run.
It's for Db reset to ensure no data are accidentally saved after database
wipe-out.
Returns (<A, E, R>(effect: Effect<A, E, R>) => Effect<A, E, Sqlite | R>)
Use
exclusivefor mutations andsharedfor read-only queries. This shared/exclusive lock pattern allows multiple simultaneous readers but only one writer. In Evolu, this pattern also ensures that every write can be immediately read without waiting to complete. For example, we can add data on one page and then immediately redirect to another, and the data will be there.There is also a
lastmode that ensures no other transaction can run. It's for Db reset to ensure no data are accidentally saved after database wipe-out.