Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
Just returns InstanceId and DatabaseId otherwise would cause circular dependency.
天舟1e3fbcbbb4f4
diff --git a/backend/api/common.go b/backend/api/common.goindex 5688f02c9a..454942e40e 100644--- a/backend/api/common.go+++ b/backend/api/common.go@@ -19,7 +19,3 @@ func (e RowStatus) String() string {}return ""}--type ResourceObject struct {- ID int `jsonapi:"primary,resourceObject"`-}diff --git a/backend/api/dataSource.go b/backend/api/dataSource.goindex 588cf476a8..8b7b5df557 100644--- a/backend/api/dataSource.go+++ b/backend/api/dataSource.go@@ -33,8 +33,9 @@ type DataSource struct {WorkspaceId int// Related fields- Instance *ResourceObject `jsonapi:"relation,instance"`- Database *ResourceObject `jsonapi:"relation,database"`+ // Just returns InstanceId and DatabaseId otherwise would cause circular dependency.+ InstanceId int `jsonapi:"attr,instanceId"`+ DatabaseId int `jsonapi:"attr,databaseId"`// Domain specific fieldsName string `jsonapi:"attr,name"`diff --git a/backend/store/dataSource.go b/backend/store/dataSource.goindex 35674e0923..7c877498fd 100644--- a/backend/store/dataSource.go+++ b/backend/store/dataSource.go@@ -138,8 +138,6 @@ func (s *DataSourceService) createDataSource(ctx context.Context, tx *Tx, createrow.Next()var dataSource api.DataSource- dataSource.Instance = &api.ResourceObject{}- dataSource.Database = &api.ResourceObject{}if err := row.Scan(&dataSource.ID,&dataSource.CreatorId,@@ -147,8 +145,8 @@ func (s *DataSourceService) createDataSource(ctx context.Context, tx *Tx, create&dataSource.UpdaterId,&dataSource.UpdatedTs,&dataSource.WorkspaceId,- &dataSource.Instance.ID,- &dataSource.Database.ID,+ &dataSource.InstanceId,+ &dataSource.DatabaseId,&dataSource.Name,&dataSource.Type,&dataSource.Username,@@ -203,8 +201,6 @@ func (s *DataSourceService) findDataSourceList(ctx context.Context, tx *Tx, findlist := make([]*api.DataSource, 0)for rows.Next() {var dataSource api.DataSource- dataSource.Instance = &api.ResourceObject{}- dataSource.Database = &api.ResourceObject{}if err := rows.Scan(&dataSource.ID,&dataSource.CreatorId,@@ -212,8 +208,8 @@ func (s *DataSourceService) findDataSourceList(ctx context.Context, tx *Tx, find&dataSource.UpdaterId,&dataSource.UpdatedTs,&dataSource.WorkspaceId,- &dataSource.Instance.ID,- &dataSource.Database.ID,+ &dataSource.InstanceId,+ &dataSource.DatabaseId,&dataSource.Name,&dataSource.Type,&dataSource.Username,@@ -260,8 +256,6 @@ func (s *DataSourceService) patchDataSource(ctx context.Context, tx *Tx, patch *if row.Next() {var dataSource api.DataSource- dataSource.Instance = &api.ResourceObject{}- dataSource.Database = &api.ResourceObject{}if err := row.Scan(&dataSource.ID,&dataSource.CreatorId,@@ -269,8 +263,8 @@ func (s *DataSourceService) patchDataSource(ctx context.Context, tx *Tx, patch *&dataSource.UpdaterId,&dataSource.UpdatedTs,&dataSource.WorkspaceId,- &dataSource.Instance.ID,- &dataSource.Database.ID,+ &dataSource.InstanceId,+ &dataSource.DatabaseId,&dataSource.Name,&dataSource.Type,&dataSource.Username,diff --git a/frontend/src/store/modules/instance.ts b/frontend/src/store/modules/instance.tsindex 725f98c9f5..aadd64a9ed 100644--- a/frontend/src/store/modules/instance.ts+++ b/frontend/src/store/modules/instance.ts@@ -43,8 +43,7 @@ function convert(if (item.type == "dataSource" &&item.attributes.type == "ADMIN" &&- (item.relationships!.instance.data as ResourceIdentifier).id ==- instance.id+ item.attributes.instanceId == instance.id) {username = item.attributes.username as string;password = item.attributes.password as string;