Skip to content

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

chore: remove SQL review policy not configured from backend (#3564)

Danny Xu34ae4f137247
diff --git a/frontend/src/composables/useExecuteSQL.ts b/frontend/src/composables/useExecuteSQL.ts
index 2667d6bf9d..31192bdb98 100644
--- a/frontend/src/composables/useExecuteSQL.ts
+++ b/frontend/src/composables/useExecuteSQL.ts
@@ -11,13 +11,7 @@ import {
} from "../components/MonacoEditor/sqlParser";
import { pushNotification, useTabStore, useSQLEditorStore } from "@/store";
import { BBNotificationStyle } from "@/bbkit/types";
-import {
- ExecuteConfig,
- ExecuteOption,
- SQLResultSet,
- TabMode,
- SQLAdviceCodeGeneral,
-} from "@/types";
+import { ExecuteConfig, ExecuteOption, SQLResultSet, TabMode } from "@/types";
const useExecuteSQL = () => {
const { t } = useI18n();
@@ -89,12 +83,6 @@ const useExecuteSQL = () => {
let adviceStatus = "SUCCESS";
let adviceNotifyMessage = "";
for (const advice of sqlResultSet.adviceList) {
- if (advice.code === SQLAdviceCodeGeneral.NotFound) {
- // Hide the "SQL review policy is not configured or disabled" warning
- // since it's too annoying.
- continue;
- }
-
if (advice.status === "ERROR") {
adviceStatus = "ERROR";
} else if (adviceStatus !== "ERROR") {
diff --git a/server/sql.go b/server/sql.go
index 6f7f583a57..9f1d0f2aae 100644
--- a/server/sql.go
+++ b/server/sql.go
@@ -825,15 +825,7 @@ func (s *Server) sqlCheck(
policy, err := s.store.GetNormalSQLReviewPolicy(ctx, &api.PolicyFind{ResourceType: &environmentResourceType, ResourceID: &environmentID})
if err != nil {
if e, ok := err.(*common.Error); ok && e.Code == common.NotFound {
- adviceList = []advisor.Advice{
- {
- Status: advisor.Warn,
- Code: advisor.NotFound,
- Title: "SQL review policy is not configured or disabled",
- Content: "",
- },
- }
- return advisor.Warn, adviceList, nil
+ return advisor.Success, nil, nil
}
return advisor.Error, nil, err
}