collectable: collectable

View source: R/collectable.R

collectableR Documentation

collectable

Description

Wraps a timer around functions that pulls a lazy database query into memory.

Usage

collectable(x, qid = "query", format = "tibble")

Arguments

x

Dataset or lazy database query.

qid

Optional string query identifier.

format

Output format type, either via 'data.table', 'dtplyr', or 'tibble'.

Value

A queried database connection stored in local memory and the time it took to pull into memory. Alternatively provides the time to process a piped workflow or single function if the input dataset is not a lazy database connection.

Examples

## Not run: 
dplyr::tbl(connection,
           dbplyr::in_schema("SCHEMA",
                             "TABLE_NAME")) %>%
  collectable(qid = "an impossible and certainly fake query",
              format = 'tibble')

## End(Not run)


toddellis/miao documentation built on June 1, 2025, 10:11 p.m.