Is trying to use `sqldelight` in ktor server a bad...
# ktor
u
Is trying to use
sqldelight
in ktor server a bad idea? I'm already familiar with it but I'm unsure about the schema creation, ddl etc, since sqldelight seems to be driven by the DDL - which from what I gather is not used in backend apps? (I'm a android developer, backend noob)
m
we are using sqldelight with postgres in the backend, IMHO it's not a bad idea at all
there's also jOOQ which is also based off sql afaik?
also, when using jdbc make sure all queries are on a separate thread pool from the call handlers
u
do you use flyway or does sqldelight create and mkgrate db?
m
we use sqldelight migrations, but in hindsight probably should try out flyway at some point
u
do you do hikari?
m
yup
u
anything else special I'd need to know? (im android dev just starting with ktor)
m
I think there's also an async postgres driver, but we haven't checked that out yet
u
are you on java 21+?
m
yup, I think currently on 21 LTS and switching to 24 soonish to move some of the io workload onto virt threads
u
aren virt threads on in 21 already?
m
24 has some improvements w.r.t pinning -
synchronized
stuff no longer pins the threads
btw, my background is really similar - I did a ton of Android stuff before starting this project
u
yea ktor is easy for me to pickup but the db i already know sqldelight, but I was told in "proper" backends, flyway managers db migration,and is run by a standalone jar before the server starts