MCPcopy Index your code
hub / github.com/bytebase/bytebase / DataSourceFromInstanceWithType

Function DataSourceFromInstanceWithType

backend/utils/utils.go:24–31  ·  view source on GitHub ↗

DataSourceFromInstanceWithType gets a typed data source from an instance.

(instance *store.InstanceMessage, dataSourceType storepb.DataSourceType)

Source from the content-addressed store, hash-verified

22
23// DataSourceFromInstanceWithType gets a typed data source from an instance.
24func DataSourceFromInstanceWithType(instance *store.InstanceMessage, dataSourceType storepb.DataSourceType) *storepb.DataSource {
25 for _, dataSource := range instance.Metadata.GetDataSources() {
26 if dataSource.GetType() == dataSourceType {
27 return dataSource
28 }
29 }
30 return nil
31}
32
33// FindNextPendingRole finds the next pending role in the approval flow.
34func FindNextPendingRole(approval *storepb.IssuePayloadApproval) string {

Callers 8

RunOnceMethod · 0.92
executeGhostMigrationFunction · 0.92
RunForTargetMethod · 0.92
getResourcesForSnowflakeFunction · 0.92
getResourcesForMSSQLFunction · 0.92

Calls 2

GetDataSourcesMethod · 0.45
GetTypeMethod · 0.45

Tested by

no test coverage detected