-
-
Notifications
You must be signed in to change notification settings - Fork 675
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
upgrade my preloaded database for app update #23
Comments
Hello @gitton. I'm not sure I understand the scope of your question. Is it about GRDB, about SQLite, or about the architecture of your application? |
This is about GRDB. I am new to swift, from android background. In android there is library called android-sqlite-asset-helper (https://github.com/jgilfelt/android-sqlite-asset-helper) in that there is a concept called database upgrade version (https://github.com/jgilfelt/android-sqlite-asset-helper#database-upgrades) i am looking to do similar in GRDB. |
There are similar but but not identical concepts in GRDB. The similarities are about running upgrading code when needed, in order to upgrade the database to its latest scheme version. The differences are in the support for database assets: GRDB has none, or more specifically: it lets the resources/documents management to the application developer. So. If your application has a bundled database that may be modified by the user or later versions of your application, you need to know the difference between an application resource (immutable), and other mutable files. Check how to copy a database resource into the documents folder, and understand what this sentence means. Next, versioning. SQLite comes with the user_version pragma, which you can simply query with GRDB also comes with another versioning tool that has my personal preference over user_version, called migrations. Check them out, you may like it. OK now. I hope this first answer has some food for you! |
Hello @gitton. Did you find your way in this maze? |
OK. I'm closing this issue since it does not look like it is still relevant to you. Please open a new one if you have another question. |
Sorry for the late response .it Works |
Great! Happy GRDB! |
Looks like |
How can i upgrade my database (pragma user_version 1 to 2 ) with certain changes (like add new table or column) in my database and without changing any user changes made( eg : counter :- number of times an app was used) for my pre built database when updating an app (1.0 to 2.0).
The text was updated successfully, but these errors were encountered: