When a data frame includes a column name "sep", any library that relies on the method "sqlAppendTable" (DBI/R/table-insert.R) will throw an error.
Reprex (with RSQLite package):
library(RSQLite)
a <- data.frame(sep = c(1,2,3))
con <- dbConnect(SQLite())
dbWriteTable(con, "a", a)
#> Error in (function (..., sep = " ", collapse = NULL) : formal argument "sep" matched by multiple actual arguments
Created on 2020-04-02 by the reprex package (v0.3.0)
The problem is here. One solution would be:
rows <- do.call(paste, c(unname(sql_values), sep = ", "))