sqlx icon indicating copy to clipboard operation
sqlx copied to clipboard

query!( SELECT * ...) breaks when adding a new column at runtime

Open erikschul opened this issue 2 years ago • 0 comments

Bug Description

I would like to use `query! ("SELECT * FROM mytable") to avoid explicitly referencing each column.

But adding a new column at runtime will return Err(ColumnDecode { index: "3", source: UnexpectedNullError }) where index 3 is the new (nullable) column.

Is it possible for query! to just skip new/unexpected columns? I assume the names are already used in the Record struct, so it should be possible to use those same names when creating the struct?

Minimal Reproduction

Info

  • SQLx version: 0.7.3
  • SQLx features enabled: "runtime-tokio", "tls-rustls", "postgres"
  • Database server and version: postgres
  • Operating system: linux
  • rustc --version:

erikschul avatar Jan 10 '24 17:01 erikschul