#' Function for opening and closing connection
#' @importFrom RSQLite SQLite
#' @import DBI
#' @import future
#' @import promises
#' @export
openCloseConnection = function() {
function(FUN){
con <- dbConnect(RSQLite::SQLite(), "db/vessels.db")
result = FUN(con)
future(dbDisconnect(con))
return(result)
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.