Skip to content

Commit

Permalink
Merge pull request #460 from r-dbi/b-dbitest
Browse files Browse the repository at this point in the history
fix: Fix `dbQuoteIdentifier()` for `Id()` objects to no longer rely on names
  • Loading branch information
aviator-app[bot] authored Apr 1, 2024
2 parents 6f42d0a + 00ab20d commit 3a8e452
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions R/dbQuoteIdentifier_PqConnection_Id.R
Original file line number Diff line number Diff line change
@@ -1,20 +1,7 @@
#' @name quote
#' @usage NULL
dbQuoteIdentifier_PqConnection_Id <- function(conn, x, ...) {
stopifnot(all(names(x@name) %in% c("catalog", "schema", "table")))
stopifnot(!anyDuplicated(names(x@name)))

ret <- ""
if ("catalog" %in% names(x@name)) {
ret <- paste0(ret, dbQuoteIdentifier(conn, x@name[["catalog"]]), ".")
}
if ("schema" %in% names(x@name)) {
ret <- paste0(ret, dbQuoteIdentifier(conn, x@name[["schema"]]), ".")
}
if ("table" %in% names(x@name)) {
ret <- paste0(ret, dbQuoteIdentifier(conn, x@name[["table"]]))
}
SQL(ret)
SQL(paste0(dbQuoteIdentifier(conn, x@name), collapse = "."))
}

#' @rdname quote
Expand Down

0 comments on commit 3a8e452

Please sign in to comment.