Closed ivanjeremic closed 3 years ago
There's https://developer.mozilla.org/en-US/docs/Web/API/IDBFactory/databases, but it isn't supported by Firefox (https://bugzilla.mozilla.org/show_bug.cgi?id=934640).
In the meantime, what you're doing it ok, assuming you need to dynamically add stores.
To add more collections to my database I need to get the current version of the database and then increment it + 1, I know I can open the db 2 times first to get the version, and the second time I open it to create the new document but this seems wrong to me and is also very slow, so how would I access the current version in
openDB(mydb, hereIneedTheVersion + 1)
I get the new and old version in the upgrade but this doesn't help me at all because it is inside theopenDB
and cannot be accessed one level above.This is how I currently do it and it seems wrong and slow