Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PG: PortalSuspended for array of composite types #1254

Closed
fominok opened this issue May 27, 2021 · 1 comment
Closed

PG: PortalSuspended for array of composite types #1254

fominok opened this issue May 27, 2021 · 1 comment

Comments

@fominok
Copy link

fominok commented May 27, 2021

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").

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants