Skip to content

dbplyr

2.6.0Package record

A 'dplyr' Back End for Databases

75packages dependsuggested by 77
6.5Mdownloads / year
91.8%test coverage
13/13flavors OK

Overview

About

A 'dplyr' back end for databases that allows you to work with remote database tables as if they are in-memory data frames. Basic features work with any database that has a 'DBI' back end; more advanced features require 'SQL' translation to be provided by the package author.

Changes in 2.6.0

Lifecycle changes

  • Newly deprecated:
  • dbplyr 1st edition backends no longer work. This concludes over 2 years of work with backend developers to get everyone moved over to the 2nd edition (#1197).
  • as.sql(), as part of major internal refactoring of how sql() and ident() are used (#1752).
  • The cte argument of collect(), compute(), db_sql_render(), remote_query(), and show_query(); pass sql_options = sql_options(cte = TRUE) instead. collect() and compute() gain an sql_options argument to support this (#1834).
  • do(). Use collect() then your favourite tidyverse functions instead (#1767).
  • escape_ansi(). Use escape(x, con = dialect_ansi()) instead (#1793).
  • memdb_frame() no longer accepts data frames; this was never explicitly supported but worked by coincidence. Use copy_to(memdb(), df) instead (#1704).
  • sql_expr_matches(); provide an is_not_distinct_from() translation in sql_translation() instead (#1803).
  • src_memdb() and tbl_memdb(); use memdb() and copy_to(memdb(), df) instead. There's also a new local_memdb_frame() for use in tests (#1704).
  • str_like(ignore_case = ); use str_ilike() instead (@edward-burn, #1630).
  • Previously-warning deprecations are defunct (#1834):
Show all changes in 2.6.0Hide the rest of the changes in 2.6.0
  • Passing extra ... to across()/if_all()/if_any() (deprecated in 2.3.0, 2023-01-16).
  • Using by = character() to perform a cross join (deprecated in dplyr 1.1.0, 2023-01-29).
  • compute(temporary = FALSE) without a name (deprecated in 2.3.3, 2023-07-07).
  • sql_random() (deprecated in 2.3.2, 2023-03-21).
  • sql_query_append() with a lazy table for from (deprecated in 2.3.2, 2023-03-21).
  • tbl_sql(check_from) (deprecated in 2.5.0, 2024-03-15).
  • Previously-defunct functions have been removed:
  • group_by(add = ), deprecated in dplyr 1.0.0 (2020-06-01) (#1632).
  • partial_eval(var), deprecated in 2.2.0 (2022-06-05) (#1632).
  • src_sql(), deprecated in 1.4.0 (2019-04-23) (#1632).
  • win_rank_tdata(), deprecated in 2.4.0 (2023-10-25) (#1642). (This is earlier than our usual policy because it was only used by the Teradata backend.)
  • Internal testing functions have been removed: src_test(), test_frame(), test_load(), test_register_src(), and test_register_con() (#1712).
  • build_sql(), sql_expr(), and sql_call2() are superseded in favour of sql_glue() and sql_glue2() (#1249).
  • sql_options() is no longer marked experimental.

New features

New backends

  • ADBC (via {adbi}, #1787) and JDBC (via {RJDBC}, #1359) connections are supported. Both use the connection name/class to dispatch to SQL dialects for existing backends. This is made possible by sql_dialect(), a new generic that allows connections to choose a SQL dialect (#1624). If the default dialect is incorrect, you can override it with with_dialect() (#1784).
  • IBM DB2 (@shearerpmm, #1800). Includes translations for paste()/paste0() (using ||), DB2-specific casts, runif(), string functions, date functions, clock helpers, statistical aggregates, and more.

New verb support

  • bind_queries() makes it easy to combine multiple lazy queries using UNION ALL (#1342). It's the dbplyr equivalent of dplyr::bind_rows().
  • filter_out(), from dplyr 1.2.0, is now translated. The combined condition is wrapped in is_distinct_from(., TRUE), producing backend-appropriate SQL such as IS DISTINCT FROM TRUE on PostgreSQL or IS NOT TRUE on SQLite, so rows where the condition is NA are kept (#1803).
  • mutate() gains .order and .frame arguments for specifying window function ordering and frame bounds within a single mutate call, similar to how .by works for grouping (#1542).

New function translations

  • anyNA() is translated to SQL in the same way as any(is.na(x)) (#1814).
  • as(x, "type") is translated to CAST(x AS type), allowing you to cast to arbitrary database types not covered by the standard as.*() functions (#1729).
  • is_distinct_from() and is_not_distinct_from() expose IS DISTINCT FROM / IS NOT DISTINCT FROM semantics with backend-specific dialects (#1803).
  • %notin% (introduced in R 4.6.0) is translated to NOT IN (#1820).

Other new helpers

  • last_sql() retrieves the most recent SQL query generated by dbplyr, which is useful for debugging (#1471).
  • The copy argument of join, set, and row operations accepts "inline" to use copy_inline() instead of copying to a temporary table (#863).

Extensions

The following changes and new capabilities are of interest to dbplyr backend developers:

  • db_supports_table_alias_with_as() and supports_window_clause() generics have been removed. They were not used by any packages and are now part of the new_sql_dialect() data structure (#1760).
  • db_table_drop_if_exists() is a new generic that allows backends to customize how tables are dropped when overwrite = TRUE (#1695). This was added to support Oracle.
  • db_table_temporary() has been renamed to sql_table_temporary() for consistency with other SQL generation functions (#1760).
  • dialect_*() translations use (approximately) correct quoting for all backends, so the generated SQL looks more like what you'll actually get when connected to a real database (#1464).
  • remote_table() returns an sql() object containing the (correctly quoted) table identifier, rather than the internal dbplyr_table_path. This makes the result suitable for inlining into build_sql() and sql_glue2() (#1807).
  • New sql_dialect() generic allows database connections to choose a SQL dialect, using new_sql_dialect() to create a sql_dialect class. new_sql_dialect() allows you to customize SQL generation including how identifiers are quoted (#1624).
  • set_op_query() no longer has an all argument.
  • sql_check_na_rm() is exported for use in other backends (#1483).
  • sql_escape_string() defaults to using ' (#1701).
  • sql_glue() and sql_glue2() are exported and provide a convenient syntax for building SQL strings; sql_glue2() adds support for type markers (#1249).
  • sql_infix() no longer has a con argument; the connection needs to be determined at call time, not at definition time.
  • sql_optimise() is no longer used. It was only used for two cases (filter + summarise and arrange + summarise), and these are handled at a higher level (#1720). It will be removed in a future version.
  • New sql_set_op_method() generic allows set operations (union(), intersect(), setdiff()) to customize the SQL keyword, e.g. using UNION DISTINCT instead of UNION for databases that require it, or MINUS instead of EXCEPT for Oracle (#1596).

SQL translation improvements

  • Single-table SELECT queries use unqualified * (e.g. SELECT *) instead of table-qualified * (e.g. SELECT "df".*) for most backends. Oracle and Teradata continue to use qualified stars as required by their syntax (#1577, #1485).
  • .sql pronoun makes it a little easier to use known SQL functions in packages, requiring only @importFrom dbplyr .sql (#1117). Now you can write db |> mutate(.sql$custom_sql_function(x, y, z)) and only need to import one function (.sql) to quiet all R CMD check notes.
  • Custom translations of functions starting with . work (@MichaelChirico, #1529).
  • pi is no longer translated to PI(). This caused problems if you had a column called pi (#1531).
  • arrange() is applied consecutively, matching dplyr's behavior, e.g. arrange(y) |> arrange(x) is equivalent to arrange(x, y). Empty arrange() preserves existing ordering instead of clearing it (#789).
  • .data$col, .data[[col]], .env$var, and .env$[[var]] work correctly inside across() (#1520).
  • distinct() after a join no longer creates a subquery (#722).
  • distinct() with computed columns ignores grouping, matching dplyr's behavior (#1081).
  • filter() after left_join() or inner_join() no longer creates a subquery (#722).
  • filter() followed by a summarise() is once again inlined correctly (#1707).
  • filter() after rename() no longer rewrites field names of $ and @ expressions, so e.g. filter(z == ltr$z) after rename(z = x) looks up ltr$z, not ltr$x (#1812).
  • if_else() uses a simpler translation for the missing argument (#1573).
  • join_by(between()) correctly handles column renames (#1572).
  • n_distinct() gains an na.rm argument, which warns whenever it's not TRUE (#1579).
  • na_matches = "na" works correctly with inequality and overlap joins, preserving the comparison operator instead of converting to equality (#1505).
  • semi_join() and anti_join() once again work with filtered windowed values (#1534, #1606).
  • slice_*() handles missing values in line with the documentation, i.e. they are always removed (#1599).
  • str_flatten() gains an na.rm argument, which warns whenever it's not TRUE (#1540).
  • str_like() uses case-sensitive LIKE when ignore_case is set to FALSE (@edward-burn, #1488).
  • window_order() works with dplyr::desc() (not just desc()) (#1486).
  • Backend-specific improvements:
  • MS Access: correctly generates SQL for multiple joins by adding required parentheses (#1576).
  • MySQL: gains slightly better translation for as.integer() and as.integer64() (#1647).
  • Oracle: temporary tables use private temporary tables (Oracle 18c+) instead of global temporary tables. This ensures data persists correctly and table names are automatically prefixed with ORA$PTT_ (#750).
  • PostgreSQL: improved translation for seconds(), minutes(), hours(), days(), weeks(), months(), and years().
  • Postgres, Redshift, Snowflake, and Spark: new translations for str_ilike() (@edward-burn, #1628).
  • Redshift: dbplyr_uncount() works (@owenjonesuob, #1601); corrected error message for quantile() and median() in mutate() (@edward-burn, #1571); fixed syntax error in date_build() translation (#1512).
  • Snowflake: correctly translates $ to : (@jsowder, #1608); fixed translations that were being reported as unknown (@edward-burn, #1570).
  • SQL Server: between() uses CASE WHEN instead of IIF() for compatibility with Azure Synapse (@rehbbea, #1773); if_else() uses CASE WHEN instead of IIF so NULL handling matches R's NA handling (#1569); slice_sample() returns different results each run (@thomashulst, #1503); str_like() and str_ilike() behave consistently (@edward-burn, #1669); on version 17.0 (2025) the stringr regex functions str_detect(), str_starts(), str_ends(), str_replace(), str_replace_all(), str_remove(), str_remove_all(), str_extract(), and str_count() are translated, and fixed-pattern versions of str_detect(), str_starts(), and str_ends() work on all versions (#1671); uses DATEDIFF_BIG instead of DATEDIFF so tally() and count() work regardless of data size (@edward-burn, #1666); filter() correctly casts logical columns to BIT when the filtered table is the right-hand side of a join (#1839).
  • Snowflake: correctly translates $ to : (@jsowder, #1608); fixed translations that were being reported as unknown (@edward-burn, #1570); pmin() and pmax() with na.rm = TRUE use LEAST_IGNORE_NULLS() and GREATEST_IGNORE_NULLS() instead of a bespoke workaround (@mnelsonr, #1850).
  • SQL Server: between() uses CASE WHEN instead of IIF() for compatibility with Azure Synapse (@rehbbea, #1773); if_else() uses CASE WHEN instead of IIF so NULL handling matches R's NA handling (#1569); slice_sample() returns different results each run (@thomashulst, #1503); str_like() and str_ilike() behave consistently (@edward-burn, #1669); on version 17.0 (2025) the stringr regex functions str_detect(), str_starts(), str_ends(), str_replace(), str_replace_all(), str_remove(), str_remove_all(), str_extract(), and str_count() are translated, and fixed-pattern versions of str_detect(), str_starts(), and str_ends() work on all versions (#1671); uses DATEDIFF_BIG instead of DATEDIFF so tally() and count() work regardless of data size (@edward-burn, #1666).

Minor improvements and bug fixes

  • CTEs correctly quote table names when the same query is used multiple times (#1559).
  • dbplyr uses the base pipe in all examples (#1626).
  • The print method no longer mentions the "source", because that is an outdated dplyr concept (#897).
  • All set operations (#1585) and cross_join() (#1792) error if you pass extra arguments (instead of silently ignoring them or giving a confusing error).
  • collapse(), collect(), and compute() have their own documentation pages (#1637).
  • copy_inline() works with blob columns (#1515).
  • copy_to() works when the source is in the same database as the destination and overwrite = TRUE (@liudvikasakelis, #1535).
  • db_col_types() gains a SQLite method so that rows_*() operations can preserve column types when copying data (#1821).
  • expand() errors when column expressions don't reference any columns in the data, instead of generating invalid SQL (#720).
  • fill() errors if you attempt to rename a column, for consistency with dplyr (#1536).
  • if_else() and ifelse() give a clear error if true/false or yes/no are missing (#1798).
  • pivot_wider() accepts anonymous functions (e.g. \(x) max(x, na.rm = TRUE)) in values_fn, not just purrr-style lambdas (#1816).
  • pull() correctly handles a NULL quosure passed to name (#1808).
  • show_query() gains a use_colour argument (#1590).
  • summarise() reports grouping immediately, rather than when the SQL is generated (#1721).

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 5.8 min · r-devel-linux-x86_64-debian-clang
Status changes
  • OK13 OK2026-10-17
  • WARNING12 OK, 1 WARNING2026-10-01
  • OK13 OK2026-08-05
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK13 OK2026-07-21
Show 9 earlier changesHide 9 earlier changes
  • ERROR12 OK, 1 ERROR2026-07-18
  • OK13 OK2026-06-27
  • ERROR12 OK, 1 ERROR2026-06-24
  • OK13 OK2026-06-09
  • ERROR12 OK, 1 ERROR2026-06-08
  • OK13 OK2026-05-05
  • ERROR12 OK, 1 ERROR2026-05-04
  • OK12 OK2026-04-25
  • ERROR12 OK, 2 ERROR2026-03-10
Advisories

none known

Documentation

In release 2.6.0
READMEYes · 231 wordsVignettesYes · 5 · dynamicNEWSYes · 67% structured · mentions 2.6.0Citation fileNoWebsiteYes · pkgdown
Help pages
93 (26 internal)includes a package overview page
Examples that run
96%66 run in a plain check (6 of them under a condition) · 1 only when donttest examples are enabled (R CMD check --as-cran) · 2 hold no code
Exported functions with examples
69%
Documented parameters
65%
Return-value docs
22%
Help pages citing references
0%

Downloads

6.5M
CRAN downloads in the past year
Rank #138 · ~17.9K/day · ~544.8K/mo
Daily download trend is not available in this view yet.
427.2K30 days
1.3M90 days
6.5M1 year
Compare downloads with other packages →
Also on143.1K r2u134 autocran1.3M conda_forge18K c2d4u

Repository

518Stars
195Forks
26Open issues
9Open PRs
25Releases
4,121Commits
167Commit identities
rdatabase
4,121 commits · Last activity 2026-06-17 · +0.2% stars, 30d · Default branch at 2.6.0.9000, ahead of CRAN 2.6.0 (checked 2026-10-18)
Responsiveness
How these are sampled
PRs merged (all time)
86%
Median days to close, 50 most recently updated closed issues
37
Median days to close, 50 most recently updated closed PRs
1

Stars over time

2025-10-09 · 4832026-10-01 · 518
PracticesBeta

20 development-tooling and community-health practices detected across 8 families in the upstream repository

Checks run against github.com/tidyverse/dbplyr on 2026-10-18.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel

Governance and community (5)
Code of conductContributing guideIssue templatesCODEOWNERSSupport guide
Docs source (4)
README.Rmdpkgdown

GitHub Pages site last deployed 2026-06-17 · The repository has a site deploy workflow

pkgdown site last built 2026-06-17

Coverage (2)
Coverage reporting (Codecov).covrignore
Show all practicesHide 4 practices
Reproducibility and dev environment (1)
Dev Container
CRAN release process (2)
cran-comments.mdrevdep/
Lint, format, editor (3)
AirVS CodeRStudio project
Git structural (1)
.gitattributes
How this is detected·Detection ruleset v3 (2026-09-26)
AI coding toolsBeta

This repository shows signs of AI coding tools.

  • Claude Codefirst seen 2025-11-28
    Seen in the repository: .claude, .claude/skills
    Named in .Rbuildignore: .claude
    Commits: at least 2 crediting it in the message
Shared conventions any agent may read, so they name no particular tool.
Seen in the repository: AGENTS.md
Models named in its commits
  • Claude Opus 4.51 commit · Jan 2026
  • Claude Opus 4.71 commit · May 2026
Counts are commits, not lines of code. Commits by a tool's accounts count once across all of its accounts. Commits crediting it are the largest count among its credit lines, a minimum.How this is detected·Detection ruleset v4 (updated 2026-09-27)

Dependencies

Declared dependencies
32 external dependencies (excludes base and recommended)

Installing dbplyr adds 22 packages (12 with compiled code, 18 MB of source tarballs). Heaviest: stringi 11 MB, vctrs 1.0 MB, dplyr 902 KB.

Depends (1)
R >= 4.1
LinkingTo (0)
none
Enhances (0)
none

People & History

People (4)
Author, Maintainer since 1.0.0 (2017)
Author · added in 2.1.0
Author · added in 1.2.0
Copyright holder, Funder · added in 2.5.0
Listed in earlier versions (1)
RStudio
no longer listed · 1.0.0 to 2.4.0
Releases (26)

Pick two releases to compare their code metrics.

  • 2.6.0Latest
    record
    2026-06-17 · current release · diff ↗ ·
    removed 11 exports
    %>%, db_supports_table_alias_with_as, db_table_temporary, join_query, src_test, supports_window_clause, test_frame, test_load, test_register_con, test_register_src, win_rank_tdata
    added 34 exports
    .sql, bind_queries, db_table_drop_if_exists, dialect_access, dialect_ansi, dialect_db2, dialect_hana, dialect_hive, dialect_impala, dialect_mariadb, dialect_mssql, dialect_mysql, dialect_odbc, dialect_oracle, dialect_postgres, dialect_redshift, dialect_snowflake, dialect_spark_sql, dialect_sqlite, dialect_teradata, last_sql, local_memdb_frame, memdb, new_sql_dialect, rf_join_query, sql_check_na_rm, sql_dialect, sql_escape_ident, sql_escape_string, sql_glue and 4 more
  • R
    R 4.6.0 released · 2026-04-24
  • 2.5.2
    record
    2026-02-13 · diff ↗
  • 2.5.1
    record
    2025-09-10 · diff ↗
  • R
    R 4.5.0 released · 2025-04-11
  • R
    R 4.4.0 released · 2024-04-24
  • 2.5.0
    record
    2024-03-19 · diff ↗ ·
    added 6 exports
    as_table_path, check_table_path, is_table_path, simulate_mariadb, table_path_components, table_path_name
  • 2.4.0
    record
    2023-10-26 · diff ↗ ·
    removed 3 exports
    simulate_vars, simulate_vars_is_typed, supports_star_without_alias
    added 11 exports
    db_col_types, db_supports_table_alias_with_as, dbplyr_pivot_wider_spec, lazy_rf_join_query, lazy_union_query, remote_table, simulate_spark_sql, sql_options, sql_query_union, sql_runif, union_query
  • 2.3.4
    record
    2023-09-27 · diff ↗
  • 2.3.3
    record
    2023-07-07 · diff ↗
  • R
    R 4.3.0 released · 2023-04-21
  • 2.3.2
    record
    2023-03-21 · diff ↗
  • 2.3.1
    record
    2023-02-24 · diff ↗
  • 2.3.0
    record
    2023-01-16 · diff ↗ ·
    removed 1 export
    lazy_join_query
    added 3 exports
    lazy_multi_join_query, sql_query_multi_join, win_rank_tdata
  • 2.2.1
    record
    2022-06-27 · diff ↗ ·
    added 1 export
    supports_star_without_alias
  • 2.2.0
    record
    2022-06-05 · diff ↗ ·
    removed 4 exports
    add_op_single, op_base, op_double, op_single
    added 21 exports
    copy_inline, get_returned_rows, has_returned_rows, in_catalog, lazy_base_query, lazy_join_query, lazy_query, lazy_select_query, lazy_semi_join_query, lazy_set_op_query, simulate_vars, simulate_vars_is_typed, sql_indent_subquery, sql_query_append, sql_query_delete, sql_query_insert, sql_query_update_from, sql_query_upsert, sql_random, sql_returning_cols, supports_window_clause
Show 20 earlier eventsHide 20 earlier events
  • R
    R 4.2.0 released · 2022-04-22
  • R
    R 4.1.0 released · 2021-05-18
  • 2.1.1
    record
    2021-04-06 · diff ↗ ·
    added 1 export
    simulate_snowflake
  • 2.1.0
    record
    2021-02-03 · diff ↗ ·
    added 1 export
    dbplyr_uncount
  • 2.0.0
    record
    2020-11-03 · diff ↗ ·
    added 21 exports
    db_connection_describe, db_table_temporary, dbplyr_edition, simulate_hana, simulate_redshift, sql_aggregate_n, sql_expr_matches, sql_join_suffix, sql_query_explain, sql_query_fields, sql_query_join, sql_query_rows, sql_query_save, sql_query_select, sql_query_semi_join, sql_query_set_op, sql_query_wrap, sql_table_analyze, sql_table_index, sql_translation, sql_try_cast
  • 1.4.4
    record
    2020-05-27 · diff ↗ ·
    added 2 exports
    %>%, sql_escape_raw
  • R
    R 4.0.0 released · 2020-04-24
  • 1.4.3
    record
    2020-04-19 · diff ↗ ·
    removed 1 export
    lahman_df
    added 2 exports
    sql_escape_date, sql_escape_datetime
  • 1.4.2
    record
    2019-06-17 · diff ↗
  • 1.4.1
    record
    2019-06-06 · diff ↗
  • R
    R 3.6.0 released · 2019-04-26
  • 1.4.0
    record
    2019-04-24 · diff ↗ ·
    removed 2 exports
    simulate_odbc_access, simulate_odbc_postgresql
    added 6 exports
    escape_ansi, simulate_access, sql_call2, sql_str_sub, sql_substr, tbl_memdb
  • 1.3.0
    record
    2019-01-09 · diff ↗
  • 1.2.2
    record
    2018-07-25 · diff ↗
  • R
    R 3.5.0 released · 2018-04-23
  • 1.2.1
    record
    2018-02-19 · diff ↗
  • 1.2.0
    record
    2018-01-03 · diff ↗ ·
    added 17 exports
    remote_con, remote_name, remote_query, remote_query_plan, remote_src, simulate_odbc_access, simulate_teradata, sql_aggregate, sql_aggregate_2, sql_cot, sql_expr, sql_log, sql_paste, sql_paste_infix, src_test, win_aggregate, win_aggregate_2
  • 1.1.0
    record
    2017-06-27 · diff ↗ ·
    added 7 exports
    op_frame, simulate_hive, simulate_odbc_postgresql, simulate_oracle, win_current_frame, window_frame, window_order
  • 1.0.0
    record
    2017-06-09
  • R
    R 3.4.0 released · 2017-04-21

Package metadata

First published
2017-06-09
Total releases
26 / 9 yrs
License
MIT + file LICENSE OSI
Minimum R
≥ 4.1
Download size
598 KB

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("dbplyr")
Wickham, H., Posit Software, PBC, Girlich, M., & Ruiz, E. (2026). dbplyr: A 'dplyr' Back End for Databases (Version 2.6.0) [Computer software]. https://doi.org/10.32614/CRAN.package.dbplyr

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.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for dbplyr version 2.6.0 [Data set]. HJJB, LLC. Data release v2026-10-22. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-22, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy