ToMap converts the unstructured list of data into a map containing an entry for each column, and the lists of values. The order of columns is not preseved, but the order of values within each column is.
()
| 240 | // for each column, and the lists of values. The order of columns is |
| 241 | // not preseved, but the order of values within each column is. |
| 242 | func (r *IteratorResult) ToMap() map[string][]pq.Value { |
| 243 | m := map[string][]pq.Value{} |
| 244 | for _, e := range r.Entries { |
| 245 | m[e.Key] = append(m[e.Key], e.Value) |
| 246 | } |
| 247 | return m |
| 248 | } |
| 249 | |
| 250 | // Columns gets the values for each named column. The order of returned values |
| 251 | // matches the order of names given. This is more efficient than converting to a map. |
no outgoing calls