feat: Unify Debug implementations across PgRow, MySqlRow and SqliteRow (#3890)

* Introduce `debug_row` function

* Use `debug_row` to implement `Debug` for `SqliteRow`

* Use `debug_row` in `PgRow`'s `Debug` implementation

* Match `MySqlRow`'s `Debug` implementation
This commit is contained in:
David Cornu
2025-07-06 22:24:07 -04:00
committed by GitHub
parent 9f28837bca
commit 2702b9851a
4 changed files with 47 additions and 25 deletions

View File

@@ -5,7 +5,7 @@ use std::sync::Arc;
use sqlx_core::column::ColumnIndex;
use sqlx_core::error::Error;
use sqlx_core::ext::ustr::UStr;
use sqlx_core::row::Row;
use sqlx_core::row::{debug_row, Row};
use sqlx_core::HashMap;
use crate::statement::StatementHandle;
@@ -77,6 +77,12 @@ impl ColumnIndex<SqliteRow> for &'_ str {
}
}
impl std::fmt::Debug for SqliteRow {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
debug_row(self, f)
}
}
// #[cfg(feature = "any")]
// impl From<SqliteRow> for crate::any::AnyRow {
// #[inline]