You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In statement.go, duckdb_execute_prepared is used to run a query. That will block for the duration of the entire query, which means we can't cancel a DuckDB query if the context gets cancelled. However, DuckDB provides an alternative that allows the caller to periodically regain control during query execution – it is duckdb_pending_prepared and related functions (docs).
It looks like the Julia driver moved to using this (PR) to allow garbage collection to run. We could use it to periodically check the context, and cancel a query if the context has been cancelled or exceeded its deadline.
What do you think of this idea? Would be happy to submit a PR for this
The text was updated successfully, but these errors were encountered:
Currently, the
go-duckdb
driver doesn't support cancelling queries when a context is cancelled. I just discovered it might be easy to add:database/sql/driver.StmtExecContext
instead ofdatabase/sql/driver.Stmt
, we get access to the query context and can check for cancellation.statement.go
,duckdb_execute_prepared
is used to run a query. That will block for the duration of the entire query, which means we can't cancel a DuckDB query if the context gets cancelled. However, DuckDB provides an alternative that allows the caller to periodically regain control during query execution – it isduckdb_pending_prepared
and related functions (docs).It looks like the Julia driver moved to using this (PR) to allow garbage collection to run. We could use it to periodically check the context, and cancel a query if the context has been cancelled or exceeded its deadline.
What do you think of this idea? Would be happy to submit a PR for this
The text was updated successfully, but these errors were encountered: