You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of today, it is documented here https://dexie.org/docs/Dexie/Dexie.getDatabaseNames() that it is impossible in Dexie 3 and 4 to listen for the creation/deletion of databases. I'd love to have an observable like:
let names = PlanotoFileDexie.getDatabaseNamesObs();
$: files = databaseNames.map(name => ({uuid: name,
file: liveQuery(() => new PlanotoFileDexie(name).fileInfo.get(0))}));
to be able to list all databases (I use them to store files basically).
The text was updated successfully, but these errors were encountered:
You can get an observable and all if you could change your model to let a file be represented by a row in a single db instead. (And you'd get better performance).
Yes, my main issue so far is that this creates a repetition: I want fileInfo to stay in the database as I will export/save/… and I want fileInfo to also be exported with the database. Also I don't want to duplicate fileInfo inside a separate database as it does not comply with DRY, leading to easy inconsistencies. Anyway, for now I don't plan to have such a huge number of files that it is a performance problem. For now, what I did is using a writable([]) populated by getDatabaseNamesObs that I update each time I create a new file. This seems to work well enough for now, but this will not update if a file is created in another tab for instance… but not too hard to fix I guess.
As of today, it is documented here https://dexie.org/docs/Dexie/Dexie.getDatabaseNames() that it is impossible in Dexie 3 and 4 to listen for the creation/deletion of databases. I'd love to have an observable like:
to be able to list all databases (I use them to store files basically).
The text was updated successfully, but these errors were encountered: