Well, short answer as usual “it is complicated”. Y...
# ktor
o
Well, short answer as usual “it is complicated”. You will need to make async channel out of db data set, then stream it through a serializer into a WriteChannel for a response. It’s all doable, see for example
AsyncFileReadChannel
in ktor, but you will have to deal with a lot of issues, e.g. inability to signal an error to client if database connection suddenly breaks in the middle because response code and headers were already sent.