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

dbAppendTable(con, Id(...), data) no longer works #253

Closed
renkun-ken opened this issue Dec 22, 2021 · 6 comments · Fixed by #262
Closed

dbAppendTable(con, Id(...), data) no longer works #253

renkun-ken opened this issue Dec 22, 2021 · 6 comments · Fixed by #262
Labels

Comments

@renkun-ken
Copy link
Contributor

Id(schema = "foo", table = "bar") could be used as name argument in a number of functions, as documented at https://github.com/r-dbi/DBI/blob/main/R/Id.R. However, the latest release no longer seems to support Id at all. Whenever I supply a Id(...), the following error occurs, say that it must be a character vector.

Error in dbAppendTable(con, id, data) : 
  is.character(name) is not TRUE

Am I missing something?

@krlmlr krlmlr added the bug label Dec 22, 2021
@krlmlr
Copy link
Member

krlmlr commented Dec 22, 2021

Thanks. This is a bug, we should be calling dbQuoteIdentifier() .

@renkun-ken
Copy link
Contributor Author

Thanks for confirming this. It breaks my production code, so I must roll back to the previous version.

A bit surprised that the usage is not covered in the test cases.

@krlmlr
Copy link
Member

krlmlr commented Dec 28, 2021

The tests don't test explicitly that Id() objects can be passed. I agree that if the documentation claims it that we should also test for it. Might lead to breaking changes elsewhere.

Both dbWriteTable() and dbAppendTable() are affected.

@krlmlr
Copy link
Member

krlmlr commented Dec 28, 2021

Did it work before with dbAppendTable()? It looks like this particular method never supported Id() .

Please work around for now -- quote manually before calling dbAppendTable() . This will continue to work after the update.

@renkun-ken
Copy link
Contributor Author

renkun-ken commented Dec 29, 2021

I use dbAppendTable() and dbWriteTable(), dbListFields() etc. with Id() for at least two years, if not more.

At least all the listed functions at https://github.com/r-dbi/DBI/blob/main/R/Id.R#L13 support Id() in the previous CRAN release. I think it should be regarded as an important breaking change as the document in Id still claims that it is supported in these functions.

@github-actions
Copy link
Contributor

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.

@github-actions github-actions bot locked and limited conversation to collaborators Jun 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants