Consider exposing a non-test version of this
This package can be useful outside of test contexts, and it would be nice to have a version available.
I wrote this adapter that stubs pgtestdb.TB and approximates what I'm talking about. Of course this isn't an ideal implementation. It's just what I can do with the pgtestdb's public interface. A better implementation might be to update pgtestdb.create() to return an error and cleanup func.
If you're interested in this, I'm happy to make a PR for it.
I forgot to mention my non-test use case. I use pgtestdb to create a clean db that I can use to generate docs from the schema.
Your pgtestdb.TB adapter is a nice hack! I'd prefer to keep this library focused on testing for now, but if you can explain the necessary API changes in more detail (or just send a draft PR?) I'm willing to consider it. This is a use case that's come up for me before, too, I just want to make sure however we enable it we keep the primary API optimized for the testing usecase.
I'll create a draft PR in the next week or so
@WillAbides any news here? Not urgent for me, but I am curious to know what you had in mind — even a sketch of the API would be helpful.
Closing for now since no action and I haven't needed the feature myself. Open to contributions here as described above, if there's interest we can re-open this issue or I can review a draft PR.
I haven't had the time for this, and my hacky adapter continues to work for my purposes. If either of those change, I'll come back here with a PR.
@WillAbides same situation here :) zero pressure, and thanks again for suggesting it.