Currently, the dbfixture.New function only accepts a pointer to bun.DB. However, both bun.DB and bun.TX implement the IDB interface. By allowing dbfixture.New to accept the IDB interface, it would provide more flexibility, especially during testing.
Motivation
By allowing dbfixture.New to accept IDB, we can easily roll back transactions during testing. This would eliminate the need to manually delete test data after the tests have run, ensuring a clean database state and more efficient testing.
Expected Usage
Here's how it could be utilized with the suggest change:
Description
Currently, the dbfixture.New function only accepts a pointer to bun.DB. However, both bun.DB and bun.TX implement the IDB interface. By allowing dbfixture.New to accept the IDB interface, it would provide more flexibility, especially during testing.
Motivation
By allowing dbfixture.New to accept IDB, we can easily roll back transactions during testing. This would eliminate the need to manually delete test data after the tests have run, ensuring a clean database state and more efficient testing.
Expected Usage Here's how it could be utilized with the suggest change:
By making this change, we can leverage the power of transactions during testing, ensuring that our tests are both efficient and clean.