Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Implement query cancellation #515

Merged
merged 22 commits into from
Oct 21, 2024
Merged

feat: Implement query cancellation #515

merged 22 commits into from
Oct 21, 2024

Conversation

krlmlr
Copy link
Collaborator

@krlmlr krlmlr commented Oct 20, 2024

Closes #514.

library(DBI)
con <- dbConnect(duckdb::duckdb())

dbExecute(con, "CREATE TABLE data AS SELECT unnest(generate_series(1, 100000)) AS a")

tryCatch(
  dbGetQuery(con, "SELECT COUNT(*) FROM data JOIN data AS data2 ON data.a != data2.a"),
  interrupt = function(e) {
    message("Interrupt handled in R")
  }
)

dbDisconnect(con)

@krlmlr krlmlr marked this pull request as draft October 20, 2024 10:04
@krlmlr krlmlr marked this pull request as ready for review October 20, 2024 16:16
@krlmlr krlmlr force-pushed the f-514-cancel branch 2 times, most recently from 65f6d57 to e6f4b9b Compare October 20, 2024 21:39
@krlmlr krlmlr requested a review from hannes October 21, 2024 02:49
@krlmlr krlmlr enabled auto-merge October 21, 2024 02:49
@krlmlr krlmlr disabled auto-merge October 21, 2024 03:34
@krlmlr krlmlr enabled auto-merge October 21, 2024 04:09
@krlmlr krlmlr merged commit 007c6e4 into main Oct 21, 2024
11 checks passed
@krlmlr krlmlr deleted the f-514-cancel branch October 21, 2024 05:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't cancel long-running queries
1 participant