#' @include sqlhelper.r
#' @include persistence_utils.r
copy_graph <- function(from, to, con, ...) {
param_list <- list(...)
commento <- rutils::ifelse("msg" %in% names(param_list),
param_list[["msg"]],
paste0("Rilascio per ", to))
last_updated <- rutils::ifelse("last_updated" %in% names(param_list),
param_list[["last_updated"]],
time_in_nano())
autore <- rutils::ifelse("autore" %in% names(param_list),
param_list[["autore"]],
rutils::whoami())
copy_dati(from, to, con)
copy_archi(from, to, con)
copy_formule(from, to, con)
copy_metadati(from, to, con)
DBI::dbExecute(con, sql_by_key(
"INSERT_GRAFI", tag = to,
commento = commento, autore = autore,
last_updated = time_in_nano(),
.con = con))
}
copy_proxy <- function(stmt_name, from, to, con) {
stmts <- sql_by_key(stmt_name, to = to, from = from,
.con = con, .multiline = TRUE)
for (stmt in stmts) {
DBI::dbExecute(con, stmt)
}
}
copy_dati <- function(from, to, con) {
copy_proxy("COPY_DATI", from, to, con)
}
copy_archi <- function(from, to, con) {
copy_proxy("COPY_ARCHI", from, to, con)
}
copy_formule <- function(from, to, con) {
copy_proxy("COPY_FORMULE", from, to, con)
}
copy_metadati <- function(from, to, con) {
copy_proxy("COPY_METADATI", from, to, con)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.