Skip to content

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

Use "Encoding" instead of "Character set" for Postgre in the UI

天舟32084ca64e9e
diff --git a/frontend/src/components/ColumnTable.vue b/frontend/src/components/ColumnTable.vue
index e022183e5b..a7d38ae670 100644
--- a/frontend/src/components/ColumnTable.vue
+++ b/frontend/src/components/ColumnTable.vue
@@ -19,7 +19,7 @@
<BBTableCell class="w-8">
{{ column.nullable }}
</BBTableCell>
- <BBTableCell class="w-8">
+ <BBTableCell v-if="engine != 'POSTGRES'" class="w-8">
{{ column.characterSet }}
</BBTableCell>
<BBTableCell class="w-8">
@@ -35,9 +35,9 @@
<script lang="ts">
import { PropType } from "vue";
import { BBTableColumn } from "../bbkit/types";
-import { Column } from "../types";
+import { Column, EngineType } from "../types";
-const COLUMN_LIST: BBTableColumn[] = [
+const NORMAL_COLUMN_LIST: BBTableColumn[] = [
{
title: "Name",
},
@@ -61,6 +61,27 @@ const COLUMN_LIST: BBTableColumn[] = [
},
];
+const POSTGRES_COLUMN_LIST: BBTableColumn[] = [
+ {
+ title: "Name",
+ },
+ {
+ title: "Type",
+ },
+ {
+ title: "Default",
+ },
+ {
+ title: "Nullable",
+ },
+ {
+ title: "Collation",
+ },
+ {
+ title: "Comment",
+ },
+];
+
export default {
name: "ColumnTable",
components: {},
@@ -69,10 +90,15 @@ export default {
required: true,
type: Object as PropType<Column[]>,
},
+ engine: {
+ required: true,
+ type: String as PropType<EngineType>,
+ },
},
setup(props, ctx) {
return {
- COLUMN_LIST,
+ COLUMN_LIST:
+ props.engine == "POSTGRES" ? POSTGRES_COLUMN_LIST : NORMAL_COLUMN_LIST,
};
},
};
diff --git a/frontend/src/components/CreateDatabasePrepForm.vue b/frontend/src/components/CreateDatabasePrepForm.vue
index 6d7fedb314..6e3c2d0dfb 100644
--- a/frontend/src/components/CreateDatabasePrepForm.vue
+++ b/frontend/src/components/CreateDatabasePrepForm.vue
@@ -70,7 +70,11 @@
</div>
<div class="col-span-2 col-start-2 w-64">
- <label for="charset" class="textlabel"> Character set </label>
+ <label for="charset" class="textlabel">
+ {{
+ selectedInstance.engine == "POSTGRES" ? "Encoding" : "Character set"
+ }}</label
+ >
<input
id="charset"
name="charset"
@@ -88,9 +92,7 @@
name="collation"
type="text"
class="textfield mt-1 w-full"
- :placeholder="
- defaultCollation(selectedInstance.engine) || 'Charset default'
- "
+ :placeholder="defaultCollation(selectedInstance.engine) || 'default'"
v-model="state.collation"
/>
</div>
diff --git a/frontend/src/components/DatabaseOverviewPanel.vue b/frontend/src/components/DatabaseOverviewPanel.vue
index d3034fc69f..e838f10140 100644
--- a/frontend/src/components/DatabaseOverviewPanel.vue
+++ b/frontend/src/components/DatabaseOverviewPanel.vue
@@ -34,7 +34,13 @@
<!-- Description list -->
<dl class="grid grid-cols-1 gap-x-4 gap-y-4 sm:grid-cols-2 pt-4">
<div class="col-span-1 col-start-1">
- <dt class="text-sm font-medium text-control-light">Character set</dt>
+ <dt class="text-sm font-medium text-control-light">
+ {{
+ database.instance.engine == "POSTGRES"
+ ? "Encoding"
+ : "Character set"
+ }}
+ </dt>
<dd class="mt-1 text-sm text-main">
{{ database.characterSet }}
</dd>
diff --git a/frontend/src/views/TableDetail.vue b/frontend/src/views/TableDetail.vue
index 05eebb2c22..3f1886398f 100644
--- a/frontend/src/views/TableDetail.vue
+++ b/frontend/src/views/TableDetail.vue
@@ -143,7 +143,11 @@
<div class="col-span-1 col-start-1">
<dt class="text-sm font-medium text-control-light">
- Character set
+ {{
+ database.instance.engine == "POSTGRES"
+ ? "Encoding"
+ : "Character set"
+ }}
</dt>
<dd class="mt-1 text-sm text-main">
{{ database.characterSet }}
@@ -176,7 +180,10 @@
<div class="mt-6 px-6">
<div class="text-lg leading-6 font-medium text-main mb-4">Columns</div>
- <ColumnTable :columnList="table.columnList" />
+ <ColumnTable
+ :columnList="table.columnList"
+ :engine="database.instance.engine"
+ />
</div>
<div class="mt-6 px-6">