[Web] Flush at the end of each writeLock #77
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The IndexedDB-based filesystem used by default for web flushes any changed pages in the background. This can cause data loss: Data that appears to be written (transaction returned successfully) have not actually been persisted to disk.
This now does an explicit
flush()
on the filesystem after every write transaction or statement. This can have significant performance overhead for some usage patterns, so this can be disabled on a per-transaction level.The
flush: false
option is a niche use-case, so only exposed on theWebSqliteConnection
abstract class, and not the more generalSqliteConnection
.See an example of using the
flush
option here: powersync-ja/powersync.dart#208