Skip to content

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

fix: skip sql review check when db name is empty (#2700)

rebelice17732161f4b7
diff --git a/server/sql.go b/server/sql.go
index a2b2717486..d2fa44331f 100644
--- a/server/sql.go
+++ b/server/sql.go
@@ -181,7 +181,7 @@ func (s *Server) registerSQLRoutes(g *echo.Group) {
adviceLevel := advisor.Success
adviceList := []advisor.Advice{}
- if s.feature(api.FeatureSQLReviewPolicy) && api.IsSQLReviewSupported(instance.Engine, s.profile.Mode) {
+ if s.feature(api.FeatureSQLReviewPolicy) && api.IsSQLReviewSupported(instance.Engine, s.profile.Mode) && exec.DatabaseName != "" {
dbType, err := advisorDB.ConvertToAdvisorDBType(string(instance.Engine))
if err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("Failed to convert db type %v into advisor db type", instance.Engine))