This is useful for unit tests that use the DB reference as a dependency injection on models.
By calling beginTransaction on setups and rollbacks on teardown, we can simulate an isolated sandbox environment for the database.
This would be similar to ecto where the death(?) of the process indicate the rollback. Since we can't rely on the many test runners to manage that, the easiest would be if one could call the functions manually and making sure that db is in a transaction during each test.
This is useful for unit tests that use the DB reference as a dependency injection on models. By calling beginTransaction on setups and rollbacks on teardown, we can simulate an isolated sandbox environment for the database.
This would be similar to ecto where the death(?) of the process indicate the rollback. Since we can't rely on the many test runners to manage that, the easiest would be if one could call the functions manually and making sure that
db
is in a transaction during each test.