Skip to content

Commit

Permalink
Return the result of the transaction function being applied
Browse files Browse the repository at this point in the history
  • Loading branch information
quinnj committed Mar 13, 2024
1 parent 4e33f5b commit ce8735d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/DBInterface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,9 @@ performance in database systems.
function transaction(f, conn::Connection)
execute(conn, "BEGIN TRANSACTION;")
try
f()
ret = f()
execute(conn, "COMMIT;")
return ret
catch e
execute(conn, "ROLLBACK;")
rethrow(e)
Expand Down

0 comments on commit ce8735d

Please sign in to comment.