Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to use both an in memory and indexDB at the same time? #553

Open
TheOtherBrian1 opened this issue Feb 26, 2025 · 1 comment

Comments

@TheOtherBrian1
Copy link

I defined two databases in the browser:

const cacheDb = new PGlite('idb://cache');

const db = new PGlite();

One was intended to be discardable for tests, while the other acted as a local cache.

They appear to overwrite each other. Only the second DB defined is accessible. Is it possible to have two different file systems?

@pmp-p
Copy link
Collaborator

pmp-p commented Feb 27, 2025

They would need to run on different threads because otherwise they share the same runtime memory hence the overwrite behaviour, try to run both in their own worker so they get different memories.

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

No branches or pull requests

2 participants