-
Notifications
You must be signed in to change notification settings - Fork 74
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
Should DBI::dbWriteTable
support overloading value
argument to support a SQL
query
#488
Comments
Thanks. This is a tight balance -- how much SQL generation should DBI support. I see how it would be useful to have this "just work", at the same time, I don't want to take too much responsibility regarding SQL generation. The specific cases where |
The The dbplyr message seems to originate here: https://github.com/tidyverse/dbplyr/pull/1379/files#diff-f099d8ec45544adf5c40196344d55c458564434dbaa5d7ad090510f33d5cf63bR115 . @hadley: do you remember why you added the early exit for |
@krlmlr I think that original hack was due to a misunderstanding. I wouldn't replicate it. |
@hadley: Thanks. Does this mean that you'd accept a PR that fixes |
Yes. |
This is one of my typical workflow:
con (say odbc) --> tbl --> some_dplyr_ops --> save (as a table)
. Note that data does NOT come into the R's memory. But the code does look clumpsy:This could be (intuitively) replaced by:
Right now,
value
is understood to be adata.frame
in R session's memory. In some cases, some database backends allowvalue
to be a filename too.Q1. Would overloading
DBI::dbWriteTable
to cover this case add value without breaking the semantics?Q2. Having a new generic say
DBI::dbWriteQuery
make sense?PS:
dbplyr::compute
does this job is most cases. In practice, it has hit roadblocks like "only temporary tables are supported" (based on DB backend) whereas rawDBI::dbExecute
gets the job done.value = <sql>
should be atDBI
level, notdbplyr
.The text was updated successfully, but these errors were encountered: