pgcentralfoundation / pgrx

Build Postgres Extensions with Rust!
Other
3.55k stars 238 forks source link

`cargo pgrx new --bgworker` needs to be tested in CI #1072

Open marcocitus opened 1 year ago

marcocitus commented 1 year ago

The --bgworker option seems useful, but it spits out quite outdated code.

$ cargo pgx new mybgw --bgworker
$ cd mybgw
$ cargo pgx run pg15
error[E0599]: no function or associated item named `execute` found for struct `pgx::Spi` in the current scope
  --> src/lib.rs:61:18
   |
61 |             Spi::execute(|client| {
   |                  ^^^^^^^ function or associated item not found in `pgx::Spi`

Probably https://github.com/tcdi/pgx/blob/master/cargo-pgx/src/templates/bgworker_lib_rs needs to be synced with https://github.com/tcdi/pgx/blob/master/pgx-examples/bgworker/src/lib.rs

eeeebbbbrrrr commented 1 year ago

Oh, thanks. We need to add cargo pgrx new --bgworker to CI as well.

workingjubilee commented 1 year ago

"fixed" again in https://github.com/pgcentralfoundation/pgrx/pull/1270 but needs a proper test still.