Skip to content

Conversation

rkistner
Copy link
Contributor

@rkistner rkistner commented Nov 4, 2024

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 the WebSqliteConnection abstract class, and not the more general SqliteConnection.

See an example of using the flush option here: powersync-ja/powersync.dart#208

@rkistner rkistner marked this pull request as ready for review November 5, 2024 12:25
stevensJourney
stevensJourney previously approved these changes Nov 5, 2024
 - sqlite_async@0.11.0
 - drift_sqlite_async@0.2.0-alpha.4
@rkistner rkistner merged commit 1e64f5d into main Nov 6, 2024
7 checks passed
@rkistner rkistner deleted the web-flush branch November 6, 2024 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants