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.
You can install the released version of shinyPostgreSQL from GitHub with:
# install.packages("devtools")
devtools::install_github("thewileylab/shinyPostgreSQL")
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)
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.