3 ms·
I made https://github.com/boustrophedon/pgtemp https://github.com/boustrophedon/pgtemp to solve this for myself
by boustrophedon 2y ago
I made https://github.com/boustrophedon/pgtemp https://github.com/boustrophedon/pgtemp to solve this for myself
- convolvatron 2y agoi 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).
- switchbak 2y agoMy 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.