A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://datastorm-open.github.io/shinymanager/reference/create_sql_db.html below:

Create credentials SQL database — create_sql_db • shinymanager

Create a SQL (not SQLite but Postgres, MSSQL, MySQL...) database with credentials data using DBI interface.

create_sql_db(credentials_data, config_path)
Arguments
credentials_data

A data.frame with information about users, user and password are required.

config_path

Path to the yaml configuration. You can find a template for Posgres in package system.file("sql_config/pg_template.yml", package = "shinymanager")

Details

The credentials data.frame can have the following columns:

Examples
if (FALSE) {

library(shiny)
library(shinymanager)

#### init the SQL Database
# first edit the .yml configuration file
system.file("sql_config/pg_template.yml", package = "shinymanager")


# Init Credentials data
credentials <- data.frame(
  user = c("shiny", "shinymanager"),
  password = c("azerty", "12345"), # password will automatically be hashed
  stringsAsFactors = FALSE
)

# Create SQL database
create_db_sql(
  credentials_data = credentials,
  config_path = "path/to/your_sql_configuration.yml"
)

### Use in shiny
ui <- fluidPage(
  tags$h2("My secure application"),
  verbatimTextOutput("auth_output")
)

# Wrap your UI with secure_app
ui <- secure_app(ui, choose_language = TRUE)


server <- function(input, output, session) {
 
 # call the server part
 # check_credentials returns a function to authenticate users
 res_auth <- secure_server(
   check_credentials = check_credentials(db = "path/to/your_sql_configuration.yml")
 )
 
 output$auth_output <- renderPrint({
   reactiveValuesToList(res_auth)
 })
 
 observe({
   print(input$shinymanager_where)
   print(input$shinymanager_language)
 })
 
 # your classic server logic
 
}

shinyApp(ui, server)

}


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4