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

Method insertAllColumns

backend/plugin/parser/plsql/completion.go:266–285  ·  view source on GitHub ↗
(c *Completer)

Source from the content-addressed store, hash-verified

264}
265
266func (m CompletionMap) insertAllColumns(c *Completer) {
267 for _, schema := range c.listAllDatabases() {
268 if !c.ensureMetadata(schema) {
269 continue
270 }
271 schemaMeta := c.metadataCache[schema].GetSchemaMetadata("")
272 if schemaMeta == nil {
273 continue
274 }
275 for _, table := range schemaMeta.ListTableNames() {
276 tableMeta := schemaMeta.GetTable(table)
277 if tableMeta == nil {
278 continue
279 }
280 for _, column := range tableMeta.GetProto().GetColumns() {
281 m.Insert(c.columnCandidate(schema, table, column.Name, column.Type, !column.Nullable, column.Comment))
282 }
283 }
284 }
285}
286
287func (m CompletionMap) insertColumns(c *Completer, schemas, tables map[string]bool) {
288 for schema := range schemas {

Callers 1

Calls 9

InsertMethod · 0.95
ensureMetadataMethod · 0.80
GetSchemaMetadataMethod · 0.80
ListTableNamesMethod · 0.80
columnCandidateMethod · 0.80
listAllDatabasesMethod · 0.45
GetTableMethod · 0.45
GetColumnsMethod · 0.45
GetProtoMethod · 0.45

Tested by

no test coverage detected