| 176 | } |
| 177 | |
| 178 | func (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 | |
| 202 | func (it *iteratorBase) scanValue(r *sql.Rows) bool { |
| 203 | it.ensureColumns() |