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

Function convertPlanSpecExportDataConfig

backend/api/v1/plan_service.go:1214–1233  ·  view source on GitHub ↗
(config *v1pb.Plan_Spec_ExportDataConfig)

Source from the content-addressed store, hash-verified

1212}
1213
1214func convertPlanSpecExportDataConfig(config *v1pb.Plan_Spec_ExportDataConfig) *storepb.PlanConfig_Spec_ExportDataConfig {
1215 c := config.ExportDataConfig
1216 // Sheet can be empty if not yet attached to the export data config.
1217 var sheetSha256 string
1218 if c.Sheet != "" {
1219 _, sha256, err := common.GetProjectResourceIDSheetSha256(c.Sheet)
1220 if err != nil {
1221 return nil
1222 }
1223 sheetSha256 = sha256
1224 }
1225 return &storepb.PlanConfig_Spec_ExportDataConfig{
1226 ExportDataConfig: &storepb.PlanConfig_ExportDataConfig{
1227 Targets: c.Targets,
1228 SheetSha256: sheetSha256,
1229 Format: convertToExportFormat(c.Format),
1230 Password: c.Password,
1231 },
1232 }
1233}
1234
1235func convertToPlanCheckRunStatus(status store.PlanCheckRunStatus) v1pb.PlanCheckRun_Status {
1236 switch status {

Callers 1

convertPlanSpecFunction · 0.85

Calls 2

convertToExportFormatFunction · 0.85

Tested by

no test coverage detected