R: DuckDB SQL backend for dbplyr

backend-duckdb {duckdb} | R Documentation

## DuckDB SQL backend for dbplyr

### Description

This is a SQL backend for dbplyr tailored to take into account DuckDB's possibilities. This mainly follows the backend for PostgreSQL, but contains more mapped functions.

### Usage

    simulate_duckdb(...)

    translate_duckdb(...)

### Arguments

`...` | Any parameters to be forwarded

### Examples

    library(dplyr, warn.conflicts = FALSE)
    con <- DBI::dbConnect(duckdb::duckdb(), path = ":memory:")

    x <- tibble(txt = c("why", "video", "cross", "extra", "deal", "authority"))
    dbx <- copy_to(con, x, overwrite = TRUE)

    # x %>% mutate(a = stringr::str_pad(txt, 10, side = "both", pad = ">"))
    dbx %>% mutate(a = str_pad(txt, 10, side = "both", pad = ">"))

    DBI::dbDisconnect(con, shutdown = TRUE)
    duckdb::duckdb_shutdown(duckdb::duckdb())

[Package duckdb version 0.4.0 Index]