tbl.Pool {pool} | R Documentation |
Use pool with dbplyr
Description
Wrappers for key dplyr (and dbplyr) methods so that pool works seemlessly with dbplyr.
Usage
tbl.Pool(src, from, ..., vars = NULL)
copy_to.Pool(dest, df, name = NULL, overwrite = FALSE, temporary = TRUE, ...)
Arguments
src , dest |
A dbPool. |
from |
Name table or |
... |
Other arguments passed on to the individual methods |
vars |
A character vector of variable names in |
df |
A local data frame, a |
name |
Name for remote table. Defaults to the name of |
overwrite |
If |
temporary |
if |
Examples
library(dplyr)
pool <- dbPool(RSQLite::SQLite())
# copy a table into the database
copy_to(pool, mtcars, "mtcars", temporary = FALSE)
# retrieve a table
mtcars_db <- tbl(pool, "mtcars")
mtcars_db
mtcars_db %>% select(mpg, cyl, disp)
mtcars_db %>% filter(cyl == 6) %>% collect()
poolClose(pool)