sqlx
sqlx copied to clipboard
PgArguments::add returns a BoxDynError
Bug Description
The add function returns a BoxDynError which means all functions that return a sqlx::Error type will need to map_err to a type that does not make sense.
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(header.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