{"id":13776130,"url":"https://github.com/tidyverse/dbplyr","last_synced_at":"2025-05-13T19:04:17.667Z","repository":{"id":37465649,"uuid":"86504302","full_name":"tidyverse/dbplyr","owner":"tidyverse","description":"Database (DBI) backend for dplyr","archived":false,"fork":false,"pushed_at":"2025-04-25T21:12:31.000Z","size":21426,"stargazers_count":483,"open_issues_count":134,"forks_count":181,"subscribers_count":22,"default_branch":"main","last_synced_at":"2025-05-10T11:52:29.763Z","etag":null,"topics":["database","r"],"latest_commit_sha":null,"homepage":"https://dbplyr.tidyverse.org","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tidyverse.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":".github/SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-03-28T20:29:16.000Z","updated_at":"2025-04-28T19:22:03.000Z","dependencies_parsed_at":"2022-07-12T14:50:37.433Z","dependency_job_id":"233f584d-4b09-47ff-8676-e193e0e55344","html_url":"https://github.com/tidyverse/dbplyr","commit_stats":{"total_commits":3522,"total_committers":155,"mean_commits":22.72258064516129,"dds":"0.44605337876206697","last_synced_commit":"572693098d0098018b6bb2d1e88b650d2e1e1580"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidyverse%2Fdbplyr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidyverse%2Fdbplyr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidyverse%2Fdbplyr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tidyverse%2Fdbplyr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tidyverse","download_url":"https://codeload.github.com/tidyverse/dbplyr/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254010798,"owners_count":21998993,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","r"],"created_at":"2024-08-03T18:00:17.162Z","updated_at":"2025-05-13T19:04:17.613Z","avatar_url":"https://github.com/tidyverse.png","language":"R","funding_links":[],"categories":["Table of Contents","R"],"sub_categories":["Data manipulation"],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, echo = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"README-\"\n)\n```\n\n# dbplyr \u003ca href='https://dbplyr.tidyverse.org'\u003e\u003cimg src='man/figures/logo.png' align=\"right\" height=\"139\" /\u003e\u003c/a\u003e\n\n\u003c!-- badges: start --\u003e\n[![CRAN status](https://www.r-pkg.org/badges/version/dbplyr)](https://cran.r-project.org/package=dbplyr)\n[![R-CMD-check](https://github.com/tidyverse/dbplyr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/tidyverse/dbplyr/actions/workflows/R-CMD-check.yaml)\n[![Codecov test coverage](https://codecov.io/gh/tidyverse/dbplyr/branch/main/graph/badge.svg)](https://app.codecov.io/gh/tidyverse/dbplyr?branch=main)\n\u003c!-- badges: end --\u003e\n\n## Overview\n\ndbplyr is the database backend for [dplyr](https://dplyr.tidyverse.org). It allows you to use remote database tables as if they are in-memory data frames by automatically converting dplyr code into SQL. \n\nTo learn more about why you might use dbplyr instead of writing SQL, see `vignette(\"sql\")`. To learn more about the details of the SQL translation, see `vignette(\"translation-verb\")` and `vignette(\"translation-function\")`.\n\n## Installation\n\n```{r, eval = FALSE}\n# The easiest way to get dbplyr is to install the whole tidyverse:\ninstall.packages(\"tidyverse\")\n\n# Alternatively, install just dbplyr:\ninstall.packages(\"dbplyr\")\n\n# Or the development version from GitHub:\n# install.packages(\"pak\")\npak::pak(\"tidyverse/dbplyr\")\n```\n\n## Usage\n\ndbplyr is designed to work with database tables as if they were local data frames. To demonstrate this I'll first create an in-memory SQLite database and copy over a dataset:\n\n```{r setup}\nlibrary(dplyr, warn.conflicts = FALSE)\n\ncon \u003c- DBI::dbConnect(RSQLite::SQLite(), \":memory:\")\ncopy_to(con, mtcars)\n```\n\nNote that you don't actually need to load dbplyr with `library(dbplyr)`; dplyr automatically loads it for you when it sees you working with a database. Database connections are coordinated by the DBI package. Learn more at \u003chttps://dbi.r-dbi.org/\u003e\n\nNow you can retrieve a table using `tbl()` (see `?tbl_dbi` for more details). Printing it just retrieves the first few rows:\n\n```{r}\nmtcars2 \u003c- tbl(con, \"mtcars\")\nmtcars2\n```\n\nAll dplyr calls are evaluated lazily, generating SQL that is only sent to the database when you request the data.\n\n```{r}\n# lazily generates query\nsummary \u003c- mtcars2 %\u003e% \n  group_by(cyl) %\u003e% \n  summarise(mpg = mean(mpg, na.rm = TRUE)) %\u003e% \n  arrange(desc(mpg))\n\n# see query\nsummary %\u003e% show_query()\n\n# execute query and retrieve results\nsummary %\u003e% collect()\n```\n\n## Code of Conduct\n\nPlease note that the dbplyr project is released with a [Contributor Code of Conduct](https://dbplyr.tidyverse.org/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftidyverse%2Fdbplyr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftidyverse%2Fdbplyr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftidyverse%2Fdbplyr/lists"}