Skip to contents

Getting started

One-line entry points for running a query or grabbing a throwaway in-memory connection.

sql_query() sql_exec() experimental
Run an SQL query or statement
default_conn() experimental
Get the default connection

Data types

What each DuckDB type becomes in R and which R value writes it back, through R vectors and through Arrow, geometry included.

duckdb_types
DuckDB data types in R
duckdb_types_arrow
DuckDB data types through Arrow

Memory

Reading and writing large data within a memory budget: the limit, the streaming read, and the routes that let the engine scan a data frame or a file in place.

duckdb_memory
Memory-efficient reading and writing

Driver

Create or reuse a DuckDB database instance and the driver object passed to dbConnect().

Connection

The DBI connection to a DuckDB database and its methods.

Result

The object returned by a query, used to fetch rows and column metadata.

Interfaces

Integrations with other parts of the R ecosystem: the dplyr/dbplyr backend, registering data frames and Arrow data as tables, reading CSV files, and inspecting query plans.

tbl_file() tbl_function() tbl_query() simulate_duckdb()
DuckDB SQL backend for dbplyr
duckdb_register() duckdb_unregister()
Register a data frame as a virtual table
duckdb_register_arrow() duckdb_unregister_arrow() duckdb_list_arrow()
Register an Arrow data source as a virtual table
to_arrow_stream() experimental
Stream a dbplyr table on DuckDB into Arrow
duckdb_read_csv()
Reads a CSV file into DuckDB
duckdb_explain-class duckdb_explain print.duckdb_explain
DuckDB EXPLAIN query tree

Errors

What a failing query raises, and the fields to classify it by instead of parsing the message.

duckdb_error experimental
DuckDB error conditions

Storage locations

Where DuckDB writes extensions, stored secrets, and temporary files, and how to choose those locations so that nothing is written outside the session’s temporary directory unless you opt in.

duckdb_storage_status() experimental
DuckDB file-system usage: storage locations and how they are resolved