tidyverse / dbplyr

Database (DBI) backend for dplyr

Home Page:https://dbplyr.tidyverse.org

Repository from Github https://github.comtidyverse/dbplyrRepository from Github https://github.comtidyverse/dbplyr

Expose color setting in signature of show_query()?

MichaelChirico opened this issue · comments

dbplyr/R/explain.R

Lines 3 to 9 in 5726930

show_query.tbl_lazy <- function(x, ..., cte = FALSE, sql_options = NULL) {
withr::local_options(list(dbplyr_use_colour = TRUE))
sql <- remote_query(x, cte = cte, sql_options = sql_options)
cat_line("<SQL>")
cat_line(sql)
invisible(x)
}

We have to disable color setting because it interferes with our SQL formatter (which can only be applied on the rendered SQL), which gets totally lost when encountering the ANSI markup codes.

Is there any reason not to put this option into the singature?