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

Function convertV1TableCatalog

backend/api/v1/database_catalog_service.go:317–330  ·  view source on GitHub ↗
(t *v1pb.TableCatalog)

Source from the content-addressed store, hash-verified

315}
316
317func convertV1TableCatalog(t *v1pb.TableCatalog) *storepb.TableCatalog {
318 tc := &storepb.TableCatalog{
319 Name: t.Name,
320 Classification: t.Classification,
321 }
322 if t.GetObjectSchema() != nil && len(t.GetColumns().GetColumns()) == 0 {
323 tc.ObjectSchema = convertV1ObjectSchema(t.GetObjectSchema())
324 } else {
325 for _, cc := range t.GetColumns().GetColumns() {
326 tc.Columns = append(tc.Columns, convertV1ColumnCatalog(cc))
327 }
328 }
329 return tc
330}
331
332func convertV1ColumnCatalog(c *v1pb.ColumnCatalog) *storepb.ColumnCatalog {
333 return &storepb.ColumnCatalog{

Callers 1

convertDatabaseCatalogFunction · 0.85

Calls 4

convertV1ObjectSchemaFunction · 0.85
convertV1ColumnCatalogFunction · 0.85
GetObjectSchemaMethod · 0.45
GetColumnsMethod · 0.45

Tested by

no test coverage detected