@dom96 is right, it can be done like this:
macro withTran(db, body: untyped): untyped =
quote do:
block:
proc action(`db`: apgPoolConnection) {.async.} =
`body`
let fut = doTransaction(action)
yield fut
if fut.failed: raise fut.readError
The 'body' can be wrappered with an async proc!
