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

Method Build

backend/store/model/changed_resources.go:43–66  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

41}
42
43func (r *ChangedResources) Build() *storepb.ChangedResources {
44 changedResources := &storepb.ChangedResources{}
45 for name, database := range r.databases {
46 d := database.build()
47 d.Name = name
48 for _, schema := range d.Schemas {
49 for _, table := range schema.Tables {
50 if r.dbMetadata == nil {
51 continue
52 }
53 schemaMetadata := r.dbMetadata.GetSchemaMetadata(schema.GetName())
54 if schemaMetadata == nil {
55 continue
56 }
57 tableMetadata := schemaMetadata.GetTable(table.GetName())
58 if tableMetadata != nil {
59 table.TableRows = tableMetadata.GetProto().GetRowCount()
60 }
61 }
62 }
63 changedResources.Databases = append(changedResources.Databases, d)
64 }
65 return changedResources
66}
67
68func (d *ChangedDatabase) build() *storepb.ChangedResourceDatabase {
69 changedResourceDatabase := &storepb.ChangedResourceDatabase{}

Calls 6

GetSchemaMetadataMethod · 0.80
buildMethod · 0.45
GetNameMethod · 0.45
GetTableMethod · 0.45
GetRowCountMethod · 0.45
GetProtoMethod · 0.45

Tested by 1