Fork me on GitHub
#sql
<
2022-04-01
>
Casey13:04:38

I found https://clojurians-log.clojureverse.org/sql/2020-06-04 about nested transactions in next.jdbc. My use case is the same, I don't want nested transactions in prod, but I wanted to use an outer transaction in tests to rollback changes during a test. The code under test opens a transaction. Is there any movement on this since then? Or had anyone come up with an alternative solution for running tests against the database that don't dirty the database afterwards?

orestis18:04:40

The problem with nested transactions, so far that I understand it, is that e.g. Postgres doesn't allow them. So if your code uses transactions meaningfully then this testing strategy doesn't really work.

Cora (she/her)21:04:42

they do have savepoints though

1