Closed jordanisaacs closed 1 year ago
Hey @jordanisaacs. This is pretty neat and it's cool to see you've worked around the problem effectively.
As far as I'm aware there isn't huge demand from the community for this, so for now I'll close this unless a significant number of others ask for it. The amount of overhead this adds is fairly hefty, as shown from the significant coverage drop, which would likely impact our ability to effectively maintain updates and versions releases confidently.
Thanks for the contribution and I'll be sure to point anyone asking at your fork to drive interest.
Would love to see this implemented!
hey, @jordanisaacs how can I use this fork in the meantime?
I tried cloning your branch and setting up
replace github.com/fergusstrange/embedded-postgres => ../embedded-postgres
in my go.mod, but I'm getting the same errors as before:
Received unexpected error:
unable to init database using '/home/x/.embedded-postgres-go/extracted/bin/initdb -A password -U root -D /home/x/.embedded-postgres-go/extracted/data --pwfile=/home/x/.embedded-postgres-go/extracted/pwfile': fork/exec /home/x/.embedded-postgres-go/extracted/bin/initdb: no such file or directory
On some systems (eg NixOS), libraries and the interpreter path need to be patched. Thus, add two config options to support this.
LD_LIBRARY_PATH
. TheinitDatabase
type now takes an extra parameterenv
.These by default are unset and do not change existing behavior. The tests have been updated to take in
POSTGRES_INTERPRETER
for setting the interpreter.I was able to successfully run the test suite on NixOS with these changes. To avoid changing the test suite further, I just used
LD_LIBRARY_PATH
as a global env variable. I am not sure the best way to test this otherwise as I cannot commit to keeping a Nix CI up to date.