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

Function columnsOf

backend/plugin/parser/trino/completion.go:168–177  ·  view source on GitHub ↗

columnsOf converts storepb columns into omni catalog columns (names normalized).

(columns []*storepb.ColumnMetadata)

Source from the content-addressed store, hash-verified

166// columnsOf converts storepb columns into omni catalog columns (names
167// normalized).
168func columnsOf(columns []*storepb.ColumnMetadata) []*catalog.Column {
169 out := make([]*catalog.Column, 0, len(columns))
170 for _, c := range columns {
171 if c == nil {
172 continue
173 }
174 out = append(out, catalog.NewColumn(catalog.Normalize(c.Name), c.Type, c.Nullable))
175 }
176 return out
177}
178
179// convertCandidateType maps an omni completion candidate type onto the bytebase
180// base.CandidateType. A Trino catalog corresponds to a bytebase DATABASE.

Callers 1

loadCatalogMetadataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected