Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support cargo pgx schema --skip-build #255

Merged
merged 15 commits into from
Dec 17, 2021
Merged

Conversation

Hoverbear
Copy link
Contributor

@Hoverbear Hoverbear commented Oct 18, 2021

This PR also refactors our nix stuff to support pg14 and handle the new SQL generation steps.

Here you can see a use where we have the schema generator run over the existing artifacts instead of do a fresh build:

ana@autonoma:~/pgx/pgx-examples/aggregate$ cargo pgx schema
    Building SQL generator with features `pg12`
"cargo" "build" "--bin" "sql-generator" "--features" "pg12" "--no-default-features"
   Compiling pgx-pg-sys v0.2.0-beta.1 (/home/ana/pgx/pgx-pg-sys)
   Compiling pgx-macros v0.2.0-beta.1 (/home/ana/pgx/pgx-macros)
   Compiling pgx v0.2.0-beta.1 (/home/ana/pgx/pgx)
   Compiling aggregate v0.0.0 (/home/ana/pgx/pgx-examples/aggregate)
    Finished dev [unoptimized + debuginfo] target(s) in 1m 21s
 Discovering SQL entities
  Discovered 6 SQL entities: 0 schemas (0 unique), 4 functions, 1 types, 0 enums, 1 sqls, 0 ords, 0 hashes
running SQL generator
"/home/ana/pgx/pgx-examples/aggregate/target/debug/sql-generator" "--sql" "sql/aggregate-1.0.sql"

ana@autonoma:~/pgx/pgx-examples/aggregate$ cargo pgx schema --skip-build
   Detecting custom `.cargo/pgx-linker-script.sh` file (having trouble? `cargo pgx schema --help` details settings needed)
   Detecting custom `.cargo/config` file (having trouble? `cargo pgx schema --help` details settings needed)
 Discovering SQL entities
  Discovered 6 SQL entities: 0 schemas (0 unique), 4 functions, 1 types, 0 enums, 1 sqls, 0 ords, 0 hashes
running SQL generator
"/home/ana/pgx/pgx-examples/aggregate/target/debug/sql-generator" "--sql" "sql/aggregate-1.0.sql"

ana@autonoma:~/pgx/pgx-examples/aggregate$ touch src/lib.rs 
ana@autonoma:~/pgx/pgx-examples/aggregate$ cargo pgx schema --skip-build
   Detecting custom `.cargo/pgx-linker-script.sh` file (having trouble? `cargo pgx schema --help` details settings needed)
   Detecting custom `.cargo/config` file (having trouble? `cargo pgx schema --help` details settings needed)
 Discovering SQL entities
  Discovered 6 SQL entities: 0 schemas (0 unique), 4 functions, 1 types, 0 enums, 1 sqls, 0 ords, 0 hashes
running SQL generator
"/home/ana/pgx/pgx-examples/aggregate/target/debug/sql-generator" "--sql" "sql/aggregate-1.0.sql"

@Hoverbear Hoverbear self-assigned this Oct 18, 2021
@Hoverbear Hoverbear changed the title feat: Suppore cargo pgx schema --ship-build feat: Support cargo pgx schema --ship-build Oct 18, 2021
Signed-off-by: Ana Hobden <[email protected]>
@Hoverbear Hoverbear changed the title feat: Support cargo pgx schema --ship-build feat: Support cargo pgx schema --skip-build Oct 19, 2021
@Hoverbear
Copy link
Contributor Author

@bbigras this should improve our Nix support a bit. :)

@Hoverbear Hoverbear merged commit 4bf5403 into develop Dec 17, 2021
@Hoverbear Hoverbear deleted the use-oxalica-rust branch December 17, 2021 19:45
];
checkInputs = [ cargo-pgx cargo rustc ];
doCheck = true;

postPatch = "patchShebangs .";
preConfigure = ''
Copy link
Contributor

@bbigras bbigras Dec 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could it init only for the selected versions? It can wait.

I tagged the wrong lines.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I was intending to try that here! I guess a future PR. 🤦‍♀️

@Hoverbear Hoverbear mentioned this pull request Feb 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants