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

https://github.com/mentoldo/rsqlauthandle

Easy manage authentication on SQL DB.
https://github.com/mentoldo/rsqlauthandle

Last synced: 4 months ago
JSON representation

Easy manage authentication on SQL DB.

Awesome Lists containing this project

README

        

---
output: github_document
---

```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```

# rsqlauthandle

The goal of rsqlauthandle is to handle in a simple and secure way your sql db servers authentications.

## Installation

You can install the development version of rsqlauthandle like so:

``` r
devtools::install_github('mentoldo/rsqlauthandle')
```

## Example

To use rsqlauthandle in a project:

```{r set_credentials, eval=FALSE}
library(rsqlauthandle)

set_credentials(alias = 'postgres_db',
dialect = 'postgresql',
host = 'localhost',
port = '5432',
user = 'user',
db_name = 'customers')
```

It sets the credential for a DB conection. Then, we can use it with:

```{r connect, eval=FALSE}
con <- connect_postgres(alias='rsqlauthandle')
```
`con` is a DBIConnection object that we can use to list tables, get a table or query it.

```{r read_tables, eval=FALSE}
dbListTables(con)
dbReadTable(con, 'accounts')
dbReadTable(con, "SELECT * FROM accounts")
```