mirror of https://github.com/jackc/pgx.git
parent
e35041372d
commit
6515e183ff
2
doc.go
2
doc.go
|
@ -40,7 +40,7 @@ directly.
|
||||||
|
|
||||||
var sum, n int32
|
var sum, n int32
|
||||||
rows, _ := conn.Query(context.Background(), "select generate_series(1,$1)", 10)
|
rows, _ := conn.Query(context.Background(), "select generate_series(1,$1)", 10)
|
||||||
_, err := pgx.ForEachRow(rows, []any{&n}, func(pgx.QueryFuncRow) error {
|
_, err := pgx.ForEachRow(rows, []any{&n}, func() error {
|
||||||
sum += n
|
sum += n
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue