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

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
duckdb_read_csv()
Reads a CSV file into DuckDB
duckdb_explain-class duckdb_explain print.duckdb_explain
DuckDB EXPLAIN query tree

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 experimental
DuckDB file-system usage: storage locations and how they are resolved
duckdb_extension_storage() duckdb_secret_storage() duckdb_storage_status() experimental
Configure where DuckDB stores extensions and secrets