Hi. I deployed a shiny app on shinyapps.io to test the database connection.
The app had been successfully published and works properly.
however, when i insert a record into the dadabase, the app doesn't update, unless I click the "restart" button in the app management page.
the database is sql server in azure. I used the flexdashboard Rmd file to build the dashboard.
the db connect code like below:
library(flexdashboard)
library(RODBC)
is_local<-Sys.getenv('SHINY_PORT')==""
dbConnector <- function(local=FALSE){
if(local){dbConn <- odbcDriverConnect("Driver=ODBC Driver 13 for SQL Server;Server=;Database=;Uid=;Pwd=;Encrypt=yes;TrustServerCertificate=no;Connection Timeout=30")
} else {dbConn <- odbcDriverConnect("Driver=FreeTDS;TDS_Version=8.0;Server=; Port=1433;Database=;Uid=;Pwd=;Encrypt=yes;TrustServerCertificate=no;Connection Timeout=30")}
}
dbConn <- dbConnector(is_local)