mirror of
https://github.com/launchbadge/sqlx.git
synced 2026-03-19 08:39:44 +00:00
chore(postgres): include nullables query in error
This commit is contained in:
@@ -466,7 +466,13 @@ WHERE rngtypid = $1
|
||||
let mut nullables: Vec<Option<bool>> = nullable_query
|
||||
.build_query_scalar()
|
||||
.fetch_all(&mut *self)
|
||||
.await?;
|
||||
.await
|
||||
.map_err(|e| {
|
||||
err_protocol!(
|
||||
"error from nullables query: {e}; query: {:?}",
|
||||
nullable_query.sql()
|
||||
)
|
||||
})?;
|
||||
|
||||
// If the server is CockroachDB or Materialize, skip this step (#1248).
|
||||
if !self.stream.parameter_statuses.contains_key("crdb_version")
|
||||
|
||||
@@ -27,7 +27,7 @@ impl PgBufMutExt for Vec<u8> {
|
||||
let size_result = write_result.and_then(|_| {
|
||||
let size = self.len() - offset;
|
||||
i32::try_from(size)
|
||||
.map_err(|_| err_protocol!("message size out of range for Pg protocol: {size"))
|
||||
.map_err(|_| err_protocol!("message size out of range for protocol: {size}"))
|
||||
});
|
||||
|
||||
match size_result {
|
||||
|
||||
Reference in New Issue
Block a user