Closed
Description
Hello,
DDL
create type pair as (one int, two int);
create table test (id int primary key, pairs pair[]);
Rust structs
#[derive(sqlx::Type)]
#[sqlx(type_name = "pair")]
struct Pair {
one: i32,
two: i32,
}
#[derive(sqlx::Type)]
#[sqlx(type_name = "_pair")]
struct WrappedPairs(Vec<Pair>);
Query
sqlx::query!(
"INSERT INTO test VALUES($1, $2)",
0,
WrappedPairs(vec![Pair { one: 4, two: 20 }]) as _
)
.execute(pool)
.await?;
Perhaps I do it wrong, but this code gives me Protocol("execute: unexpected message: PortalSuspended")
.
Metadata
Metadata
Assignees
Labels
No labels