Closed BrunoAddeo closed 5 years ago
I don't understand the question. Can you state what you're trying to do?
I just would like to write :
openDb('myBase', 4, upgradeDB => {
upgradeDB.createObjectStore('myTable', {keyPath: 'id'});
});
with the new version of IDB sorry for my poor english :-(
const db = await openDB('myBase', 4, {
upgrade(db, oldVersion, newVersion, transaction) {
db.createObjectStore('myTable', { keyPath: 'id' });
}
});
Does that work?
Yes, it's ok ! Thanks :-)
No problem!
Hi Jake,
In the "New 4.x way", openDB changes ... openDB('db-name', 1, { upgrade(db, oldVersion, newVersion, transaction) { console.log(oldVersion); console.log(transaction); }, }); ... so i'm not able to understand the syntax in order to use a transaction (something like "db.createObjectStore('myBase', {keyPath: 'id', autoIncrement: true})") in OpenDB
Is it possible to get an example ?