From 14e58ed9da4d8ccb1a6f48d66f60337196261f1a Mon Sep 17 00:00:00 2001 From: Craig Williams Date: Tue, 3 Feb 2026 13:04:46 +0000 Subject: [PATCH] Fixed references to private$getDBConn() --- DESCRIPTION | 2 +- R/DBClient-CRUDRows.R | 14 +++++++------- R/DBClient-dbAction.R | 2 +- R/DBClient-dbQuery.R | 2 +- R/DBClient-dbSchema.R | 4 ++-- R/DBClient-dbTable.R | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index b73863e..136d8ec 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: AVSDevR.DBClient Title: AVSDev R Database Client -Version: 0.0.0.9000 +Version: 0.0.0.9002 Authors@R: person("Craig", "Williams", , "craig@avsdev.uk", role = c("aut", "cre")) Description: AVSDevR.DBClient provides a collection of utility methods for diff --git a/R/DBClient-CRUDRows.R b/R/DBClient-CRUDRows.R index 7cef5f4..08721b9 100644 --- a/R/DBClient-CRUDRows.R +++ b/R/DBClient-CRUDRows.R @@ -6,7 +6,7 @@ if (sum(keys %in% class(tbl$lazy_query$x)) == 0) { tbl$lazy_query$x <- dbplyr::as.sql( - tbl$lazy_query$x, private$client$getConnection() + tbl$lazy_query$x, private$getDBConn() ) } @@ -16,7 +16,7 @@ insertRows <- function(table_name, rows, key_name = NULL) { tbl <- self$table(table_name) - new_rows <- dbplyr::copy_inline(private$client$getConnection(), rows) + new_rows <- dbplyr::copy_inline(private$getDBConn(), rows) if (getOption("db.simulate", FALSE)) { return(printDebug("insertRows", table_name, key_name, tbl, rows, TRUE)) @@ -45,7 +45,7 @@ insertRows <- function(table_name, rows, key_name = NULL) { appendRows <- function(table_name, rows, key_name = NULL) { tbl <- self$table(table_name) - new_rows <- dbplyr::copy_inline(private$client$getConnection(), rows) + new_rows <- dbplyr::copy_inline(private$getDBConn(), rows) if (getOption("db.simulate", FALSE)) { return(printDebug("appendRows", table_name, key_name, tbl, rows, TRUE)) @@ -69,12 +69,12 @@ appendRows <- function(table_name, rows, key_name = NULL) { upsertRows <- function(table_name, rows, key_name = NULL) { tbl <- self$table(table_name) - new_rows <- dbplyr::copy_inline(private$client$getConnection(), rows) + new_rows <- dbplyr::copy_inline(private$getDBConn(), rows) tbl <- private$fix_dbplyr(tbl) # NOTE: Temporary fix for issue: tidyverse/dbplyr#1279 - if ("MariaDBConnection" %in% class(private$client$getConnection())) { + if ("MariaDBConnection" %in% class(private$getDBConn())) { keys <- dplyr::pull(rows, !!key_name) tbl_keys <- dplyr::select(tbl, !!key_name) filt_rows <- dplyr::filter(tbl_keys, !!as.symbol(key_name) %in% !!keys) @@ -103,7 +103,7 @@ upsertRows <- function(table_name, rows, key_name = NULL) { updateRows <- function(table_name, rows, key_name = NULL) { tbl <- self$table(table_name) - new_rows <- dbplyr::copy_inline(private$client$getConnection(), rows) + new_rows <- dbplyr::copy_inline(private$getDBConn(), rows) if (getOption("db.simulate", FALSE)) { return(printDebug("updateRows", table_name, key_name, tbl, rows, TRUE)) @@ -127,7 +127,7 @@ updateRows <- function(table_name, rows, key_name = NULL) { deleteRows <- function(table_name, rows, key_name = NULL) { tbl <- self$table(table_name) - old_rows <- dbplyr::copy_inline(private$client$getConnection(), rows) + old_rows <- dbplyr::copy_inline(private$getDBConn(), rows) if (getOption("db.simulate", FALSE)) { return(printDebug("deleteRows", table_name, key_name, tbl, rows, TRUE)) diff --git a/R/DBClient-dbAction.R b/R/DBClient-dbAction.R index bb29157..cbde819 100644 --- a/R/DBClient-dbAction.R +++ b/R/DBClient-dbAction.R @@ -10,5 +10,5 @@ dbAction <- function(statement) { if (getOption("db.debug", FALSE)) { cat("dbQuery:", statement, "\n") } - DBI::dbExecute(private$getConn(), statement) + DBI::dbExecute(private$getDBConn(), statement) } diff --git a/R/DBClient-dbQuery.R b/R/DBClient-dbQuery.R index aea7a51..2e868df 100644 --- a/R/DBClient-dbQuery.R +++ b/R/DBClient-dbQuery.R @@ -10,7 +10,7 @@ dbQuery <- function(statement) { if (getOption("db.debug", FALSE)) { cat("dbQuery:", statement, "\n") } - query <- DBI::dbSendQuery(private$getConn(), statement) + query <- DBI::dbSendQuery(private$getDBConn(), statement) res <- DBI::dbFetch(query) DBI::dbClearResult(query) res diff --git a/R/DBClient-dbSchema.R b/R/DBClient-dbSchema.R index 7d2f60e..4599d69 100644 --- a/R/DBClient-dbSchema.R +++ b/R/DBClient-dbSchema.R @@ -10,11 +10,11 @@ withSchema <- function(table_name) { config <- private$conn$getConfiguration() if (exists("schema", config)) { return(DBI::dbQuoteIdentifier( - private$getConn(), DBI::Id(schema = config$schema, table = table_name) + private$getDBConn(), DBI::Id(schema = config$schema, table = table_name) )) } else { return(DBI::dbQuoteIdentifier( - private$getConn(), DBI::Id(table = table_name) + private$getDBConn(), DBI::Id(table = table_name) )) } } diff --git a/R/DBClient-dbTable.R b/R/DBClient-dbTable.R index e0872a3..91dc483 100644 --- a/R/DBClient-dbTable.R +++ b/R/DBClient-dbTable.R @@ -10,5 +10,5 @@ table <- function(table_name) { if (getOption("db.debug", FALSE)) { cat("dbTable:", table_name, "\n") } - dplyr::tbl(private$getConn(), self$dplyrWithSchema(table_name)) + dplyr::tbl(private$getDBConn(), self$dplyrWithSchema(table_name)) }