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

listDatabases function not pulling existing databases from indexedDb #197

Open
kuhlaid opened this issue Apr 6, 2020 · 0 comments
Open

Comments

@kuhlaid
Copy link

kuhlaid commented Apr 6, 2020

Which version are you using?
2.3.7

Describe the bug
I am able to create a 'PERM' database with data using nSQL().createDatabase() and then am able to immediately lists the databases using nSQL().listDatabases(), HOWEVER if I reload my app and only try listing the databases again I get nothing even though the local databases still exist in my browser. I looked in the nano code within core/lib/index.js and noticed that nanoSQL.prototype.connect() is the only place that sets the 'this.dbs' object (which is used to list the databases in nSQL().listDatabases().

nSQL().listDatabases() needs to be able to list databases that exist. I am also not able to retrieve rows from existing databases if I do not 'recreate' the databases each time I reload my app, even though the data is there there from the last time I ran my app. Again, the core code needs the 'this.dbs' object to somehow create connects to the existing databases using something similar to what is created for each database in 'nanoSQL.prototype.connect()'.

Just from a brief review of your code I'm not sure how you would list existing indexedDb databases unless you are tracking the database keys/names in localStorage in order to call the indexedDb.open() function.

@kuhlaid kuhlaid changed the title listDatabases function not pulling existing databases listDatabases function not pulling existing databases from indexedDb Apr 6, 2020
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

1 participant