Is there a way to return a `Flow` from a query?
# exposed
a
Is there a way to return a
Flow
from a query?
j
Copy code
flow {
    transaction {
    //...
    }
}
I mean you can wrap the query into something that returns a flow
A query itself is a one-time event that works fine with just using a suspend function
a
I think I phrased it wrong. What I meant is to emit new data whenever the database table gets updated.
j
That is indeed a very different thing 🙂 I do not think it comes out of the box
Perhaps you can check how it works on the database you are using, like postgresql has listen/notify
perhaps someone already made a library (quick google https://github.com/Benjozork/exposed-postgres-extensions ) to help with that
and then you can wrap the results in a flow or whatever
a
Yeah I thought there was a solution out of the box. Thank you for your help! 😃