Skip to content

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

chore: update null value display style in sql editor (#7375)

boojack66d3ac1c94aa
diff --git a/frontend/src/utils/v1/sql.ts b/frontend/src/utils/v1/sql.ts
index 9c1d18b0dd..49974738e2 100644
--- a/frontend/src/utils/v1/sql.ts
+++ b/frontend/src/utils/v1/sql.ts
@@ -1,6 +1,11 @@
+import { NullValue } from "@/types/proto/google/protobuf/struct";
import { RowValue } from "@/types/proto/v1/sql_service";
export const extractSQLRowValue = (value: RowValue) => {
+ if (value.nullValue === NullValue.NULL_VALUE) {
+ return null;
+ }
+
const plainObject = RowValue.toJSON(value) as Record<string, any>;
const keys = Object.keys(plainObject);
if (keys.length === 0) {
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 db2f8b0073..7bc961497e 100644
--- a/frontend/src/views/sql-editor/EditorCommon/ResultView/DataTable/TableCell.vue
+++ b/frontend/src/views/sql-editor/EditorCommon/ResultView/DataTable/TableCell.vue
@@ -72,6 +72,9 @@ const classes = computed(() => {
});
const html = computed(() => {
+ if (props.value === null) {
+ return `<span class="text-gray-400 italic">NULL</span>`;
+ }
const str = String(props.value);
if (str.length === 0) {
return `<br style="min-width: 1rem; display: inline-flex;" />`;