Skip to content

Latest commit

 

History

History
59 lines (41 loc) · 1.37 KB

README.md

File metadata and controls

59 lines (41 loc) · 1.37 KB

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 with:

# install.packages("devtools")
devtools::install_github("thewileylab/shinyPostgreSQL")

Example

To run a demo application:

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.

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. By contributing to this project, you agree to abide by its terms.