Skip to content

initdb wasm node execution support #3

@pmp-p

Description

@pmp-p

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    hackSomething is probably not done right, ideas welcomedpatchpatch tested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions