lidavidm commented on code in PR #893:
URL: https://github.com/apache/arrow-adbc/pull/893#discussion_r1261598260
##########
go/adbc/pkg/_tmpl/driver.go.tmpl:
##########
@@ -426,6 +911,46 @@ func toCdataArray(ptr *C.struct_ArrowArray)
*cdata.CArrowArray {
return (*cdata.CArrowArray)(unsafe.Pointer(ptr))
}
+//export {{.Prefix}}ConnectionCancel
+func {{.Prefix}}ConnectionCancel(cnxn *C.struct_AdbcConnection, err
*C.struct_AdbcError) (code C.AdbcStatusCode) {
+ defer func() {
+ if e := recover(); e != nil {
+ code = poison(err, "AdbcConnectionCancel", e)
+ }
+ }()
+ conn := checkConnInit(cnxn, err, "AdbcConnectionCancel")
+ if conn == nil {
+ return C.ADBC_STATUS_INVALID_STATE
+ }
+
+ conn.cancelContext()
+ return C.ADBC_STATUS_OK
+}
+
+func toStrPtr(in *C.cchar_t) *string {
+ if in == nil {
+ return nil
+ }
+
+ out := C.GoString((*C.char)(in))
+ return &out
Review Comment:
I would rather be safe and copy
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]