R/dbRemoveTable__duckdb_connection_character.R

Defines functions dbRemoveTable__duckdb_connection_character

Documented in dbRemoveTable__duckdb_connection_character

#' @rdname duckdb_connection-class
#' @inheritParams DBI::dbRemoveTable
#' @usage NULL
dbRemoveTable__duckdb_connection_character <- function(conn, name, ..., fail_if_missing = TRUE) {
  sql <- paste0("DROP TABLE ", if (!fail_if_missing) "IF EXISTS ", "?")
  dbExecute(
    conn,
    sqlInterpolate(conn, sql, dbQuoteIdentifier(conn, name))
  )
  rs_on_connection_updated(conn, "Table removed")
  invisible(TRUE)
}

#' @rdname duckdb_connection-class
#' @export
setMethod("dbRemoveTable", c("duckdb_connection", "character"), dbRemoveTable__duckdb_connection_character)

Try the duckdb package in your browser

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

duckdb documentation built on Oct. 30, 2024, 5:06 p.m.