Compare commits

...

3 Commits

3 changed files with 6 additions and 6 deletions

View File

@@ -1,6 +1,6 @@
Package: AVSDevR.DBClient
Title: AVSDev R Database Client
Version: 0.0.0.9000
Version: 0.0.1
Authors@R:
person("Craig", "Williams", , "craig@avsdev.uk", role = c("aut", "cre"))
Description: AVSDevR.DBClient provides a collection of utility methods for

View File

@@ -1,6 +1,6 @@
client <- NULL
Initialize <- function(client) {
initialize <- function(client) {
if (is.null(client) || !is.R6(client) || inherits(client, "DBClient")) {
stop("DBClient instance required!")
}

View File

@@ -80,17 +80,17 @@ printDebug <- function(fn_name, table, key, tbl, rows, query_only = FALSE) {
return_keys <- NULL
if (key %in% colnames(rows)) {
return_keys <- rows %>%
return_keys <- rows |>
dplyr::select(key)
} else {
return_keys <- rows %>%
dplyr::bind_rows(tibble::tibble(!!key := character(0))) %>%
return_keys <- rows |>
dplyr::bind_rows(tibble::tibble(!!key := character(0))) |>
dplyr::mutate(
!!key := dplyr::coalesce(
!!!dplyr::sym(key),
paste0("<<NEW_ID::", round(stats::runif(1, 1, 100000)), ">>")
)
) %>%
) |>
dplyr::select(key)
}
return(invisible(return_keys))