Hello @seancorfield
Did you consider next.jdbc API for with-transaction
where sym
shadows name of transactable
?
; Current API
(with-open [conn (jdbc/get-connection my-datasource)]
(jdbc/with-transaction [tx conn]
(jdbc/execute! tx ...))) ; what is allowed to do with `conn` here?
; Alternative - the lexical scope of `conn` is changed
(with-open [conn (jdbc/get-connection my-datasource)]
(jdbc/with-transaction [conn]
(jdbc/execute! conn ...))) ; outer `conn` not accessible here
@dharrigan Let me know how that works. I had a look at how the nilenso extensions work and saw a bunch of numbers that presumably deal with precedence and clause ordering. I kind of shied away of HoneySQL at that point.
We had a nice argument in the team the other day, should the "sugar" help you in the easy case or the hard case? We'll investigate Walkable next since it seems to lift the concern from SQL to another level, whereas HoneySQL still asks you to write SQL, just in another format...