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

Is it intended that DBI::Id() does not have a as.character() method? #298

Closed
jimhester opened this issue Jan 10, 2020 · 3 comments
Closed

Comments

@jimhester
Copy link
Contributor

Using DBI::Id() objects in places that convert objects to characters results in an error.

as.character(DBI::Id(blah = "foo"))
#> Error in as.character.default(DBI::Id(blah = "foo")): no method for coercing this S4 class to a vector
paste(DBI::Id(blah = "foo"))
#> Error in as.character.default(new("Id", name = c(blah = "foo"))): no method for coercing this S4 class to a vector

Created on 2020-01-10 by the reprex package (v0.3.0)

I see there is a toString() method defined for these objects, is the intention that all coercion to strings must be explicit and use toString()?

Ref: r-dbi/odbc#339

@krlmlr
Copy link
Member

krlmlr commented Apr 14, 2020

I guess so. I'd expect users to call dbQuoteIdentifier(con, id) to retrieve a printable representation. I was not aware of toString().

@krlmlr
Copy link
Member

krlmlr commented Dec 27, 2020

toString.Id() was effectively introduced in 18c8e85 and last touched in 31bd35f. I now consider breaking paste() a feature.

@krlmlr krlmlr closed this as completed Dec 27, 2020
@github-actions
Copy link

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 Dec 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants