# Non-reactive context example
if (FALSE) {
library(surveydown)
# Assuming you have a database connection called db created using
# sd_database(), you can fetch data with:
data <- sd_get_data(db)
head(data)
# Reactive context example (inside a surveydown app)
server <- function(input, output, session) {
data <- sd_get_data(db, refresh_interval = 10)
output$data_table <- renderTable({
data() # Note the parentheses to retrieve the reactive value
})
}
}
Run the code above in your browser using DataLab