Skip to content

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

chore: add statement size warning to plan check section (#17424)

boojack09f52facf490
diff --git a/frontend/src/components/Plan/components/Configuration/Configuration.vue b/frontend/src/components/Plan/components/Configuration/Configuration.vue
index fdf7b6ae71..8207e7543d 100644
--- a/frontend/src/components/Plan/components/Configuration/Configuration.vue
+++ b/frontend/src/components/Plan/components/Configuration/Configuration.vue
@@ -1,5 +1,5 @@
<template>
- <div v-if="shouldShow" class="flex flex-col gap-2">
+ <div v-if="shouldShow" class="w-full flex flex-col gap-2">
<p class="text-base">
{{ $t("plan.options.self") }}
</p>
diff --git a/frontend/src/components/Plan/components/PlanCheckSection/PlanCheckSection.vue b/frontend/src/components/Plan/components/PlanCheckSection/PlanCheckSection.vue
index d93146f12d..7e3647bc7a 100644
--- a/frontend/src/components/Plan/components/PlanCheckSection/PlanCheckSection.vue
+++ b/frontend/src/components/Plan/components/PlanCheckSection/PlanCheckSection.vue
@@ -22,6 +22,18 @@
</template>
{{ $t("task.check-type.affected-rows.description") }}
</NTooltip>
+
+ <NTooltip v-if="isStatementOversized">
+ <template #trigger>
+ <NTag type="warning" round>
+ <template #icon>
+ <CircleQuestionMarkIcon class="size-4" />
+ </template>
+ {{ $t("common.skipped") }}
+ </NTag>
+ </template>
+ {{ $t("issue.sql-check.statement-is-too-large") }}
+ </NTooltip>
</div>
<div class="flex items-center gap-2">
@@ -60,6 +72,7 @@ import type { ConnectError } from "@connectrpc/connect";
import { PlayIcon, CircleQuestionMarkIcon } from "lucide-vue-next";
import { NButton, NTooltip, NTag } from "naive-ui";
import { computed, ref, watch } from "vue";
+import { STATEMENT_SKIP_CHECK_THRESHOLD } from "@/components/SQLCheck/common";
import { planServiceClientConnect } from "@/grpcweb";
import {
useCurrentUserV1,
@@ -82,6 +95,7 @@ import { useResourcePoller } from "../../logic/poller";
import ChecksDrawer from "../ChecksView/ChecksDrawer.vue";
import PlanCheckStatusCount from "../PlanCheckStatusCount.vue";
import { useSelectedSpec } from "../SpecDetailView/context";
+import { useSpecSheet } from "../StatementSection/useSpecSheet";
const currentUser = useCurrentUserV1();
const { project } = useCurrentProjectV1();
@@ -89,6 +103,7 @@ const { plan, planCheckRuns } = usePlanContext();
const selectedSpec = useSelectedSpec();
const { refreshResources } = useResourcePoller();
const { statusCountString } = usePlanCheckStatus(plan);
+const { sheet } = useSpecSheet(selectedSpec);
const isRunningChecks = ref(false);
const showChecksDrawer = ref(false);
@@ -131,6 +146,11 @@ const affectedRows = computed(() => {
}, 0n);
});
+const isStatementOversized = computed(() => {
+ if (!sheet.value) return false;
+ return sheet.value.contentSize > STATEMENT_SKIP_CHECK_THRESHOLD;
+});
+
const runChecks = async () => {
if (!plan.value.name || !selectedSpec.value) return;
diff --git a/frontend/src/components/Plan/components/SpecDetailView/SpecDetailView.vue b/frontend/src/components/Plan/components/SpecDetailView/SpecDetailView.vue
index dc19cccd4e..b2e54d6bb3 100644
--- a/frontend/src/components/Plan/components/SpecDetailView/SpecDetailView.vue
+++ b/frontend/src/components/Plan/components/SpecDetailView/SpecDetailView.vue
@@ -10,7 +10,7 @@
<SQLCheckV1Section v-if="isCreating" />
<PlanCheckSection v-else />
</template>
- <div class="w-full flex-1 space-y-3 pt-3 overflow-x-auto flex flex-col">
+ <div class="w-full flex-1 space-y-3 pt-3 flex flex-col">
<StatementSection />
<Configuration />
</div>
diff --git a/frontend/src/components/Plan/components/StatementSection/EditorView/EditorView.vue b/frontend/src/components/Plan/components/StatementSection/EditorView/EditorView.vue
index f02e8205f7..be5f103a8b 100644
--- a/frontend/src/components/Plan/components/StatementSection/EditorView/EditorView.vue
+++ b/frontend/src/components/Plan/components/StatementSection/EditorView/EditorView.vue
@@ -1,5 +1,5 @@
<template>
- <div class="flex-1 flex flex-col gap-y-2">
+ <div class="h-full flex flex-col gap-y-2">
<div class="flex items-center justify-between">
<div class="flex items-center gap-x-4">
<div class="flex items-center gap-x-1 text-sm">
@@ -88,7 +88,7 @@
<BBAttention
v-if="isSheetOversize"
type="warning"
- :title="$t('issue.statement-from-sheet-warning')"
+ :description="$t('issue.statement-from-sheet-warning')"
>
<template #action>
<DownloadSheetButton v-if="sheetName" :sheet="sheetName" size="small" />
diff --git a/frontend/src/components/Plan/components/StatementSection/ReleaseView/ReleaseView.vue b/frontend/src/components/Plan/components/StatementSection/ReleaseView/ReleaseView.vue
index 283bff84f8..0230285242 100644
--- a/frontend/src/components/Plan/components/StatementSection/ReleaseView/ReleaseView.vue
+++ b/frontend/src/components/Plan/components/StatementSection/ReleaseView/ReleaseView.vue
@@ -1,5 +1,5 @@
<template>
- <div class="flex flex-col gap-y-2">
+ <div class="h-full flex flex-col gap-y-2">
<NAlert type="info" :bordered="false">
<template #icon>
<heroicons-outline:information-circle class="w-5 h-5" />
diff --git a/frontend/src/components/Plan/components/StatementSection/StatementSection.vue b/frontend/src/components/Plan/components/StatementSection/StatementSection.vue
index 619d51db1f..f654d48676 100644
--- a/frontend/src/components/Plan/components/StatementSection/StatementSection.vue
+++ b/frontend/src/components/Plan/components/StatementSection/StatementSection.vue
@@ -1,11 +1,11 @@
<template>
<div
- v-show="viewMode !== 'NONE'"
- class="flex-1 max-h-[50vh] flex flex-col gap-y-2"
+ v-if="viewMode === 'EDITOR'"
+ class="flex-1 shrink min-h-0 max-h-[50vh] flex flex-col gap-y-2"
>
- <EditorView v-if="viewMode === 'EDITOR'" :key="editorViewKey" />
- <ReleaseView v-else-if="viewMode === 'RELEASE'" />
+ <EditorView :key="editorViewKey" />
</div>
+ <ReleaseView v-else-if="viewMode === 'RELEASE'" />
</template>
<script setup lang="ts">
diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.json
index 9bb39db991..285ffc22f8 100644
--- a/frontend/src/locales/en-US.json
+++ b/frontend/src/locales/en-US.json
@@ -55,6 +55,7 @@
"run": "Run",
"retry": "Retry",
"skip": "Skip",
+ "skipped": "Skipped",
"dismiss": "Dismiss",
"back": "Back",
"next": "Next",
diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.json
index 50df194a62..80805ad407 100644
--- a/frontend/src/locales/es-ES.json
+++ b/frontend/src/locales/es-ES.json
@@ -55,6 +55,7 @@
"run": "Ejecutar",
"retry": "Reintentar",
"skip": "Saltar",
+ "skipped": "Omitido",
"dismiss": "Descartar",
"back": "Volver",
"next": "Siguiente",
diff --git a/frontend/src/locales/ja-JP.json b/frontend/src/locales/ja-JP.json
index 60f8f1aab8..068674c732 100644
--- a/frontend/src/locales/ja-JP.json
+++ b/frontend/src/locales/ja-JP.json
@@ -55,6 +55,7 @@
"run": "走る",
"retry": "リトライ",
"skip": "飛び越える",
+ "skipped": "スキップ",
"dismiss": "閉じる",
"back": "戻る",
"next": "次のステップ",
diff --git a/frontend/src/locales/vi-VN.json b/frontend/src/locales/vi-VN.json
index f31dba35a6..2353c07294 100644
--- a/frontend/src/locales/vi-VN.json
+++ b/frontend/src/locales/vi-VN.json
@@ -55,6 +55,7 @@
"run": "Chạy",
"retry": "Thử lại",
"skip": "Bỏ qua",
+ "skipped": "Đã bỏ qua",
"dismiss": "Loại bỏ",
"back": "Quay lại",
"next": "Tiếp theo",
diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.json
index 172c618ea9..1a2a62ae91 100644
--- a/frontend/src/locales/zh-CN.json
+++ b/frontend/src/locales/zh-CN.json
@@ -55,6 +55,7 @@
"run": "运行",
"retry": "重试",
"skip": "跳过",
+ "skipped": "已跳过",
"dismiss": "关闭",
"back": "返回",
"next": "下一步",