Skip to content

Commit

Permalink
Add dbSendQuery() shim
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed Jul 10, 2023
1 parent 76108c8 commit 2b49809
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions R/trace.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,24 @@ dbGetQuery <- function(conn, statement, ...) {
DBI::dbGetQuery(conn, statement, ...)
}

dbSendQuery <- function(conn, statement, ...) {
level <- tracing_level()
id <- tracing_id()

if (level >= 1) {
message_base <- paste0("[", id, "]: dbSendQuery()")
message_pre <- paste0(message_base, "\n", statement)
message_post <- paste0(message_base, " done")
class <- c("dplyr_message_trace_send_query", "dplyr_message_trace", "dplyr_message")
inform(message_pre, class = class)
on.exit({
inform(message_post, class = class)
})
}

DBI::dbSendQuery(conn, statement, ...)
}

dbExecute <- function(conn, statement, ...) {
level <- tracing_level()
id <- tracing_id()
Expand Down

0 comments on commit 2b49809

Please sign in to comment.