Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
Compose table creatorId/updaterId
天舟037b787afd21
diff --git a/server/database.go b/server/database.goindex 99a9b6a168..b63b630fbe 100644--- a/server/database.go+++ b/server/database.go@@ -274,6 +274,10 @@ func (s *Server) registerDatabaseRoutes(g *echo.Group) {if err != nil {return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("Failed to fetch index list for database id: %d, table name: %s", id, table.Name)).SetInternal(err)}++ if err := s.ComposeTableRelationship(ctx, table); err != nil {+ return echo.NewHTTPError(http.StatusInternalServerError, "Failed to compose table relationship").SetInternal(err)+ }}c.Response().Header().Set(echo.HeaderContentType, echo.MIMEApplicationJSONCharsetUTF8)@@ -331,6 +335,10 @@ func (s *Server) registerDatabaseRoutes(g *echo.Group) {return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("Failed to fetch index list for database id: %d, table name: %s", id, table.Name)).SetInternal(err)}+ if err := s.ComposeTableRelationship(ctx, table); err != nil {+ return echo.NewHTTPError(http.StatusInternalServerError, "Failed to compose table relationship").SetInternal(err)+ }+c.Response().Header().Set(echo.HeaderContentType, echo.MIMEApplicationJSONCharsetUTF8)if err := jsonapi.MarshalPayload(c.Response().Writer, table); err != nil {return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("Failed to marshal fetch table response: %v", id)).SetInternal(err)@@ -631,6 +639,21 @@ func (s *Server) ComposeDatabaseRelationship(ctx context.Context, database *api.return nil}+func (s *Server) ComposeTableRelationship(ctx context.Context, table *api.Table) error {+ var err error++ table.Creator, err = s.ComposePrincipalById(ctx, table.CreatorId)+ if err != nil {+ return err+ }++ table.Updater, err = s.ComposePrincipalById(ctx, table.UpdaterId)+ if err != nil {+ return err+ }+ return nil+}+// ComposeBackupByID will compose the backup by backup ID.func (s *Server) ComposeBackupByID(ctx context.Context, id int) (*api.Backup, error) {backupFind := &api.BackupFind{