From ce8735da68c91cca3f22ef2f8d8409e5269b538c Mon Sep 17 00:00:00 2001 From: Jacob Quinn Date: Wed, 13 Mar 2024 14:36:31 -0600 Subject: [PATCH] Return the result of the transaction function being applied --- src/DBInterface.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/DBInterface.jl b/src/DBInterface.jl index 61bddf2..9ca8847 100644 --- a/src/DBInterface.jl +++ b/src/DBInterface.jl @@ -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)