`AndroidSqliteDriver.Callback` class is final
See original GitHub issueSQLDelight Version
2.0.0-alpha04
Operating System
MacOS 12.6
Gradle Version
7.5
Kotlin Version
1.7.20
Dialect
app.cash.sqldelight:sqlite-3-18-dialect
AGP Version
7.3.0
Describe the Bug
Hello
On the version 2.0.0-alpha04 the class AndroidSqliteDriver.Callback
is marked as final which make impossible to override the onCreate
, onUpgrade
, onConfigure
, onOpen
, etc…
For instance, this code doesn’t compile:
AndroidSqliteDriver(
schema = Database.Schema,
context = context,
name = "my_db.db",
callback = object : AndroidSqliteDriver.Callback(Database.Schema) {
override fun onOpen(db: SupportSQLiteDatabase) {
db.execSQL("PRAGMA foreign_keys=ON;")
}
}
)
Regards
Stacktrace
No response
Gradle Build Script
plugins {
id 'com.android.library'
id 'org.jetbrains.kotlin.android'
id 'org.jetbrains.kotlin.kapt'
id 'app.cash.sqldelight'
}
dependencies {
api "app.cash.sqldelight:android-driver:$sqlDelightVersion"
api "app.cash.sqldelight:coroutines-extensions-jvm:$sqlDelightVersion"
api "app.cash.sqldelight:primitive-adapters:$sqlDelightVersion"
}
sqldelight {
Database {
packageName = "com.masselis.tpmsadvanced.data.car"
verifyMigrations = true
schemaOutputDirectory = file("src/main/sqldelight")
dialect("app.cash.sqldelight:sqlite-3-18-dialect:$sqlDelightVersion")
}
}
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Migrations - SQLDelight - Cash App Code Blog
After the callback it will resume at 4.sqm and complete the remaining migrations, in this case 4.sqm and 5.sqm, meaning the final database...
Read more >java - Firebase Callback Interface needs to be declared final?
In your code you receive getFullNameCallback as parameter in ... class ValueEventListener , so, getFullNameCallback must be final in order ...
Read more >Create a multiplatform app using Ktor and SQLDelight – tutorial
You can find this state of the project on the final branch. ... On Android, the AndroidSqliteDriver class implements the SQLite driver.
Read more >SupportSQLiteOpenHelper.Callback - Android Developers
Fields. public final int, version. Version number of the database (starting at 1); if the database is older, onUpgrade(SupportSQLiteDatabase ...
Read more >Understanding Callback Methods with Examples - OneSpan
While the concept is known as Callbacks in the Java community, ... public class Worker { ActionListenerCallback callBack; public Worker() ...
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
Facing the same issue in
2.0.0-alpha04
because I want to implementonConfigure
to enable foreign keys likeThe solution above with a delegate works but this was much less boiler plate code in version 1.5 of SQLDelight.
Thanks, I didn’t thought that I could just do that, I’ve applied this fix on my code until the next release 😃