I am wondering if there is a way to retrieve the SQL query which dbWriteTable
sends to the DBMS. For example, for the following example. Is there a way to get the query?
library(DBI)
con <- dbConnect(RSQLite::SQLite(), ":memory:")
dbWriteTable(con, "mtcars", mtcars[1:10, ])
dbDisconnect(con)
EDIT: 2016-11-11
As a Postgres user, I would be most interested in the commands sent using RPostegreSQL
. Following @krlmlr, I figured that there is a function postgresqlCopyInDataframe
which itself calls the C function RS_PostgreSQL_CopyInDataframe
. So I hit a dead-end here as C is beyond my skills. Any ideas welcome...