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

Function convertToExportFormat

backend/api/v1/common.go:401–414  ·  view source on GitHub ↗
(format v1pb.ExportFormat)

Source from the content-addressed store, hash-verified

399}
400
401func convertToExportFormat(format v1pb.ExportFormat) storepb.ExportFormat {
402 switch format {
403 case v1pb.ExportFormat_CSV:
404 return storepb.ExportFormat_CSV
405 case v1pb.ExportFormat_JSON:
406 return storepb.ExportFormat_JSON
407 case v1pb.ExportFormat_SQL:
408 return storepb.ExportFormat_SQL
409 case v1pb.ExportFormat_XLSX:
410 return storepb.ExportFormat_XLSX
411 default:
412 }
413 return storepb.ExportFormat_FORMAT_UNSPECIFIED
414}
415
416func GetUserFromContext(ctx context.Context) (*store.UserMessage, bool) {
417 user, ok := ctx.Value(common.UserContextKey).(*store.UserMessage)

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected