How to get database/driver instance when using migrateWithCallbacks on Android?
See original GitHub issueSQLDelight version: 1.5.0 Application OS: Android
I’m trying to get the new migrateWithCallbacks
working, looks straight forward, however there seems to be a circular dependency when using it with AndroidSqliteDriver, unless I’m missing something
AndroidSqliteDriver(
context = context,
schema = AppDatabase.Schema,
name = "mydb",
callback = AndroidSqliteDriver.Callback(schema = schema, AfterVersion(3) {
// database or driver instance, to execute some sql?
})
It runs the migrateWithCallbacks when nonempty list of AfterVersion’s, which is Callback’s argument, which is AndroidSqliteDriver’s argument
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Migrating Room databases | Android Developers
Learn to migrate databases safely using the Room Library.
Read more >migrateWithCallbacks - SQLDelight - Cash App Code Blog
Run SqlDriver.Schema.migrate normally but execute callbacks during the migration whenever it finished upgrading to a version specified by AfterVersion.
Read more >How can I persist user data on updating/migrating a database?
How to achieve this using Android Room? The only workaround I found : Use fallbackToDestructiveMigration . Update asset .db file so that it ......
Read more >How to get database/driver instance when using ...
SQLDelight version: 1.5.0 Application OS: Android I'm trying to get the new migrateWithCallbacks working, looks straight forward, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
any news on this ?
fix for this is merged now - @AlecStrong may you close this one please?