DBI Package for the DuckDB Database Management System
Overview
The DuckDB project is an embedded analytical data management system with support for the Structured Query Language (SQL). This package includes all of DuckDB and an R Database Interface (DBI) connector.
Features
- Update to DuckDB v1.5.6, see <https://github.com/duckdb/duckdb/releases/tag/v1.5.6> for details.
- New experimental
to_arrow_stream()streams a dbplyr table on DuckDB into Arrow batch by batch, wherearrow::to_arrow()materializes the whole result first (#2803). - A
duckdb_errorcondition carries the fields DuckDB attaches to an error:error_type,raw_message,extra_infoandcontext, see?duckdb_error(#2714). Errors raised by the package itself point at the calling function (#2637). - A database instance is cached under the path the engine resolves, so different spellings of one file and symlinks to it share one instance, and a lower-case Windows drive letter resolves on that drive (#2627).
- The dbplyr backend translates
clock::date_build()anddifftime()(#2621). - An Arrow query result exposes its schema, and an empty batch, before the first fetch (#2781).
Show all changes in 1.5.6Hide the rest of the changes in 1.5.6
Compatibility
- The dbplyr backend needs dbplyr 2.6.0 or later, and warns when an older dbplyr is loaded (#2605).
- The installed package no longer ships the cpp11 headers under
include/(#2649). - The package compiles without warnings on the clang 23 and R-devel check flavors (#2617, #2698).
duckdb()anddbConnect()fail instead of silently ignoring settings a cached database instance cannot apply: a differentread_only, a differingconfigentry, orhome,shared_home,allow_extensionsorenvironment_scan.dbConnect(drv, dbdir)also fails whendrvalready owns a different database file. Callduckdb_shutdown()first, or pass the settings to theduckdb()call that creates the instance (#2641).
Bug fixes
Crashes and hangs
- A data frame parameter binds one struct per row instead of crashing R (#2818).
- A list column of data frames or factors no longer crashes or hangs a parallel scan (#2834), and lazy (ALTREP) vectors inside struct, matrix and list columns are materialized on R's thread before a scan reads them (#2582).
- Writing a named list with an empty value under
map = "list_of"no longer crashes (#2866). - Converting
VARIANTvalues to R no longer exposes intermediate objects to the garbage collector (#2750, #2753). - The progress display keeps its R callback alive and calls it only on R's thread (#2828), and prints at most every half second (#2844).
- Opening a database whose previous instance is still held by a connection or an unfinished result no longer spins at full CPU, it reports that the database is still in use (#2759).
- A failure inside a lazy data frame's ALTREP method no longer strips
duckdb_errorfrom later errors or leaves a partly converted column behind (#2829), and an error raised while such a method runs no longer calls into R (#1796, #1797).
Types and time zones
TIMESTAMPTZcolumns take theirtzoneattribute from the session'sTimeZonesetting, also in lazy relations, and stay in UTC when the icu extension is not available (#184, #2401).dbQuoteLiteral()keeps the sub-second part of aPOSIXctvalue (#2646, #2763).integer64columns and parameters are always written asBIGINT, whatever thebigintsetting (#2819).- Integer-backed
Dateanddifftimecolumns keep theirNAvalues, and a data frame column with several fields writes asSTRUCT(#2808). - A table whose columns R cannot hold is still found and listed, and a query returning such a column fails before it runs, naming the column (#2808).
Connections and storage
- An in-memory database spills to its own directory below
tempdir()out of the box, created only when a query spills and removed when the instance shuts down. An on-disk database keeps DuckDB's<dbdir>.tmpdefault, as the DuckDB CLI does (#2562). ~/.duckdbis no longer created for a session that only looks interactive, such as one withoptions(rlang_interactive = TRUE). Without a person to answer the prompt, the per-session directory is used (#2550).- A database path is normalized only as far as it resolves, so a path that cannot be resolved is handed to the engine rather than refused (#455, #2623), and a
dbdirthat cannot be created is reported against the user's call (#2822). - A
dbdirthat an extension handles, such as a URL, is no longer treated as a file (#2641). dbIsValid()on a driver no longer opens the database (#2754).
Queries and results
- A
PRAGMAruns after the statements before it in one query string (@t-kalinowski, #2792). Its expansion no longer leaves a transaction open or refuses aLOADhalfway, and an empty one can end a query (#2845). dbListFields()anddbAppendTable()read the columns of a table named byId()correctly (#2848).dbClearResult()frees the unread results of a multi-row bind at once, not at the next garbage collection (#2784, #2825), and ends the query of an Arrow stream that was not read to the end (#2793).
Arrow
- Reading an Arrow stream that another statement invalidated is an error, not the end of the stream (#2775), and an Arrow stream keeps its connection's client context alive (#2790).
dbFetchArrowChunk()builds the final empty chunk forLISTandINTERVALcolumns (#2774), and eachdbFetchArrowChunk()anddbFetchArrow()call uses its ownchunk_size(#2791).duckdb_fetch_arrow()andduckdb_fetch_record_batch()refuse a cleared result, as the other result methods do (#2785, #2821).
Performance
- Release the ALTREP query result after materialization and transformation (@toppyy, #1027).
- The list of valid time zones is read once per session, and again when
TZDIRchanges (#2786, #2810).
Documentation
- New reference pages
?duckdb_typesand?duckdb_types_arrowcatalog every DuckDB type in and out of R, through R vectors and through Arrow, geometry included (#2836, #2837, #2850, #2861). - The new reference page
?duckdb_memoryand the help pages for fetching and writing data describe the memory a query takes (#2666). ?duckdbdescribes what keeps a database instance open and the limitations known today (#2823, #2849).- The connection's help page describes how a string holding several statements runs (#2835).
- The README states the package's goals and non-goals (#2731).
From NEWS.md in the release
Install
Health
- OK13 OK2026-09-29
- ERROR12 OK, 1 ERROR2026-09-02
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-06-21
Show 8 earlier changesHide 8 earlier changes
- WARNING11 OK, 2 WARNING2026-05-24
- ERROR11 OK, 1 WARNING, 1 ERROR2026-05-17
- WARNING12 OK, 1 WARNING2026-05-15
- ERROR12 OK, 1 ERROR2026-05-13
- OK13 OK2026-05-02
- ERROR11 OK, 1 ERROR2026-04-25
- NOTE11 OK, 3 NOTE2026-03-18
- ERROR5 OK, 4 NOTE, 4 WARNING, 1 ERROR2026-03-10
Documentation
- Help pages
- 20 (6 internal)includes a package overview page
- Examples that run
- 100%9 run in a plain check (8 of them under a condition)
- Exported functions with examples
- 73%
- Documented parameters
- 88%
- Return-value docs
- 73%
- Help pages citing references
- 0%
Downloads
Repository
- PRs merged (all time)
- 84%
- Median days to close, 50 most recently updated closed issues
- 130
- Median days to close, 50 most recently updated closed PRs
- 1
Stars over time
Forks over time
Releases over time
Issues over time
PRs over time
Commits over time
Commit identities over time
12 development-tooling and community-health practices detected across 6 families in the upstream repository
Checks run against github.com/duckdb/duckdb-r on 2026-10-11.
The R CMD check workflow runs on Linux and Windows
GitHub Pages site last deployed 2026-10-01 · The repository has a site deploy workflow
pkgdown site last built 2026-10-01
Show all practicesHide 2 practices
This repository shows signs of AI coding tools.
- GitHub Copilotfirst seen 2025-09-07Seen in the repository: .github/copilot-instructions.mdPull request: opened by its own accountCommits: 40 by its own account · at least 17 crediting it in the message
- Claude Codefirst seen 2026-04-30Seen in the repository: .claude, .claude/skills, CLAUDE.mdNamed in .Rbuildignore: .claude, CLAUDE.mdPull request it wrote: opened by a project memberCommits: 72 by its own account · at least 424 crediting it in the message
- Claude CodePull requests: 17 from outside contributors, first on 2026-09-12, 17 from forks
- Claude Opus 5.527 commits · Sep 2026
- Claude Opus 4.822 commits · Jun to Jul 2026
- Claude Opus 514 commits · Jul to Sep 2026
- Claude Fable 55 commits · Jul 2026
- Claude Fable 5.12 commits · Sep 2026
Some of these counts are a minimum, because the search stopped before the oldest commits.
Dependencies
Installing duckdb adds 1 package (0 with compiled code, 727 KB of source tarballs). Heaviest: DBI 727 KB.
Show the 48 most downloaded dependentsHide the 48 most downloaded dependents
and 7 more dependents and 84 packages that suggest it on CRAN ↗
Code & Tests
People & History
Show 16 more copyright holdersHide 16 copyright holders
Previously maintained by Hannes Mühleisen (0.2.1 to 0.10.0).
Pick two releases to compare their code metrics.
- 1.5.6Latest
- 1.5.5
- 1.5.4.32026-07-10 · diff ↗
- 1.5.4.22026-06-29 · diff ↗
- 1.5.4.12026-06-28 · diff ↗ ·
removed 1 export
duckdb_consolidate_secretsadded 3 exports
duckdb_extension_storage, duckdb_secret_storage, duckdb_storage_status - 1.5.4
- RR 4.6.0 released · 2026-04-24
- 1.5.22026-04-13 · diff ↗
- 1.5.12026-03-26 · diff ↗
- 1.5.02026-03-14 · diff ↗
- 1.4.42026-01-28 · diff ↗
- 1.4.32025-12-10 · diff ↗
- 1.4.22025-11-17 · diff ↗
- 1.4.12025-10-16 · diff ↗
- 1.4.0
- 1.3.32025-09-10 · diff ↗
Show 60 earlier eventsHide 60 earlier events
- 1.3.22025-07-09 · diff ↗
- 1.3.12025-06-23 · diff ↗
- 1.3.02025-06-02 · diff ↗
- 1.2.22025-04-29 · diff ↗
- RR 4.5.0 released · 2025-04-11
- 1.2.12025-03-14 · diff ↗
- 1.2.02025-02-21 · diff ↗ ·
removed 4 exports
duckdb_get_substrait, duckdb_get_substrait_json, duckdb_prepare_substrait, duckdb_prepare_substrait_json - 1.1.3-22025-01-24 · diff ↗
- 1.1.3-12024-12-08 · diff ↗
- 1.1.32024-11-21 · diff ↗
- 1.1.22024-10-30 · diff ↗
- 1.1.12024-10-16 · diff ↗
- 1.1.0
- 1.0.0-22024-07-19 · diff ↗
- 1.0.0-12024-07-10 · diff ↗
- 1.0.02024-06-13 · diff ↗
- 0.10.22024-05-02 · diff ↗
- RR 4.4.0 released · 2024-04-24
- 0.10.12024-04-02 · diff ↗
- 0.10.0
- 0.9.2-12023-11-28 · diff ↗
- 0.9.22023-11-17 · diff ↗
- 0.9.1-12023-10-30 · diff ↗
- 0.9.1
- 0.8.1-32023-09-01 · diff ↗
- 0.8.1-22023-08-25 · diff ↗
- 0.8.1-12023-07-17 · diff ↗
- 0.8.12023-06-16 · diff ↗
- 0.8.02023-05-23 · diff ↗
- RR 4.3.0 released · 2023-04-21
- 0.7.1-12023-03-01 · diff ↗
- 0.7.02023-02-14 · diff ↗
- 0.6.2
- 0.6.12022-12-08 · diff ↗ ·
removed 16 exports
expr_constant, expr_function, expr_reference, expr_set_alias, expr_tostring, rel_aggregate, rel_alias, rel_distinct, rel_explain, rel_filter, rel_from_df, rel_inner_join, rel_order, rel_project, rel_set_alias, rel_sql - 0.6.02022-11-25 · diff ↗
- 0.5.12022-09-20 · diff ↗
- 0.5.02022-09-05 · diff ↗ ·
added 3 exports
duckdb_get_substrait, duckdb_get_substrait_json, duckdb_prepare_substrait - 0.4.02022-06-21 · diff ↗ ·
added 16 exports
expr_constant, expr_function, expr_reference, expr_set_alias, expr_tostring, rel_aggregate, rel_alias, rel_distinct, rel_explain, rel_filter, rel_from_df, rel_inner_join, rel_order, rel_project, rel_set_alias, rel_sql - 0.3.4-12022-06-13 · diff ↗
- 0.3.4
- RR 4.2.0 released · 2022-04-22
- 0.3.2-22022-03-16 · diff ↗
- 0.3.2-12022-03-02 · diff ↗
- 0.3.22022-02-07 · diff ↗
- 0.3.1-12021-11-22 · diff ↗
- 0.3.1
- 0.3.02021-10-08 · diff ↗
- 0.2.9
- 0.2.8
- 0.2.7
- RR 4.1.0 released · 2021-05-18
- 0.2.62021-05-09 · diff ↗
- 0.2.52021-03-16 · diff ↗
- 0.2.42021-02-02 · diff ↗
- 0.2.32020-12-12 · diff ↗
- 0.2.2-12020-11-09 · diff ↗
- 0.2.22020-11-03 · diff ↗
- 0.2.1-22020-09-30 · diff ↗
- 0.2.12020-09-10
- RR 4.0.0 released · 2020-04-24
Package metadata
- First published
- 2020-09-10
- Total releases
- 69 / 6 yrs
- License
- MIT + file LICENSE OSI · relicensed from MPL in 0.3.4
- Minimum R
- ≥ 4.2.0
- Download size
- 4.6 MB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("duckdb")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-19, which the citation names so these numbers can be found later. More on citing and the projects behind them.