sqldf icon indicating copy to clipboard operation
sqldf copied to clipboard

Spurious warnings

Open ggrothendieck opened this issue 4 years ago • 1 comments

Recent versions of RSQLite cause spurious warnings when statements other than select are used in the SQL statement. (e.g. update, delete, insert, etc.)

ggrothendieck avatar Apr 10 '20 18:04 ggrothendieck

Can use this to muffle the offending warnings without affecting other warnings.

sqldf2 <- function(...) {
  withCallingHandlers(sqldf(...), warning = 
    function(w) if (grepl("SQL statements must be issued with dbExecute", w)) 
      invokeRestart("muffleWarning") else w)
}

sqldf2(...sql statement...)

ggrothendieck avatar Apr 10 '20 18:04 ggrothendieck