Skip to content

Commit 951c01b

Browse files
Updated example and docs for GetArrowBatches (#171)
Updated the example and documentation for GetArrowBatches to include releasing the arrow batch. Signed-off-by: Raymond Cypher <[email protected]>
2 parents e95dd4a + f1676f2 commit 951c01b

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

doc.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,7 @@ Example usage:
322322
log.Printf("batch %v: nRecords=%v\n", iBatch, b.NumRows())
323323
iBatch += 1
324324
nRows += int(b.NumRows())
325+
b.Release()
325326
}
326327
log.Printf("NRows: %v\n", nRows)
327328
}

examples/arrrowbatches/main.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ func loopWithHasNext(db *sql.DB) {
8989
log.Printf("batch %v: nRecords=%v\n", iBatch, b.NumRows())
9090
iBatch += 1
9191
nRows += int(b.NumRows())
92+
b.Release()
9293
}
9394
log.Printf("NRows: %v\n", nRows)
9495
}
@@ -128,6 +129,7 @@ func loopWithNext(db *sql.DB) {
128129
log.Printf("batch %v: nRecords=%v\n", iBatch, b.NumRows())
129130
iBatch += 1
130131
nRows += int(b.NumRows())
132+
b.Release()
131133
}
132134

133135
log.Printf("NRows: %v\n", nRows)

0 commit comments

Comments
 (0)