Skip to content

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

feat: query result table rows count (#385)

STEVENff5277b3926a
diff --git a/frontend/src/locales/en.yml b/frontend/src/locales/en.yml
index 9eee4f023f..1071679efb 100644
--- a/frontend/src/locales/en.yml
+++ b/frontend/src/locales/en.yml
@@ -1055,6 +1055,7 @@ sql-editor:
You can select another statement and execute it individually.
goto-alter-schema-hint: Please select a database connection from the top of the editor
can-not-execute-query: Can not execute query when loading data.
+ rows: row | rows
label:
error:
key-necessary: Key is required
diff --git a/frontend/src/locales/zh-CN.yml b/frontend/src/locales/zh-CN.yml
index 234c2879af..6969610a87 100644
--- a/frontend/src/locales/zh-CN.yml
+++ b/frontend/src/locales/zh-CN.yml
@@ -921,6 +921,7 @@ sql-editor:
notify-multiple-statements: 检测到您输入了多条 SQL 语句。SQL 编辑器只支持执行第一条语句。您可以选择其他语句单独执行。
goto-alter-schema-hint: 请从编辑器顶部选择一个数据库连接
can-not-execute-query: 加载数据时无法执行查询
+ rows: 条记录
label:
error:
key-necessary: 需要指定 Key
diff --git a/frontend/src/views/SqlEditor/TablePanel/TableView.vue b/frontend/src/views/SqlEditor/TablePanel/TableView.vue
index fe629b463e..0a519b1dc5 100644
--- a/frontend/src/views/SqlEditor/TablePanel/TableView.vue
+++ b/frontend/src/views/SqlEditor/TablePanel/TableView.vue
@@ -5,18 +5,23 @@
>
<div
v-show="queryResult !== null"
- class="w-full flex justify-between items-center mb-2"
+ class="w-full flex flex-row justify-between items-center mb-2"
>
- <NInput
- v-model:value="state.search"
- class="max-w-xs"
- type="text"
- :placeholder="t('sql-editor.search-results')"
- >
- <template #prefix>
- <heroicons-outline:search class="h-5 w-5 text-gray-300" />
- </template>
- </NInput>
+ <div class="flex flex-row justify-start items-center mr-2">
+ <NInput
+ v-model:value="state.search"
+ class="max-w-xs"
+ type="text"
+ :placeholder="t('sql-editor.search-results')"
+ >
+ <template #prefix>
+ <heroicons-outline:search class="h-5 w-5 text-gray-300" />
+ </template>
+ </NInput>
+ <span class="ml-2 whitespace-nowrap text-sm text-gray-500">{{
+ `${data.length} ${t("sql-editor.rows", data.length)}`
+ }}</span>
+ </div>
<div class="flex justify-between items-center">
<NDropdown
trigger="hover"
@@ -109,13 +114,13 @@ const data = computed(() => {
return temp;
});
const notifyMessage = computed(() => {
- if (!queryResult.value) {
+ if (queryResult.value === null) {
return t("sql-editor.table-empty-placehoder");
}
if (isExecuting.value) {
return t("sql-editor.loading-data");
}
- if (data.value.length === 0) {
+ if (queryResult.value.length === 0) {
return t("sql-editor.no-rows-found");
}