pubkey / rxdb

A fast, local first, reactive Database for JavaScript Applications https://rxdb.info/
https://rxdb.info/
Apache License 2.0
21.27k stars 1.04k forks source link

How to clean close a DB? #6142

Closed NN-Binary closed 2 months ago

NN-Binary commented 3 months ago

When my program crash, I want to make sure all entries have been written, how do I "clean close" the Database and ensure all ongoing operations are done?

pubkey commented 3 months ago

This should be done automatically when you call .destroy() To be extra sure you can await myDatabase.requestIdlePromise() which awaits the 100% idleness of the database.

stale[bot] commented 2 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed soon. Please update it or it may be closed to keep our repository organized. The best way is to add some more information or make a pull request with a test case. Also you might get help in fixing it at the RxDB Community Chat If you know you will continue working on this, just write any message to the issue (like "ping") to remove the stale tag.