Fixed lintr & complexity issues
This commit is contained in:
@@ -10,7 +10,7 @@
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
return(tbl)
|
tbl
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -40,7 +40,7 @@ insertRows <- function(table_name, rows, key_name = NULL) {
|
|||||||
return(dbplyr::get_returned_rows(tbl))
|
return(dbplyr::get_returned_rows(tbl))
|
||||||
}
|
}
|
||||||
|
|
||||||
return(invisible(tbl))
|
invisible(tbl)
|
||||||
}
|
}
|
||||||
|
|
||||||
appendRows <- function(table_name, rows, key_name = NULL) {
|
appendRows <- function(table_name, rows, key_name = NULL) {
|
||||||
@@ -64,7 +64,7 @@ appendRows <- function(table_name, rows, key_name = NULL) {
|
|||||||
return(dbplyr::get_returned_rows(tbl))
|
return(dbplyr::get_returned_rows(tbl))
|
||||||
}
|
}
|
||||||
|
|
||||||
return(invisible(TRUE))
|
invisible(TRUE)
|
||||||
}
|
}
|
||||||
|
|
||||||
upsertRows <- function(table_name, rows, key_name = NULL) {
|
upsertRows <- function(table_name, rows, key_name = NULL) {
|
||||||
@@ -98,7 +98,7 @@ upsertRows <- function(table_name, rows, key_name = NULL) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return(invisible(TRUE))
|
invisible(TRUE)
|
||||||
}
|
}
|
||||||
|
|
||||||
updateRows <- function(table_name, rows, key_name = NULL) {
|
updateRows <- function(table_name, rows, key_name = NULL) {
|
||||||
@@ -122,7 +122,7 @@ updateRows <- function(table_name, rows, key_name = NULL) {
|
|||||||
return(dbplyr::get_returned_rows(tbl))
|
return(dbplyr::get_returned_rows(tbl))
|
||||||
}
|
}
|
||||||
|
|
||||||
return(invisible(TRUE))
|
invisible(TRUE)
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteRows <- function(table_name, rows, key_name = NULL) {
|
deleteRows <- function(table_name, rows, key_name = NULL) {
|
||||||
@@ -151,5 +151,5 @@ deleteRows <- function(table_name, rows, key_name = NULL) {
|
|||||||
return(dbplyr::get_returned_rows(tbl))
|
return(dbplyr::get_returned_rows(tbl))
|
||||||
}
|
}
|
||||||
|
|
||||||
return(invisible(TRUE))
|
invisible(TRUE)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,13 +9,13 @@ NULL
|
|||||||
withSchema <- function(table_name) {
|
withSchema <- function(table_name) {
|
||||||
config <- private$conn$getConfiguration()
|
config <- private$conn$getConfiguration()
|
||||||
if (exists("schema", config)) {
|
if (exists("schema", config)) {
|
||||||
return(DBI::dbQuoteIdentifier(
|
DBI::dbQuoteIdentifier(
|
||||||
private$getDBConn(), DBI::Id(schema = config$schema, table = table_name)
|
private$getDBConn(), DBI::Id(schema = config$schema, table = table_name)
|
||||||
))
|
)
|
||||||
} else {
|
} else {
|
||||||
return(DBI::dbQuoteIdentifier(
|
DBI::dbQuoteIdentifier(
|
||||||
private$getDBConn(), DBI::Id(table = table_name)
|
private$getDBConn(), DBI::Id(table = table_name)
|
||||||
))
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -32,8 +32,8 @@ NULL
|
|||||||
dplyrWithSchema <- function(table_name) {
|
dplyrWithSchema <- function(table_name) {
|
||||||
config <- private$conn$getConfiguration()
|
config <- private$conn$getConfiguration()
|
||||||
if (exists("schema", config) && !is.null(config$schema)) {
|
if (exists("schema", config) && !is.null(config$schema)) {
|
||||||
return(dbplyr::in_schema(config$schema, table_name))
|
dbplyr::in_schema(config$schema, table_name)
|
||||||
} else {
|
} else {
|
||||||
return(table_name)
|
table_name
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ names(member_list) <- member_names
|
|||||||
NULL
|
NULL
|
||||||
|
|
||||||
#' @export
|
#' @export
|
||||||
|
# nolint next: object_name_linter. R6Class
|
||||||
DBClient <- R6::R6Class(
|
DBClient <- R6::R6Class(
|
||||||
"DBClient",
|
"DBClient",
|
||||||
public = fn_list,
|
public = fn_list,
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ connect <- function() {
|
|||||||
error = function(err) {
|
error = function(err) {
|
||||||
print("Database error:")
|
print("Database error:")
|
||||||
utils::str(err)
|
utils::str(err)
|
||||||
return(FALSE)
|
FALSE
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ names(member_list) <- member_names
|
|||||||
NULL
|
NULL
|
||||||
|
|
||||||
#' @export
|
#' @export
|
||||||
|
# nolint next: object_name_linter. R6Class
|
||||||
DBConnection <- R6::R6Class(
|
DBConnection <- R6::R6Class(
|
||||||
"DBConnection",
|
"DBConnection",
|
||||||
public = fn_list,
|
public = fn_list,
|
||||||
|
|||||||
4
R/aaa.R
4
R/aaa.R
@@ -1,5 +1,5 @@
|
|||||||
if(getRversion() >= "2.15.1") utils::globalVariables(c("self"))
|
if (getRversion() >= "2.15.1") utils::globalVariables(c("self"))
|
||||||
if(getRversion() >= "2.15.1") utils::globalVariables(c("private"))
|
if (getRversion() >= "2.15.1") utils::globalVariables(c("private"))
|
||||||
|
|
||||||
#' @importFrom rlang :=
|
#' @importFrom rlang :=
|
||||||
#' @importFrom rlang .data
|
#' @importFrom rlang .data
|
||||||
|
|||||||
Reference in New Issue
Block a user