R/mdl_config.R

Defines functions mdl_config

Documented in mdl_config

#' Moodle Configuration Table
#'
#' Get the complete moodle configuration table.
#' Different from most mdl_* functions this function calls dplyr::collect()
#' before returning (as a config-table is not going to cause memory overflow).
#'
#' @param con database connection object
#' @param tbl_prefix table prefix
#'
#' @return A tibble
#' @export
mdl_config <- function(
  con = mdl_get_connection(),
  tbl_prefix = "mdl_" ) {
  if(!attr(con, "use_cache")){ #direct connection
    ret <-  tbl(con, glue("{tbl_prefix}config")) %>%
      collect()
  } else {

  ret <- tbl(con, "mdl_config") %>%
    collect()
  }
  class(ret) <- c("mdl_config", class(ret))
  ret
}

Try the moodleR package in your browser

Any scripts or data that you put into this service are public.

moodleR documentation built on Aug. 15, 2022, 5:09 p.m.