-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Labels
Description
I have found these related issues/pull requests
Description
When having a query that returns an array with nullable values, it is assumed, that the entire array contents are non-nullable.
Reproduction steps
Code:
let v = sqlx::query!(r#"Select ARRAY[null, false, true] as "test!""#)
.fetch_one(get_mysql().await).await.expect("test");
let test:Vec<Option<bool>> = v.test;Error message:
error[E0308]: mismatched types
--> app/src/main.rs:56:34
|
56 | let test:Vec<Option<bool>> = v.test;
| ----------------- ^^^^^^ expected `Vec<Option<bool>>`, found `Vec<bool>`
| |
| expected due to this
|
= note: expected struct `Vec<std::option::Option<bool>>`
found struct `Vec<bool>`
SQLx version
0.8.3
Enabled SQLx features
["postgres", "runtime-tokio-rustls"]
Database server and version
postgres (PostgreSQL) 16.6
Operating system
Linux nixos-pc 6.12.16 #1-NixOS SMP PREEMPT_DYNAMIC Fri Feb 21 13:01:47 UTC 2025 x86_64 GNU/Linux
Rust version
rustc 1.85.0 (4d91de4e4 2025-02-17)