R/dbCreateTableArrow_DBIConnection.R

Defines functions dbCreateTableArrow_DBIConnection

Documented in dbCreateTableArrow_DBIConnection

#' @rdname hidden_aliases
#' @usage NULL
dbCreateTableArrow_DBIConnection <- function(conn, name, value, ..., temporary = FALSE) {
  require_arrow()

  # https://github.com/apache/arrow-nanoarrow/issues/347
  if (!inherits(value, "nanoarrow_schema")) {
    value <- nanoarrow::infer_nanoarrow_schema(value)
  }

  ptype <- nanoarrow::infer_nanoarrow_ptype(value)
  dbCreateTable(conn, name, ptype, ..., temporary = temporary)
}

#' @rdname hidden_aliases
#' @export
setMethod("dbCreateTableArrow", signature("DBIConnection"), dbCreateTableArrow_DBIConnection)

Try the DBI package in your browser

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

DBI documentation built on June 22, 2024, 9:41 a.m.