Fixed references to private$getDBConn()

This commit is contained in:
2026-02-03 13:04:46 +00:00
parent 4a38372fc9
commit 14e58ed9da
6 changed files with 13 additions and 13 deletions

View File

@@ -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

View File

@@ -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))

View File

@@ -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)
}

View File

@@ -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

View File

@@ -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)
))
}
}

View File

@@ -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))
}