2
0

Rename ForEachScannedRow to ForEachRow

This commit is contained in:
Jack Christensen
2022-07-09 16:47:28 -05:00
parent da192291f7
commit 90c2dc6f68
8 changed files with 89 additions and 89 deletions
+2 -2
View File
@@ -63,11 +63,11 @@ pgx implements Query and Scan in the familiar database/sql style.
// No errors found - do something with sum
ForEachScannedRow can be used to execute a callback function for every row. This is often easier than iterating over rows directly.
ForEachRow can be used to execute a callback function for every row. This is often easier than iterating over rows directly.
var sum, n int32
rows, _ := conn.Query(context.Background(), "select generate_series(1,$1)", 10)
_, err := pgx.ForEachScannedRow(rows, []any{&n}, func(pgx.QueryFuncRow) error {
_, err := pgx.ForEachRow(rows, []any{&n}, func(pgx.QueryFuncRow) error {
sum += n
return nil
})