Is there a migration helper for JdbcSqliteDriver?
See original GitHub issueInitializing a Jdbc database with:
val driver: SqlDriver = JdbcSqliteDriver(JdbcSqliteDriver.IN_MEMORY)
Database.Schema.create(driver)
fails the second time with [SQLITE_ERROR] SQL error or missing database (table records already exists)
.
What is the correct way to handle this case? The Android driver has SupportSQLiteOpenHelper
, would it make sense to add similar functionality for JdbcSqliteDriver
? Maybe using user_version pragma or something else?
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Overview of Data Migration Assistant - SQL - Microsoft Learn
Learn how to use Data Migration Assistant to migrate SQL Server databases to other SQL Server or Azure databases.
Read more >Migrating Room databases | Android Developers
Learn to migrate databases safely using the Room Library. ... Create earliest version of the database. helper.createDatabase(TEST_DB, 1).apply { close() }
Read more >Gormigrate - Go Packages
Gormigrate is a minimalistic migration helper for Gorm. Gorm already has useful migrate functions, just misses proper schema versioning and ...
Read more >Migration Style Guide - GitLab Docs
Migration helpers and versioning. Introduced in GitLab 14.3. Various helper methods are available for many common patterns in database migrations. Those helpers ...
Read more >Understanding migrations with Room | by Florina Muntenescu
Database migrations under the hood. What SQLite API does. SQLite databases handle schema changes with the help of database versioning. More precisely, every ......
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
@martinbonnin got it, thanks for the link!
If anyone comes here, another exemple is https://github.com/JakeWharton/dodo/blob/69185c6d571129d1ffe637cdabe987a9ddbd8b5c/src/main/kotlin/com/jakewharton/dodo/db.kt#L13-L35
Also I was made aware that this doesn’t work super well in multi-process server scenario where multiple clients connect to the same database and it’s not really an option to take the database “offline” while doing the migration. This all makes sense and is another argument for making this out of scope for SQLDelight