-
Notifications
You must be signed in to change notification settings - Fork 202
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Documentation regarding Consistency #323
Comments
Good idea, we should document this better. For quick context, PGlite is Postgres in "single user mode". There is no support for concurrent connections and you are like to corrupt the database if you open it multiple times at once. The PGliteWorker helps you to open only a single instance and share it across browser tabs. |
Related question - is there any way to check if a target directory is currently in use by a PGlite instance? It would be awesome if the PGlite constructor threw (or the I think this validation would be reasonable in either the pglite/packages/pglite/src/pglite.ts Lines 345 to 346 in 5e39036
|
Hey @0xOlias Yep, we should absolutely do this. In the browser I think the best way is to implement it with WebLocks, for Node we should open and lock a file in the FS. |
Can you please add some documentation about how to maintain consistency in terms of running it from browser?
PGLite
easily access single storage (IndexedDB)?The text was updated successfully, but these errors were encountered: