-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Labels
Description
Bug Description
after upgrading to 0.7.0
I'm getting this error when using https://docs.rs/sqlx/latest/sqlx/trait.Type.html#transparent
error[E0277]: the trait bound `Vec<i64>: PgHasArrayType` is not satisfied
--> src/lib.rs:1:10
|
1 | #[derive(sqlx::Type)]
| ^^^^^^^^^^ the trait `PgHasArrayType` is not implemented for `Vec<i64>`
|
= help: the trait `PgHasArrayType` is implemented for `Vec<u8>`
= help: see issue #48214
= note: this error originates in the derive macro `sqlx::Type` (in Nightly builds, run with -Z macro-backtrace for more info)
For more information about this error, try `rustc --explain E0277`.
error: could not compile `sqlx-test2` (lib) due to previous error
Minimal Reproduction
cargo init --lib sqlx-test
src/lib.rs
:
#[derive(sqlx::Type)]
#[sqlx(transparent)]
pub struct ScriptHashes(pub Vec<i64>);
Cargo.toml
:
[package]
name = "sqlx-test2"
version = "0.1.0"
edition = "2021"
[dependencies]
sqlx = { version = "0.7.0", features = [
"macros",
"postgres",
] }
then
cargo build
Info
- SQLx version: 0.7.0
- SQLx features enabled:
macros
andpostgres
- Database server and version: Postgres 14 or 15
- Operating system: linux
rustc --version
: rustc 1.70.0 (90c541806 2023-05-31)
additional info
- issue doesn't occur with version
0.6.3
- I think that this might be related PgHasArrayType for transparent types fix. #2086
HosMercury