I have a large database to migrate from an older version of sqldelight. It is part of a Kotlin Multiplatform app. I have done most of the leg work but it seems as if in the newer 2.0.2 version I have to add adapters by hand for every single table and column that has “AS Int”:
E.g
fun getDatabase(
driverFactory: DriverFactory,
dbName: String,
encryptionKey: String
): Database {
val driver = driverFactory.createDriver(dbName, encryptionKey)
return Database(
driver = driver,
FirstEntityAdapter = FirstEntity.Adapter(
aAdapter = IntColumnAdapter,
bAdapter = IntColumnAdapter,
cAdapter = IntColumnAdapter,
eAdapter = IntColumnAdapter,
fAdapter = IntColumnAdapter,
gAdapter = IntColumnAdapter,
hAdapter = IntColumnAdapter,
iAdapter = IntColumnAdapter,
jAdapter = IntColumnAdapter,
kAdapter = IntColumnAdapter,
lAdapter = IntColumnAdapter).... LOTS more adapters each with lots of IntColumnAdapters.
This will mean a LOT of boiler plate. I’m wondering if I’m missing something. This seams like something that could easily be generated along with the rest of the SQLDelight generated code?