Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version Control #68

Open
CrawfordW opened this issue May 14, 2022 · 2 comments
Open

Version Control #68

CrawfordW opened this issue May 14, 2022 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@CrawfordW
Copy link

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?

@samuk190
Copy link
Owner

samuk190 commented Jun 6, 2024

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 samuk190 added the help wanted Extra attention is needed label Jun 11, 2024
@sma27
Copy link

sma27 commented Jul 5, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants