Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/paulhendricks/queryr

Tools for querying SQL databases from R
https://github.com/paulhendricks/queryr

Last synced: 6 days ago
JSON representation

Tools for querying SQL databases from R

Awesome Lists containing this project

README

        

---
output:
md_document:
variant: markdown_github
---

```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```

# queryr

[![Build Status](https://travis-ci.org/paulhendricks/queryr.png?branch=master)](https://travis-ci.org/paulhendricks/queryr)
[![Build status](https://ci.appveyor.com/api/projects/status/78uv9bj95a7a366c/branch/master?svg=true)](https://ci.appveyor.com/project/paulhendricks/queryr/branch/master)
[![codecov.io](http://codecov.io/github/paulhendricks/queryr/coverage.svg?branch=master)](http://codecov.io/github/paulhendricks/queryr?branch=master)
[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/queryr)](http://cran.r-project.org/package=queryr)
[![Downloads from the RStudio CRAN mirror](http://cranlogs.r-pkg.org/badges/queryr)](http://cran.rstudio.com/package=queryr)
[![Project Status: Active - The project has reached a stable, usable state and is being actively developed.](http://www.repostatus.org/badges/0.1.0/active.svg)](http://www.repostatus.org/#active)

`queryr` provides tools to aid in querying SQL databases through R.

## Installation

You can install:

* the latest released version from CRAN with

```R
install.packages("queryr")
````

* the latest development version from github with

```R
if (packageVersion("devtools") < 1.6) {
install.packages("devtools")
}
devtools::install_github("paulhendricks/queryr")
```

If you encounter a clear bug, please file a minimal reproducible example on [github](https://github.com/paulhendricks/queryr/issues).

## API

```{r}
library(dplyr, warn.conflicts = FALSE)
library(queryr)
raw_qry <-
"
SELECT *

FROM SOME_TABLE

WHERE CONDITION

GROUP BY VARIABLES;
"

raw_qry %>% remove_whitespace
raw_qry %>% remove_whitespace %>% remove_semicolon
```