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())
What I would've expected is for such a call to silently do nothing. Then, when the
valueargument todbAppendTableis 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.