Skip to content

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

fix: skip empty senstive info (#7671)

rebelice5a287ced7619
diff --git a/backend/api/v1/sql_service.go b/backend/api/v1/sql_service.go
index 262c973825..3b7d7e8f3b 100644
--- a/backend/api/v1/sql_service.go
+++ b/backend/api/v1/sql_service.go
@@ -1402,6 +1402,9 @@ func (s *SQLService) getSensitiveSchemaInfo(ctx context.Context, instance *store
Table: table.Name,
Column: column.Name,
}]
+ if sensitive {
+ isEmpty = false
+ }
tableSchema.ColumnList = append(tableSchema.ColumnList, db.ColumnInfo{
Name: column.Name,
Sensitive: sensitive,
@@ -1409,9 +1412,6 @@ func (s *SQLService) getSensitiveSchemaInfo(ctx context.Context, instance *store
}
databaseSchema.TableList = append(databaseSchema.TableList, tableSchema)
}
- if len(databaseSchema.TableList) > 0 {
- isEmpty = false
- }
result.DatabaseList = append(result.DatabaseList, databaseSchema)
}
continue
@@ -1448,6 +1448,9 @@ func (s *SQLService) getSensitiveSchemaInfo(ctx context.Context, instance *store
}
sensitive = classificationIsSensitive
}
+ if sensitive {
+ isEmpty = false
+ }
tableSchema.ColumnList = append(tableSchema.ColumnList, db.ColumnInfo{
Name: column.Name,
Sensitive: sensitive,
@@ -1463,15 +1466,6 @@ func (s *SQLService) getSensitiveSchemaInfo(ctx context.Context, instance *store
databaseSchema.SchemaList = append(databaseSchema.SchemaList, schemaSchema)
}
}
- if instance.Engine == db.Snowflake || instance.Engine == db.MSSQL {
- if len(databaseSchema.SchemaList) > 0 {
- isEmpty = false
- }
- } else {
- if len(databaseSchema.TableList) > 0 {
- isEmpty = false
- }
- }
result.DatabaseList = append(result.DatabaseList, databaseSchema)
}