R/dbExistsTable_SQLiteConnection_character.R

Defines functions dbExistsTable_SQLiteConnection_character

Documented in dbExistsTable_SQLiteConnection_character

#' @rdname SQLiteConnection-class
#' @usage NULL
dbExistsTable_SQLiteConnection_character <- function(conn, name, ...) {
  stopifnot(length(name) == 1L)
  rs <- sqliteListTablesWithName(conn, name)
  on.exit(dbClearResult(rs), add = TRUE)

  nrow(dbFetch(rs, 1L)) > 0
}
#' @rdname SQLiteConnection-class
#' @export
setMethod("dbExistsTable", c("SQLiteConnection", "character"), dbExistsTable_SQLiteConnection_character)

Try the RSQLite package in your browser

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

RSQLite documentation built on May 29, 2024, 3:30 a.m.