MCPcopy Create free account
hub / github.com/dgraph-io/dgraph / getColumnIndices

Function getColumnIndices

dgraph/cmd/migrate/utils.go:60–71  ·  view source on GitHub ↗

getColumnIndices first sort the columns in the table alphabetically, and then returns the indices of the columns satisfying the criteria function

(info *sqlTable, criteria criteriaFunc)

Source from the content-addressed store, hash-verified

58// getColumnIndices first sort the columns in the table alphabetically, and then
59// returns the indices of the columns satisfying the criteria function
60func getColumnIndices(info *sqlTable, criteria criteriaFunc) []*columnIdx {
61 indices := make([]*columnIdx, 0)
62 for i, column := range info.columnNames {
63 if criteria(info, column) {
64 indices = append(indices, &columnIdx{
65 name: column,
66 index: i,
67 })
68 }
69 }
70 return indices
71}
72
73type columnIdx struct {
74 name string // the column name

Callers 4

generateMethod · 0.85
recordMethod · 0.85
getBlankNodeGenFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…