Skip to content

Trying to dbAppendTable with an empty data frame throws "Error: Cannot pass NA to dbQuoteIdentifier()" #313

@Kodiologist

Description

@Kodiologist

What I would've expected is for such a call to silently do nothing. Then, when the value argument to dbAppendTable is an expression yielding a data frame of 0 or more rows (and in the case of 0 rows, 0 columns as well), everything works as expected when 0 rows are produced. Even if you don't want to allow this, improving the error message is probably wise.

library(DBI)
db = dbConnect(RSQLite::SQLite(), ":memory:")
dbExecute(db, "create table T(n  integer primary key)")
dbAppendTable(db, "T", data.frame())

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions