zeroshade opened a new pull request, #4955: URL: https://github.com/apache/arrow-adbc/pull/4955
The Go driver manager wrapper had two gaps relative to the C API: - `*stmt` didn't implement `adbc.StatementExecuteSchema`, so Go callers couldn't reach `AdbcStatementExecuteSchema` even when the loaded driver supports it. - Every method ignored its `context.Context`, and nothing called `AdbcStatementCancel`. A Go caller had no way to cooperatively cancel a native driver that was blocked in execution or while reading the result stream. This PR: - Adds `stmt.ExecuteSchema`. A driver that doesn't support it returns `StatusNotImplemented`. - Makes `ExecuteQuery`, `ExecuteUpdate` and `ExecuteSchema` call `AdbcStatementCancel` when their ctx is cancelled during the native call. For `ExecuteQuery` this continues for as long as the returned reader is alive. The watcher is a `context.AfterFunc`. It is joined when the call returns, or when the reader is exhausted or released, and a mutex keeps it from cancelling after `Close`. Contexts that can't be cancelled don't get a watcher. - Returns successful native results as-is even if ctx is cancelled after the call returns, since the work may already be committed. When a native call fails and ctx is done, the error becomes `StatusCancelled`/`StatusTimeout` and keeps the driver's message. - Adds SQLite-backed tests for ExecuteSchema (SQLite returns NotImplemented), for cancellation invoking the C cancel, and for results surviving a late cancel. -- 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]
