pgcentralfoundation / pgrx

Build Postgres Extensions with Rust!
Other
3.66k stars 249 forks source link

Factor out "build" code from pgrx-pg-config #1451

Open workingjubilee opened 10 months ago

workingjubilee commented 10 months ago

pgrx-pg-config is better off being solely responsible for interacting with the pg_config binary, but it contains logic used in two other places, that doesn't really have anything to do with interacting with pg_config, like createdb (used in cargo-pgrx and pgrx-tests).

This has a few problems:

eeeebbbbrrrr commented 10 months ago

This code shared between cargo-pgrx and pgrx-tests needs

that seems like an incomplete thought, but...

I wonder if cargo-pgrx could benefit from a "createdb" command (probably "dropdb" too), then pgrx-tests could just shell out to PGPORT=xxxx PGDATA=xxxx cargo pgrx createdb ${test_db_name}.

I don't really see any particular harm in that since cargo-pgrx is a required build tool.