Learn R Programming

pool (version 0.1.6)

dplyr-db-methods: DBIConnection methods from dplyr and dbplyr

Description

Pool object wrappers around DBIConnection methods, whose generics are defined either in dplyr or in dbplyr. For the original documentation, see dplyr's reference page and dbplyr's reference page.

Usage

copy_to.Pool(
  dest,
  df,
  name = deparse(substitute(df)),
  overwrite = FALSE,
  temporary = TRUE,
  ...
)

tbl.Pool(src, from, ..., vars = NULL, con = NULL)

db_analyze.Pool(con, table, ...)

db_begin.Pool(con, ...)

db_commit.Pool(con, ...)

db_create_index.Pool(con, table, columns, name = NULL, unique = FALSE, ...)

db_create_indexes.Pool(con, table, indexes = NULL, unique = FALSE, ...)

db_create_table.Pool(con, table, types, temporary = FALSE, ...)

db_data_type.Pool(con, fields)

db_desc.Pool(x)

db_drop_table.Pool(con, table, force = FALSE, ...)

db_explain.Pool(con, sql, ...)

db_has_table.Pool(con, table)

db_insert_into.Pool(con, table, values, ...)

db_list_tables.Pool(con)

db_query_fields.Pool(con, sql, ...)

db_query_rows.Pool(con, sql, ...)

db_rollback.Pool(con, ...)

db_save_query.Pool(con, sql, name, temporary = TRUE, ...)

db_write_table.Pool(con, table, types, values, temporary = FALSE, ...)

sql_escape_string.Pool(con, x)

sql_join.Pool(con, x, y, vars, type = "inner", by = NULL, ...)

sql_select.Pool( con, select, from, where = NULL, group_by = NULL, having = NULL, order_by = NULL, limit = NULL, distinct = FALSE, ... )

sql_semi_join.Pool(con, x, y, anti = FALSE, by = NULL, ...)

sql_subquery.Pool(con, from, name = random_table_name(), ...)

sql_translate_env.Pool(con)

db_collect.Pool(con, sql, n = -1, warn_incomplete = TRUE, ...)

db_compute.Pool( con, table, sql, temporary = TRUE, unique_indexes = list(), indexes = list(), ... )

db_sql_render.Pool(con, sql, ...)

sql_escape_logical.Pool(con, x)

sql_join_suffix.Pool(con, ...)

Arguments

dest, df, name, overwrite, temporary, ..., src, from, con, table, columns, unique, indexes, types, fields, x, force, sql, values, y, vars, type, by, select, where, group_by, having, order_by, limit, distinct, anti, n, warn_incomplete, unique_indexes

See original documentation.

Examples

Run this code
if (requireNamespace("RSQLite", quietly = TRUE)) {
  library(dplyr)

  db <- tempfile()
  pool <- dbPool(RSQLite::SQLite(), dbname = db)

  # 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)
} else {
  message("Please install the 'RSQLite' package to run this example")
}

Run the code above in your browser using DataLab