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

dbQuoteIdentifier inconsistent with other DBI drivers #1085

Open
ankane opened this issue Mar 18, 2025 · 0 comments
Open

dbQuoteIdentifier inconsistent with other DBI drivers #1085

ankane opened this issue Mar 18, 2025 · 0 comments

Comments

@ankane
Copy link

ankane commented Mar 18, 2025

Hi, currently, duckdb-r skips quoting identifiers in calls to dbQuoteIdentifier if it's not strictly needed. However, this is inconsistent with other DBI drivers and was surprising as a user (seeing dbQuoteIdentifier not add quotes).

RSQLite     | `test`
RPostgres   | "test"
RPostgreSQL | "test"
RMySQL      | `test`
RMariaDB    | `test`
duckdb-r    | test

Repro script

library(DBI)

show <- function(name, db) {
    cols <- c("test")
    cat(sprintf("%-11s | %s\n", name, dbQuoteIdentifier(db, cols)))
    invisible(dbDisconnect(db))
}

show("RSQLite", dbConnect(RSQLite::SQLite(), dbname=":memory:"))
show("RPostgres", dbConnect(RPostgres::Postgres(), dbname="postgres"))
show("RPostgreSQL", dbConnect(RPostgreSQL::PostgreSQL(), dbname="postgres"))
show("RMySQL", dbConnect(RMySQL::MySQL(), dbname="mysql"))
show("RMariaDB", dbConnect(RMariaDB::MariaDB(), dbname="mysql"))
show("duckdb-r", dbConnect(duckdb::duckdb(), dbdir=":memory:"))
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

No branches or pull requests

1 participant