From f1676f224bba9bc20ce63b93f74e45e26b1d6af6 Mon Sep 17 00:00:00 2001 From: Raymond Cypher Date: Mon, 2 Oct 2023 11:58:39 -0600 Subject: [PATCH] Updated example and docs for GetArrowBatches Updated the example and documentation for GetArrowBatches to include releasing the arrow batch. Signed-off-by: Raymond Cypher --- doc.go | 1 + examples/arrrowbatches/main.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/doc.go b/doc.go index 4439b46..9463d77 100644 --- a/doc.go +++ b/doc.go @@ -322,6 +322,7 @@ Example usage: log.Printf("batch %v: nRecords=%v\n", iBatch, b.NumRows()) iBatch += 1 nRows += int(b.NumRows()) + b.Release() } log.Printf("NRows: %v\n", nRows) } diff --git a/examples/arrrowbatches/main.go b/examples/arrrowbatches/main.go index 88688e3..c01bdbc 100644 --- a/examples/arrrowbatches/main.go +++ b/examples/arrrowbatches/main.go @@ -89,6 +89,7 @@ func loopWithHasNext(db *sql.DB) { log.Printf("batch %v: nRecords=%v\n", iBatch, b.NumRows()) iBatch += 1 nRows += int(b.NumRows()) + b.Release() } log.Printf("NRows: %v\n", nRows) } @@ -128,6 +129,7 @@ func loopWithNext(db *sql.DB) { log.Printf("batch %v: nRecords=%v\n", iBatch, b.NumRows()) iBatch += 1 nRows += int(b.NumRows()) + b.Release() } log.Printf("NRows: %v\n", nRows)