While it's not explicitly mentioned in the docs, b...
# squarelibraries
l
While it's not explicitly mentioned in the docs, but is sqlite-android from Requery the preferred method to get a json1 compatible sqlite version in SQLDelight (on Android)? Looks like using:
dialect = "app.cash.sqldelight:sqlite-3-35-dialect:2.0.0-alpha02"
With:
implementation 'com.github.requery:sqlite-android:3.36.0'
and this is working quite well:
Copy code
val driver = AndroidSqliteDriver(
            schema = MyDatabase.Schema,
            context = this,
            name = "test.db", 
            factory = RequerySQLiteOpenHelperFactory()
        )
a
yes
👍 1
that will enable you to use the json stuff in
.sq
files
l
oh yeah, that works well!
Copy code
{
    ....
    implementation 'com.github.requery:sqlite-android:3.36.0'
    implementation 'app.cash.sqldelight:android-driver:2.0.0-alpha02'
    // implementation 'app.cash.sqldelight:sqlite-json-module:2.0.0-alpha02' // Doesn't seem to be needed?
}

sqldelight {
    MyDatabase {
        packageName = "com.example.hellojson"
        dialect = "app.cash.sqldelight:sqlite-3-35-dialect:2.0.0-alpha02"
    }
}
It seems like i dont need to explicitly include that json module (unless i'm including it in the wrong way)? Without it, i can still use json1 (
json_extract
) in the app when implemented as in the screenshot above 🤔
a
it gets you other stuff like
json_each
or exposing json function results in projections