R/dbIsValid__duckdb_connection.R

Defines functions dbIsValid__duckdb_connection

Documented in dbIsValid__duckdb_connection

#' @rdname duckdb_connection-class
#' @inheritParams DBI::dbIsValid
#' @usage NULL
dbIsValid__duckdb_connection <- function(dbObj, ...) {
  valid <- FALSE
  tryCatch(
    {
      dbGetQuery(dbObj, SQL("SELECT 1"))
      valid <- TRUE
    },
    error = function(c) {
    }
  )
  valid
}

#' @rdname duckdb_connection-class
#' @export
setMethod("dbIsValid", "duckdb_connection", dbIsValid__duckdb_connection)

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.