From 5298a5bd36a87c5c53ba83ebe1d953d56cb359dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kirill=20M=C3=BCller?= Date: Mon, 1 Apr 2024 17:53:28 +0200 Subject: [PATCH 1/2] feat!: Avoid appending a numeric suffix to duplicate column names --- R/dbColumnInfo_SQLiteResult.R | 1 - R/dbFetch_SQLiteResult.R | 2 +- R/names.R | 25 ------------------------- 3 files changed, 1 insertion(+), 27 deletions(-) delete mode 100644 R/names.R diff --git a/R/dbColumnInfo_SQLiteResult.R b/R/dbColumnInfo_SQLiteResult.R index 54e28bb48..bd857dc07 100644 --- a/R/dbColumnInfo_SQLiteResult.R +++ b/R/dbColumnInfo_SQLiteResult.R @@ -2,7 +2,6 @@ #' @usage NULL dbColumnInfo_SQLiteResult <- function(res, ...) { df <- result_column_info(res@ptr) - df$name <- tidy_names(df$name) df } #' @rdname SQLiteResult-class diff --git a/R/dbFetch_SQLiteResult.R b/R/dbFetch_SQLiteResult.R index 4cde57401..c25fb4563 100644 --- a/R/dbFetch_SQLiteResult.R +++ b/R/dbFetch_SQLiteResult.R @@ -14,7 +14,7 @@ dbFetch_SQLiteResult <- function(res, n = -1, ..., ret <- result_fetch(res@ptr, n = n) ret <- convert_bigint(ret, res@bigint) ret <- sqlColumnToRownames(ret, row.names) - set_tidy_names(ret) + ret } #' @rdname SQLiteResult-class #' @export diff --git a/R/names.R b/R/names.R deleted file mode 100644 index c1af3747e..000000000 --- a/R/names.R +++ /dev/null @@ -1,25 +0,0 @@ -set_tidy_names <- function(x) { - new_names <- tidy_names(names2(x)) - names(x) <- new_names - x -} - -names2 <- function(x) { - name <- names(x) - if (is.null(name)) { - name <- rep("", length(x)) - } - name -} - -tidy_names <- function(name) { - name[is.na(name)] <- "" - append_pos(name) -} - -append_pos <- function(name) { - need_append_pos <- name == "" - append_pos <- which(need_append_pos) - name[append_pos] <- paste0(name[append_pos], "..", append_pos) - name -} From beb5973359e85f52772d0ba16899388db1b51b9a Mon Sep 17 00:00:00 2001 From: krlmlr Date: Mon, 1 Apr 2024 15:54:52 +0000 Subject: [PATCH 2/2] Auto-update from GitHub Actions Run: https://github.com/r-dbi/RSQLite/actions/runs/8510258131 --- DESCRIPTION | 1 - 1 file changed, 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index a41bb91f5..7fef36f3e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -127,7 +127,6 @@ Collate: 'initRegExp.R' 'isSQLKeyword_SQLiteConnection_character.R' 'make.db.names_SQLiteConnection_character.R' - 'names.R' 'pkgconfig.R' 'show_SQLiteConnection.R' 'sqlData_SQLiteConnection.R'