This is an automated email from the ASF dual-hosted git repository.

lidavidm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-adbc.git


The following commit(s) were added to refs/heads/main by this push:
     new d28465d1b feat(go): clarify bind behavior (#4267)
d28465d1b is described below

commit d28465d1bd68ba7bb6b90278d0887f5c9e151658
Author: David Li <[email protected]>
AuthorDate: Mon Apr 27 10:13:47 2026 +0900

    feat(go): clarify bind behavior (#4267)
    
    I noticed the drivers were inconsistent. This tries to be more explicit
    about what you are expected to do (bind, then release) and matches the
    behavior of the Snowflake driver.
---
 go/adbc/adbc.go | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/go/adbc/adbc.go b/go/adbc/adbc.go
index 8f0cac1b8..d66e143a3 100644
--- a/go/adbc/adbc.go
+++ b/go/adbc/adbc.go
@@ -737,19 +737,23 @@ type Statement interface {
        // executed repeatedly, Prepare should be called first on the statement.
        SetSubstraitPlan(plan []byte) error
 
-       // Bind uses an arrow record batch to bind parameters to the query.
+       // Bind uses an Arrow record batch to bind parameters to the query.
        //
-       // This can be used for bulk inserts or for prepared statements.
-       // The driver will call release on the passed in Record when it is done,
-       // but it may not do this until the statement is closed or another
-       // record is bound.
+       // This can be used for bulk inserts or for prepared statements.  The
+       // driver will Retain the given batch; the application must still
+       // Release the batch after binding. The driver will Release the batch
+       // after processing, but this may not be until Close is called. A nil
+       // batch will unbind values.
        Bind(ctx context.Context, values arrow.RecordBatch) error
 
        // BindStream uses a record batch stream to bind parameters for this
        // query. This can be used for bulk inserts or prepared statements.
        //
-       // The driver will call Release on the record reader, but may not do 
this
-       // until Close is called.
+       // This can be used for bulk inserts or for prepared statements.  The
+       // driver will Retain the given reader; the application must still
+       // Release the reader after binding. The driver will Release the
+       // reader after processing, but this may not be until Close is
+       // called. A nil reader will unbind values.
        BindStream(ctx context.Context, stream array.RecordReader) error
 
        // GetParameterSchema returns an Arrow schema representation of

Reply via email to