readAllRowsIntoMaps reads all data from |rows| and returns a slice of maps, where each key in the map is the field name, and each value is the string representation of the field value.
(t *testing.T, rows *sqlx.Rows)
| 652 | // readAllRowsIntoMaps reads all data from |rows| and returns a slice of maps, where each key |
| 653 | // in the map is the field name, and each value is the string representation of the field value. |
| 654 | func readAllRowsIntoMaps(t *testing.T, rows *sqlx.Rows) []map[string]interface{} { |
| 655 | result := make([]map[string]interface{}, 0) |
| 656 | for { |
| 657 | row := make(map[string]interface{}) |
| 658 | if rows.Next() == false { |
| 659 | return result |
| 660 | } |
| 661 | err := rows.MapScan(row) |
| 662 | require.NoError(t, err) |
| 663 | row = convertMapScanResultToStrings(row) |
| 664 | result = append(result, row) |
| 665 | } |
| 666 | } |
| 667 | |
| 668 | // readAllRowsIntoSlices reads all data from |rows| and returns a slice of slices, with |
| 669 | // all values converted to strings. |
no test coverage detected