-
Notifications
You must be signed in to change notification settings - Fork 18
Named areas/versions/upgrades #10
Comments
Ah, thank you; my extrapolation from https://github.com/jakearchibald/idb-keyval/blob/master/idb-keyval.js definitely doesn't work in this case. Would you mind dropping the code you would suggest (in JS, presumably) for the kind of API we're trying to create here? I.e. at what point should we create the store? Alternately I can look it up myself if you're busy. |
I think the easiest thing to do is use a single fixed store name so you never deal with upgrades, and use a compound key. i.e. instead the guts of const transaction = this.#connection.transaction("store", "readonly");
const store = transaction.objectStore("store");
const request = store.get([key,this.#storeName]); Where This means certain operations (e.g. |
Hmm, I'm not sure that sounds so easy :-/. Maybe instead we should use a single fixed store name, but a separate database per StorageArea? |
Yep, that'd work too. More overhead per area but that's an implementation's problem to optimize. |
The steps/code in 3.1 seem to misunderstand how versioning and schema works in Indexed DB.
upgradeneeded
only fires if the version changes. So:So store 'b' will never be created
The text was updated successfully, but these errors were encountered: