MCPcopy Create free account
hub / github.com/apecloud/myduckserver / readAllRowsIntoMaps

Function readAllRowsIntoMaps

binlogreplication/binlog_replication_test.go:654–666  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
654func 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.

Callers 1

outputShowReplicaStatusFunction · 0.85

Calls 2

NextMethod · 0.45

Tested by

no test coverage detected