Closed RichardKeo closed 3 months ago
Thank you for creating this issue.
I don't use context
package myself, but other users of github.com/alexbrainman/odbc
might use it. So it could be beneficial for them.
You would have to make all code changes yourself. I am happy to review your PR.
Your changes would have to include correspondent tests for new functionality. Most tests are written against MS SQL Server (see mssql_test.go
file). If you want to extend these, I should be able to test them.
Thank you.
Alex
The
QueryerContext
interface is an optional interface that aConn
can implement. It provides aconn.QueryContext()
function that should honour the context passed in, and return when the context is cancelled or times out.According to the specifications, when this interface is not implemented:
Queryer
interface, which is also optional but deprecated,The current implementation neither have a
QueryerContext
interface not aQueryer
one, which means that we fallback to the default behaviour.The issue we're currently facing is that when we use
QueryContext()
, we pass in a context with a timeout, and if a query takes longer than desired to execute, the application may end up stuck waiting for the execution to complete and return even though the context has already expired.Instead, when the context is cancelled or expires, it would be better if we could:
Do you think a contribution towards this would be beneficial?