Hello. Using sqldelight, our migrations have gotte...
# squarelibraries
k
Hello. Using sqldelight, our migrations have gotten so large to the point that the DatabaseImpl is failing because its reaching the limit of kotlin method sizes. Is there any way to get past this?
😮 1
h
How many migrations do you have? Do you need all? And maybe you could use db dependencies, but I don’t know how they work with migrations, never checked
k
It looks like sqldelight is generating a schema object that contains every single migration in a single method. Not very optimal.
b
We have almost 900 migration files and no problem though?
k
@Brendan Weinstein do any of your migrations have data migrations? What version are you currently using?
b
I have ~80 migrations
k
@Benoit Quenaudon do you have data migrations? What strategy are you following to have so many migrations without it blowing up? Schema in sq? Build schema from sqm? Using latest snapshot?
I ended up splitting migrations sources into 2 different folders. 1 being the destination where sqldelight generates the migrations from sqm files. The other being handrolled migrations. Then setting flyway to have both directories as migration sources. I then removed all data seeding from sqm migrations and move them across to the handrolled directory. After running a repair on flyway, everything works as expected and there is no more issue with the jvm function limit (because mass statements were removed)
b
To be honest I don't think we do anything specific.