add the ability to run initdb via Node ( which runtime is provided with emsdk compiler sdk)
Node does not normally allow for running subprocesses, but it fully support io redirections.
Since initdb simply uses popen() to call postgres binary and send it raw sql, the idea is to use stderr filehandle instead of the subprocess handle, gather the sql data in a log, and then filter it out before feeding it on postgres standard input
logs are now turned into comments eg
# initdb: warning: enabling "trust" authentication for local connections
# initdb: hint: You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb.
that can be parsed in captured sql file.
https://github.com/pmp-p/postgres-patchwork/pull/5.diff
add the ability to run initdb via Node ( which runtime is provided with emsdk compiler sdk)
Node does not normally allow for running subprocesses, but it fully support io redirections.
Since initdb simply uses popen() to call postgres binary and send it raw sql, the idea is to use stderr filehandle instead of the subprocess handle, gather the sql data in a log, and then filter it out before feeding it on postgres standard input
logs are now turned into comments eg
that can be parsed in captured sql file.
https://github.com/pmp-p/postgres-patchwork/pull/5.diff