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

Data frame with column name "sep" cause error #336

Closed
fproske opened this issue Apr 2, 2020 · 3 comments · Fixed by #337
Closed

Data frame with column name "sep" cause error #336

fproske opened this issue Apr 2, 2020 · 3 comments · Fixed by #337
Milestone

Comments

@fproske
Copy link

fproske commented Apr 2, 2020

When a data frame includes a column name "sep", any library that relies on the method "sqlAppendTable" (DBI/R/table-insert.R) will throw an error.

Reprex (with RSQLite package):

library(RSQLite)
a <- data.frame(sep = c(1,2,3))
con <- dbConnect(SQLite())
dbWriteTable(con, "a", a)
#> Error in (function (..., sep = " ", collapse = NULL) : formal argument "sep" matched by multiple actual arguments

Created on 2020-04-02 by the reprex package (v0.3.0)

The problem is here. One solution would be:

rows <- do.call(paste, c(unname(sql_values), sep = ", "))
@krlmlr krlmlr transferred this issue from r-dbi/DBI Dec 27, 2020
@krlmlr
Copy link
Member

krlmlr commented Dec 27, 2020

Thanks. This is specific to RSQLite and RMariaDB.

@krlmlr
Copy link
Member

krlmlr commented Jan 3, 2021

Specific because only these packages use the DBI implementation.

@krlmlr krlmlr transferred this issue from r-dbi/RSQLite Jan 3, 2021
@krlmlr krlmlr added this to the 1.1.1 milestone Jan 3, 2021
krlmlr added a commit that referenced this issue Jan 3, 2021
- `dbAppendTable()` now allows columns named `sep` (#336).
@github-actions
Copy link
Contributor

github-actions bot commented Jan 4, 2022

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

Successfully merging a pull request may close this issue.

2 participants