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

PgArguments::add returns a BoxDynError #3563

Open
csandven opened this issue Oct 15, 2024 · 0 comments · May be fixed by #3564
Open

PgArguments::add returns a BoxDynError #3563

csandven opened this issue Oct 15, 2024 · 0 comments · May be fixed by #3564
Labels

Comments

@csandven
Copy link

csandven commented Oct 15, 2024

Bug Description

The add function returns a BoxDynError which means all functions that return a sqlx::Error type will manually need to map_err to the Encode error.

Minimal Reproduction

A small code snippet or a link to a Github repo or Gist, with instructions on reproducing the bug.

pub async fn store_data(
  connection: &mut PgConnection,
  content: MyData,
) -> Result<Metadata, sqlx::Error> {
  let mut arguments = PgArguments::default();
  arguments
    .add(i64::from(content.id))
    .map_err(sqlx::Error::Encode)?;

  // do query
}

Info

  • SQLx version: 0.8.2
  • SQLx features enabled: default
  • Database server and version: Postgres 13.5
  • Operating system: Ubuntu 22.04
  • rustc --version: 1.79.0
@csandven csandven added the bug label Oct 15, 2024
@csandven csandven linked a pull request Oct 15, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant