odbc icon indicating copy to clipboard operation
odbc copied to clipboard

Feature/query timeout option

Open Odraio opened this issue 2 years ago • 10 comments

Issue

Current odbc main repo does not provide a query_timeout option.

Closes #515

Feature description

dbGetQuery(), dbSendStatement() and dbSendQuery() provide a query_timeout option (internally sets SQL_ATTR_QUERY_TIMEOUT).

query_timeout: The number in seconds before query timeout (can be used to stop long running queries). Default is 0 indicating no timeout.

Example:

# long running query stops after 60 seconds
# provided statement is a placeholder

dbGetQuery(con, "SELECT flight, tailnum, origin FROM flights ORDER BY origin", query_timeout = 60)

dbSendStatement(con, "SELECT flight, tailnum, origin FROM flights ORDER BY origin", query_timeout = 60)

dbSendQuery(con, "SELECT flight, tailnum, origin FROM flights ORDER BY origin", query_timeout = 60)

Additional request:

  • After merging, please create a new (CRAN) release.

Odraio avatar Nov 04 '22 08:11 Odraio