I am using Dexie.js as a wrapper for my IndexedDB local database.
I have a list of tables that i am getting from my server, each table is also contains its own schema and then i am creating the IndexedDB tables according to this info.
I am trying to achieve the following behaivior:
- hold DB version in configurable file
- first time the browser opens, get all the tables info and create them with Dexie
- save all the data
- next time the application opens – check if the version changed, if it did – fetch the tables info again and upgdrade the db, if not – just open the DB.
so 1-3 works perfectly, my problem is:
if the version DID NOT change, i dont want to fecth the data again, but Dexie wont let me access any of the stores if im not passing them before open.
is there any way to solve it without saving the entire tables schemas in localStorage ?