MCPcopy
hub / github.com/cayleygraph/cayley / ensureColumns

Method ensureColumns

graph/sql/iterator.go:178–200  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

176}
177
178func (it *iteratorBase) ensureColumns() {
179 if it.cols != nil {
180 return
181 }
182 it.cols = it.query.Columns()
183 it.cind = make(map[quad.Direction]int, len(quad.Directions)+1)
184 for i, name := range it.cols {
185 if !strings.HasPrefix(name, tagPref) {
186 continue
187 }
188 if name == tagNode {
189 it.cind[quad.Any] = i
190 continue
191 }
192 name = name[len(tagPref):]
193 for _, d := range quad.Directions {
194 if name == d.String() {
195 it.cind[d] = i
196 break
197 }
198 }
199 }
200}
201
202func (it *iteratorBase) scanValue(r *sql.Rows) bool {
203 it.ensureColumns()

Callers 2

scanValueMethod · 0.95
ContainsMethod · 0.80

Calls 2

ColumnsMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected