Skip to content

Commit

Permalink
allow columns in dbQuoteIdentifier(), r-dbi#254
Browse files Browse the repository at this point in the history
  • Loading branch information
dpprdan committed Dec 29, 2021
1 parent 0e17617 commit dd70b7c
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions R/dbQuoteIdentifier_MariaDBConnection_Id.R
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
#' @name mariadb-quoting
#' @usage NULL
dbQuoteIdentifier_MariaDBConnection_Id <- function(conn, x, ...) {
stopifnot(all(names(x@name) %in% c("schema", "table")))
components <- c("schema", "table", "column")
stopifnot(all(names(x@name) %in% components))
stopifnot(!anyDuplicated(names(x@name)))

ret <- ""
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)
ret <- stats::na.omit(x@name[match(components, names(x@name))])
SQL(paste0(dbQuoteIdentifier(conn, ret), collapse = "."))
}

#' @rdname mariadb-quoting
Expand Down

0 comments on commit dd70b7c

Please sign in to comment.