fix: add PostgreSQL array type support in pg_value_to_json
Handle _BOOL, _INT2, _INT4, _INT8, _FLOAT4, _FLOAT8, _TEXT, _VARCHAR, _CHAR, _BPCHAR, _NAME, _UUID, _JSON, _JSONB array types so they render as JSON arrays instead of "<unsupported type>". Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -58,6 +58,16 @@ pub fn pg_value_to_json(row: &PgRow, index: usize) -> Value {
|
||||
}
|
||||
}
|
||||
"VOID" => return Value::Null,
|
||||
// Array types (PG prefixes array type names with underscore)
|
||||
"_BOOL" => try_get!(Vec<bool>),
|
||||
"_INT2" => try_get!(Vec<i16>),
|
||||
"_INT4" => try_get!(Vec<i32>),
|
||||
"_INT8" => try_get!(Vec<i64>),
|
||||
"_FLOAT4" => try_get!(Vec<f32>),
|
||||
"_FLOAT8" => try_get!(Vec<f64>),
|
||||
"_TEXT" | "_VARCHAR" | "_CHAR" | "_BPCHAR" | "_NAME" => try_get!(Vec<String>),
|
||||
"_UUID" => try_get!(Vec<uuid::Uuid>),
|
||||
"_JSON" | "_JSONB" => try_get!(Vec<Value>),
|
||||
_ => {}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user