Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

db_copy_to.DBIConnection needs to pass forward arguments #1237

Closed
halpo opened this issue Apr 5, 2023 · 1 comment · Fixed by #1253
Closed

db_copy_to.DBIConnection needs to pass forward arguments #1237

halpo opened this issue Apr 5, 2023 · 1 comment · Fixed by #1253

Comments

@halpo
Copy link

halpo commented Apr 5, 2023

the method db_copy_to.DBIConnection does not appropriately pass forward extra arguments as it should. This causes problems such as passing extra arguments such as append. I do not have a reprex as that would require a working database connection, but here is the result that I received with a working database.

copy_to(db, DX_mapping, name= "DX_mapping", temporary=FALSE, overwrite=FALSE, append=TRUE)

which results in the error

Error in `db_copy_to()`
! Can't copy to table "\"DX_mapping\""
Caused by error in `dplyr::db_write_table()`:
! Can't write table "\"DX_mapping\"".
Caused by error:
! Table "DX_mapping" exists in database, and both overwrite and append are FALSE.
Backtrace:
 1.  dplyr::copy_to(...)
 2.  dplyr:::copy_to.DBIConnection(...)
 4.  dbplyr:::copy_to.src_sql(...)
 6.  dbplyr:::db_copy_to.DBIConnection(...)
13. dbplyr:::db_write_table.DBIConnection(...)

This is the result of db_copy_to.DBIConnection() not passing ... through to dplyr::db_write_table() in file db-io.R:76-81.

@mgirlich
Copy link
Collaborator

Seems reasonable to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants