I was actually thinking of achieving something like the example given below. So I came up with this particular API. 

```clojure
(tx/with-transaction
  true
  transaction
  (let [[_ result] (tx/execute transaction [(tx/statement "CREATE n RETURN ID(n)")])
        new-id (-> result 
               :data
               first
               row
               first)]
    (if (< new-id 10)
      ((tx/execute transaction [(tx/statement ....)])
       (tx/commit transaction))
      (tx/rollback transaction))))
```
Another option I could think of was to create partial functions for execute, commit, rollback in the let which already have transaction bound to them as a first argument.

Maybe there is a better way to look at this issue. I wasn't sure.