Repository navigation
Can't store data between app launches #51
Replies: 1 comment 1 reply
|
Hi @gerchicov-vg, please refer to the sample apps to see how to set up a database. Your For example, in Reminders, we define a function for provisioning a migrated database: https://github.com/pointfreeco/sharing-grdb/blob/main/Examples/Reminders/Schema.swift#L89 And then in the entry point of the app we prepare the Once that is done |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Creating table works, inserting data works, migrating possibly works too but I don't understand how to persist these changes.
Tried examples from this repo -
CaseStudieswork only but it says to use SwiftUI previews. The problem is these previews are always reloading and it is unclear what causes this error.Tried to call
dumpSchemaordumpTables- they show that even tables are not stored between app launches too.My code sample:
DBAccounttable is created twice because I don't know where to place it and the app behaves like this table doesn't exist (and allows to create it). Tried to addifNotExistsparam - the result is the same.Maybe could you please provide a simple workable example where data is stored between app launches?
All reactions