Open maor700 opened 3 years ago
I see the reason as populate event is lower level and run before on ready. Thanks. Might inactivate populate event when using dexie cloud (document not to use it) as populating data should be done using import script rather than client side. But it shouldn't fail like it's doing here.
So how do I initiate the db with content for the first time?
You can use npx dexie-cloud import to import data that needs to be in the db. Try npx dexie-cloud export
to examine the format.
Regarding per-user data we haven't figured out the final solution yet as we want to avoid the situation of having duplicated data to be populated in the situation when a session starts off unauthorized and later on logs in to existing account. There will be a solution for it, it's just not decided yet the exact api but there might be some kind of data templates for per-user singletons with dedicated ids that are same for every user but represents different objects per user.
Here the code:
The code causes an error. Same code only with the event "ready" works well.
Error: DatabaseClosedError: DataError Failed to execute 'add' on 'IDBObjectStore': Evaluating the object store's key path did not yield a value. DataError: Failed to execute 'add' on 'IDBObjectStore': Evaluating the object store's key path did not yield a value.