Closed vemv closed 1 year ago
Adding an example for transactions is a good idea. In general, transactions work the same way as documented in next.jdbc. For example,
(jdbc/with-transaction [tx conn]
(query-fn tx :foo ...)
(query-fn tx :bar ...))
The conn
would come from your integrant component, and the would be assigned to tx
within the scope of the transaction. Then you'd pass tx
to the query functions.
It sure does!
Thank you.
Hi!
Even after reading the docs and misc related source code I don't have it clear how to use transactions. I am able to grab a
:db.sql/query-fn
and a:db.sql/connection
from my Integrant system, but I'm not sure of those would compose to something that looked like:(Well I did write something that appeared to make sense... but it may as well be considered a hack)
I'd appreciate a simple example with the specific namespaces/functions to be
require
d.Cheers - V