MCPcopy Create free account
hub / github.com/bytebase/bytebase / buildStatementSummaryResultMap

Function buildStatementSummaryResultMap

backend/runner/approval/runner.go:527–544  ·  view source on GitHub ↗
(results []*storepb.PlanCheckRunResult_Result)

Source from the content-addressed store, hash-verified

525}
526
527func buildStatementSummaryResultMap(results []*storepb.PlanCheckRunResult_Result) map[statementSummaryKey]*storepb.PlanCheckRunResult_Result {
528 m := map[statementSummaryKey]*storepb.PlanCheckRunResult_Result{}
529 for _, result := range results {
530 if result.Type != storepb.PlanCheckType_PLAN_CHECK_TYPE_STATEMENT_SUMMARY_REPORT {
531 continue
532 }
533 instanceID, databaseName, err := common.GetInstanceDatabaseID(result.Target)
534 if err != nil {
535 continue
536 }
537 m[statementSummaryKey{
538 InstanceID: instanceID,
539 DatabaseName: databaseName,
540 SheetSHA256: result.SheetSha256,
541 }] = result
542 }
543 return m
544}
545
546func isPlanCheckRunPendingApprovalEvaluation(planCheckRun *store.PlanCheckRunMessage) bool {
547 if planCheckRun == nil {

Calls 1

GetInstanceDatabaseIDFunction · 0.92