Skip to content

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

Don’t return ALL_DATABASE (*) by default

天舟898f79e361ea
diff --git a/backend/api/database.go b/backend/api/database.go
index fb46042b42..865e201caa 100644
--- a/backend/api/database.go
+++ b/backend/api/database.go
@@ -2,6 +2,8 @@ package api
import "context"
+const ALL_DATABASE_NAME = "*"
+
type SyncStatus string
const (
@@ -63,9 +65,10 @@ type DatabaseCreate struct {
type DatabaseFind struct {
// Standard fields
- ID *int
- WorkspaceId *int
- InstanceId *int
+ ID *int
+ WorkspaceId *int
+ InstanceId *int
+ IncludeAllDatabase bool
}
type DatabasePatch struct {
diff --git a/backend/store/database.go b/backend/store/database.go
index 22f052d3cb..55f4fa5f1d 100644
--- a/backend/store/database.go
+++ b/backend/store/database.go
@@ -166,6 +166,10 @@ func (s *DatabaseService) findDatabaseList(ctx context.Context, tx *Tx, find *ap
where, args = append(where, "instance_id = ?"), append(args, *v)
}
+ if !find.IncludeAllDatabase {
+ where = append(where, "name != '"+api.ALL_DATABASE_NAME+"'")
+ }
+
rows, err := tx.QueryContext(ctx, `
SELECT
id,