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
Function dbplyr::tbl_sql() has parameter vars, but I am unable to pass it from dplyr::tbl.DBIConnection(), because ... are ignored in dbplyr::tbl.src_dbi().
Here is a simple test:
> trace(dbplyr:::db_query_fields.DBIConnection)
> class(con)
[1] "Microsoft SQL Server"
attr(,"package")
[1] ".GlobalEnv"
> tbl(con, sql("select id, name from test"))
trace: db_query_fields.DBIConnection(con, ...)
# Source: SQL [?? x 2]
# Database: Microsoft SQL Server 12.00.2000[xxxx]
id name
<int> <chr>
1 1 test1
2 2 test2
> tbl(con, sql("select id, name from test"), vars = c("id", "name"))
trace: db_query_fields.DBIConnection(con, ...)
# Source: SQL [?? x 2]
# Database: Microsoft SQL Server 12.00.2000[xxxx]
id name
<int> <chr>
1 1 test1
2 2 test2
Note, that db_query_fields() is called in both cases.
Parameter vars can be helpful not just to save one request to database, but also to be able to fetch hidden SQL Server temporal tables' period columns, which are not returned by db_query_fields(). For now, my workaround is to use dbplyr::tbl_sql() directly.
I propose to modify tbl.dbi_src() to pass the dots down to tbl_sql:
Function
dbplyr::tbl_sql()
has parametervars
, but I am unable to pass it fromdplyr::tbl.DBIConnection()
, because...
are ignored indbplyr::tbl.src_dbi()
.Here is a simple test:
Note, that
db_query_fields()
is called in both cases.Parameter
vars
can be helpful not just to save one request to database, but also to be able to fetch hidden SQL Server temporal tables' period columns, which are not returned bydb_query_fields()
. For now, my workaround is to usedbplyr::tbl_sql()
directly.I propose to modify
tbl.dbi_src()
to pass the dots down to tbl_sql:The text was updated successfully, but these errors were encountered: