You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Postgres-backend includes a format argument to the sql_query_explain -method. However, that argument never survives to the function, and default value is always used. This is very restrictive for the backends that would benefit for passing arguments to the method.
To demonstrate the issue, the following reprex changes the sql_query_explain -method of SQLiteConnection so that the value of the argument becomes visible.
library(dplyr, warn.conflicts=FALSE)
library(dbplyr, warn.conflicts=FALSE)
# Adding format argument (from Postgres explain) to SQLite explainsql_query_explain.SQLiteConnection<-function(con, sql, format="text", ...) {
dbplyr:::cat_line("Parameter 'format' with value: ", format)
build_sql("EXPLAIN QUERY PLAN ", sql, con=con)
}
assignInNamespace("sql_query_explain.SQLiteConnection", sql_query_explain.SQLiteConnection, ns="dbplyr")
con=DBI::dbConnect(RSQLite::SQLite(), ":memory:")
df<- copy_to(con, tibble(x=1))
df %>% explain(format="json") # Value below should be: json#> <SQL>#> SELECT *#> FROM `tibble(x = 1)`#> #> <PLAN>#> Parameter 'format' with value: text#> id parent notused detail#> 1 2 0 0 SCAN tibble(x = 1)DBI::dbDisconnect(con)
Created on 2022-02-18 by the reprex package (v2.0.1.9000)
The text was updated successfully, but these errors were encountered:
Postgres-backend includes a format argument to the
sql_query_explain
-method. However, that argument never survives to the function, and default value is always used. This is very restrictive for the backends that would benefit for passing arguments to the method.To demonstrate the issue, the following reprex changes the
sql_query_explain
-method of SQLiteConnection so that the value of the argument becomes visible.Created on 2022-02-18 by the reprex package (v2.0.1.9000)
The text was updated successfully, but these errors were encountered: