localbase icon indicating copy to clipboard operation
localbase copied to clipboard

Version Control

Open CrawfordW opened this issue 3 years ago • 2 comments

Great work Danny! Makes using indexedDB very easy. But what about version control? Can you suggest a way to recognize that the DB version is not what the app version needs and make the necessary updates to the DB?

CrawfordW avatar May 14 '22 14:05 CrawfordW

Hi! I'm maintaining this project as Danny is a bit busy, I think its very possible to do that


var open = indexedDB.open("MyDatabase", 1);

console.log(value);

// Create the schema
open.onupgradeneeded = function(e) {
    console.log("Old Version: " + e.target.result.oldversion); //Undefined
    console.log("New Version: " + e.target.result.newversion); //Undefined
    var db = open.result;
    var store = db.createObjectStore("Inspections", {keyPath: "id", autoIncrement: true});
    var index = store.createIndex(key, key);
};

we could implement something like this, and return to localBase, something like

localBase.getVersion ?

samuk190 avatar Jun 06 '24 08:06 samuk190

Just started using localbase. Thanks for the great project!

I was also looking for how to do this with localbase (version the DB). Any timeline?

sma27 avatar Jul 05 '24 04:07 sma27