R | dbplyr package (dplyr database frontend)
DBI [1] provides a way for R to interface with database backends by sending queries in the form of strings. However, this requires the user to use the query language of the backend (usually SQL). If you would prefer to use R-style data wrangling, dbplyr
[2] provides a way to use many of the dplyr
verbs on database connections returned by DBI, and treat them as if they were local tables.
Note that behind the scenes, dbplyr
translates the verbs in the R code into a query string and sends it through DBI, which means that there are some usages of dplyr
verbs that have no correspondence in the query language and thus are impossible to translate, or require some workarounds from normal dplyr
grammar [3]. It is likely that you will still need to send some queries through DBI directly.
Resources: