Hi, there is any way to create kotrin coroutine fl...
# exposed
i
Hi, there is any way to create kotrin coroutine flow from exposed query?
i
Hi @Bogdan, i know coroutines feature of exposed; But I meant how to create a flow using these features. I think I did it in this way:
Copy code
suspend fun Query.asFlowOnDb(
    database: Database,
    transactionIsolation: Int? = null
): Flow<ResultRow> {
    val q = this
    return channelFlow {
        val f = this
        newSuspendedTransaction (db = database,  transactionIsolation = transactionIsolation) {
            q.forEach { el -> f.send(el) }
        }
    }
}
@tapac Do u think there is another way to create flow with exposed or this method is ok?