Merge pull request #97 from rarnu/fix/uuid-type-field

fix: 修复Postgres的UUID类型字段被显示为NULL的问题
This commit is contained in:
skyler 2026-05-05 22:56:57 +08:00 committed by GitHub
commit 4e5a7cb40a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 0 deletions

View File

@ -73,6 +73,7 @@ fn pg_value_to_json(row: &PgRow, idx: usize, type_name: &str) -> serde_json::Val
})
})
.or_else(|_| row.try_get::<bool, _>(idx).map(serde_json::Value::Bool))
.or_else(|_| row.try_get::<uuid::Uuid, _>(idx).map(|v| serde_json::Value::String(v.to_string())))
.or_else(|e| pg_temporal_to_json_value(row, idx).ok_or(e))
.unwrap_or(serde_json::Value::Null)
}