4 ms·
This is running pglite in a node subprocess. Why not just run Postgres itself as a subprocess with a data directory in a tempdir?
by laurencerowe 1y ago
This is running pglite in a node subprocess. Why not just run Postgres itself as a subprocess with a data directory in a tempdir?
- isoprophlex 1y agoExactly; in the past I've had reasonable success with test fixtures based on temp dirs and a templated docker compose file. Just needs docker in the environment, which is not too far fetched.
- wey-gu 1y agoI think the ultimate version in such use case would be carefully wire-up the baremetal one with ad-hoc in-mem-disk or tempdir :), this could be a future backend of py-pglite(planned in v2). For now, it's more accessible for me to hack it in hours and it works.
- laurencerowe 1y agoIt might be more interesting to try and get the wasm running directly within Python so you don't need a subprocess and all the coordination involved with that.