-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using DBIConnection with dplyr causes problems when using SQLite functions #3093
Comments
I think your documentation reading is accurate, and I also see the same problem when re-running your example. So I think there is definitely an issue. I think directly calling suppressPackageStartupMessages(library("dplyr"))
df <- data.frame(x = 10)
db1 <- DBI::dbConnect(RSQLite::SQLite(), ":memory:")
# print(src_sqlite)
RSQLite::initExtension(db1)
df1 <- dplyr::copy_to(db1, df)
df1 %>% dplyr::mutate(y = log(x))
#> # Source: lazy query [?? x 2]
#> # Database: sqlite 3.19.3 [:memory:]
#> x y
#> <dbl> <dbl>
#> 1 10 2.302585
packageVersion("dplyr")
#> [1] '0.7.2.9000'
packageVersion("dbplyr")
#> [1] '1.1.0.9000'
packageVersion("DBI")
#> [1] '0.7' I got the work-around by calling |
Thanks! Indeed |
@shntnu , You are very welcome. Finding this may save me some debugging. I think we are probably on the same page that we don't trust work-arounds to age well. |
Duplicate of #3150, and moved to r-dbi/RSQLite#236. |
dplyr docs mention that the modern best practice is to use
tbl()
directly on aDBIConnection
, but that seems to be causing problems when using SQLite extension functions likelog
. Why?Approach 1 does not work. This is the recommended approach as mentioned in
dplyr docs:
Approach 2 works. This is the deprecated approach as mentioned in dplyr docs:
Here is the environment
The text was updated successfully, but these errors were encountered: