I’m not quite sure how to ask this question, but does anyone have advice on using :db.fn/call inside a transaction vs passing a conn around?
What kind of advice? My app used to pass conns around but I switched it to using transaction functions via db.fn/call
Thanks so much for responding. First question on my mind is Do you like it better?
I switched my most gnarly “transaction” from passing conns to using :db.fn/call and appreciated some of the ergonomics. But in the middle of the flow I have an async process where I do indeed need to start a new transaction when the async process finishes. So I ended up passing a conn through a callback, but it’s kinda getting in the way.
Sometimes the async process finishes before the original transaction also… 😅 Which is why I switched to using :`db.fn/call` I wanted to get it as close to the end of the transaction as possible.
Yeah I prefer the built-in fn/call op over passing the atom around generally, I haven't had any issues with running them in async flows since they're sync themselves
https://github.com/samcf/ogres/blob/main/src/main/ogres/app/events.cljs#L159-L182
Example of a transaction function in my app
Great, I think I was trying to test if this is an edge case for me or common, and to hear a first hand report. Thank you 🙏