Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: fix binary display issue (#16782)

Vincent Huangefdea1f595df
diff --git a/backend/plugin/db/pg/query.go b/backend/plugin/db/pg/query.go
index f5fb2d1b5f..784ae6489d 100644
--- a/backend/plugin/db/pg/query.go
+++ b/backend/plugin/db/pg/query.go
@@ -35,7 +35,7 @@ func makeValueByTypeName(typeName string, _ *sql.ColumnType) any {
return new(pgtype.Date)
case "TIMESTAMP", "TIMESTAMPTZ":
return new(pgtype.Timestamptz)
- case "BIT", "VARBIT":
+ case "BIT", "VARBIT", "BYTEA":
return new([]byte)
default:
return new(sql.NullString)
diff --git a/frontend/src/views/sql-editor/EditorCommon/ResultView/DataTable/TableCell.vue b/frontend/src/views/sql-editor/EditorCommon/ResultView/DataTable/TableCell.vue
index 7d2595d4b5..a47657945a 100644
--- a/frontend/src/views/sql-editor/EditorCommon/ResultView/DataTable/TableCell.vue
+++ b/frontend/src/views/sql-editor/EditorCommon/ResultView/DataTable/TableCell.vue
@@ -199,20 +199,28 @@ const formattedValue = computed(() => {
}
// Determine the format to use - column override, cell override, or auto-detected format
- const actualFormat = binaryFormat.value ?? "DEFAULT";
+ let actualFormat = binaryFormat.value ?? "DEFAULT";
- // Skip formatting for DEFAULT (auto) format
+ // If format is DEFAULT, use the auto-detected format
if (actualFormat === "DEFAULT") {
- return props.value;
+ actualFormat = detectBinaryFormat({
+ bytesValue,
+ columnType: props.columnType,
+ });
}
const stringValue = formatBinaryValue({
bytesValue,
format: actualFormat,
});
+
+ // Return proto-es oneof structure with stringValue
return {
...props.value,
- stringValue,
+ kind: {
+ case: "stringValue" as const,
+ value: stringValue,
+ },
};
});