← Back to context

Comment by boustrophedon

12 days ago

I made https://github.com/boustrophedon/pgtemp to solve this for myself

i dont understand why everyone just doesn't do this unless they are working with really large volumes of test data. it literally takes a fraction of a second to mkdir, call pginit, and open a postgres socket.

idk if you've solved this, but PG doesn't like to bind to 0, so you have to manage ports. And I've had issues with processes sticking around if the test driver has crashed (I dont currently, but i'm turning off setsid in postgres).

  • My experience exactly - we use a JVM equivalent, and it's extremely fast to start up and reliable to use.

    Start it once across a bunch of suites, and have each suite manage its DB state. Done deal.