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.
- Host: GitHub
- URL: https://github.com/mentoldo/rsqlauthandle
- Owner: mentoldo
- License: other
- Created: 2021-12-08T17:32:29.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-12-10T23:47:13.000Z (over 3 years ago)
- Last Synced: 2024-08-13T07:12:51.457Z (8 months ago)
- Language: R
- Size: 16.6 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - mentoldo/rsqlauthandle - Easy manage authentication on SQL DB. (R)
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")
```