R/dbRemoveTable_MariaDBConnection_character.R

Defines functions dbRemoveTable_MariaDBConnection_character

Documented in dbRemoveTable_MariaDBConnection_character

#' @rdname mariadb-tables
#' @param fail_if_missing If `FALSE`, `dbRemoveTable()` succeeds if the
#'   table doesn't exist.
#' @usage NULL
dbRemoveTable_MariaDBConnection_character <- function(conn, name, ..., temporary = FALSE, fail_if_missing = TRUE) {
  extra <- list(...)

  name <- dbQuoteIdentifier(conn, name)
  dbExecute(
    conn,
    paste0(
      "DROP ",
      if (temporary) "TEMPORARY ",
      "TABLE ",
      if (!fail_if_missing) "IF EXISTS ",
      name
    )
  )
  invisible(TRUE)
}

#' @rdname mariadb-tables
#' @export
setMethod("dbRemoveTable", c("MariaDBConnection", "character"), dbRemoveTable_MariaDBConnection_character)

Try the RMariaDB package in your browser

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

RMariaDB documentation built on Dec. 20, 2021, 9:06 a.m.