pgtestdb icon indicating copy to clipboard operation
pgtestdb copied to clipboard

Consider exposing a non-test version of this

Open WillAbides opened this issue 10 months ago • 3 comments

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.

WillAbides avatar Jan 31 '25 18:01 WillAbides

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.

WillAbides avatar Jan 31 '25 18:01 WillAbides

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.

peterldowns avatar May 06 '25 16:05 peterldowns

I'll create a draft PR in the next week or so

WillAbides avatar May 15 '25 15:05 WillAbides

@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.

peterldowns avatar Jul 14 '25 17:07 peterldowns

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.

peterldowns avatar Nov 03 '25 15:11 peterldowns

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 avatar Nov 05 '25 14:11 WillAbides

@WillAbides same situation here :) zero pressure, and thanks again for suggesting it.

peterldowns avatar Nov 05 '25 16:11 peterldowns