https://github.com/thewileylab/shinyPostgreSQL
A shiny module to authenticate your R Shiny Application with a PostgreSQL Database.
https://github.com/thewileylab/shinyPostgreSQL
r shiny
Last synced: 5 months ago
JSON representation
A shiny module to authenticate your R Shiny Application with a PostgreSQL Database.
- Host: GitHub
- URL: https://github.com/thewileylab/shinyPostgreSQL
- Owner: thewileylab
- License: other
- Created: 2020-08-26T04:09:00.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-02-14T16:30:19.000Z (about 2 years ago)
- Last Synced: 2024-08-13T07:13:35.938Z (8 months ago)
- Topics: r, shiny
- Language: R
- Homepage: https://shinyPostgreSQL.thewileylab.org
- Size: 220 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- jimsghstars - thewileylab/shinyPostgreSQL - A shiny module to authenticate your R Shiny Application with a PostgreSQL Database. (R)
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```# shinyPostgreSQL
The goal of shinyPostgreSQL is to allow a Shiny application to authenticate with a PostgreSQL database by prompting a user for appropriate credentials and forming a DBI connection object.
## Installation
You can install the released version of shinyPostgreSQL from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("thewileylab/shinyPostgreSQL")
```## Example
To run a demo application:
```{r demo, eval=F}
shinyPostgreSQL::run_app()
```## Usage
To integrate shinyPostgreSQL with your Shiny application place `postgresql_setup_ui()` and `postgresql_setup_server()` functions into your applications ui and server functions respectively.
```{r example, eval=F}
library(shiny)
library(shinyPostgreSQL)
ui <- fluidPage(
tags$h2('Connect to Database UI'),
postgresql_setup_ui(id = 'setup-namespace')
)server <- function(input, output, session) {
postgresql_setup_vars <- postgresql_setup_server(id = 'setup-namespace')
}if (interactive())
shinyApp(ui = ui, server = server)
```## Code of Conduct
Please note that the shinyPostgreSQL project is released with a [Contributor Code of Conduct](https://contributor-covenant.org/version/2/0/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.