Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
schuemie committed Nov 28, 2023
2 parents 239d686 + 74a57c6 commit be58698
Show file tree
Hide file tree
Showing 104 changed files with 191 additions and 154 deletions.
3 changes: 3 additions & 0 deletions .settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,8 @@ org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8
6 changes: 3 additions & 3 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Version: 6.3.0
Date: 2023-11-08 13:53:53 UTC
SHA: 105405047c12c144c4486ecfacb41d68a70be778
Version: 6.3.1
Date: 2023-11-28 13:06:47 UTC
SHA: 23e12a103d0553f25c4b14d5f0a9f39d239484d0
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: DatabaseConnector
Type: Package
Title: Connecting to Various Database Platforms
Version: 6.3.0
Date: 2023-11-08
Version: 6.3.1
Date: 2023-11-28
Authors@R: c(
person("Martijn", "Schuemie", email = "[email protected]", role = c("aut", "cre")),
person("Marc", "Suchard", role = c("aut")),
Expand Down
10 changes: 10 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
DatabaseConnector 6.3.1
=======================

Bugfixes:

1. Fixed `dbFetch()` for DBI drivers, no longer ignoring `n` argument.

2. Fix bulk import for Postgres on MacOs.


DatabaseConnector 6.3.0
=======================

Expand Down
12 changes: 5 additions & 7 deletions R/BulkLoad.R
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@ bulkLoadHive <- function(connection, sqlTableName, sqlFieldNames, data) {
)
}


bulkLoadPostgres <- function(connection, sqlTableName, sqlFieldNames, sqlDataTypes, data) {
logTrace(sprintf("Inserting %d rows into table '%s' using PostgreSQL bulk load", nrow(data), sqlTableName))
startTime <- Sys.time()
Expand All @@ -306,13 +305,12 @@ bulkLoadPostgres <- function(connection, sqlTableName, sqlFieldNames, sqlDataTyp
password <- attr(connection, "password")()

if (.Platform$OS.type == "windows") {
winPsqlPath <- Sys.getenv("POSTGRES_PATH")
command <- file.path(winPsqlPath, "psql.exe")
if (!file.exists(command)) {
abort(paste("Could not find psql.exe in ", winPsqlPath))
}
command <- file.path(Sys.getenv("POSTGRES_PATH"), "psql.exe")
} else {
command <- "psql"
command <- file.path(Sys.getenv("POSTGRES_PATH"), "psql")
}
if (!file.exists(command)) {
abort(paste("Could not find psql.exe in ", Sys.getenv("POSTGRES_PATH")))
}
headers <- paste0("(", sqlFieldNames, ")")
if (is.null(port)) {
Expand Down
4 changes: 2 additions & 2 deletions R/DBI.R
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,8 @@ setMethod("dbFetch", "DatabaseConnectorJdbcResult", function(res, n = -1, ...) {

#' @inherit DBI::dbFetch title description params details references return seealso
#' @export
setMethod("dbFetch", "DatabaseConnectorDbiResult", function(res, ...) {
columns <- DBI::dbFetch(res@resultSet, ...)
setMethod("dbFetch", "DatabaseConnectorDbiResult", function(res, n = -1, ...) {
columns <- DBI::dbFetch(res@resultSet, n, ...)
columns <- convertFields(res@dbms, columns)
columns <- dbFetchIntegerToNumeric(columns)
colnames(columns) <- tolower(colnames(columns))
Expand Down
20 changes: 13 additions & 7 deletions R/InsertTable.R
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ validateInt64Insert <- function() {
#'
#' PostgreSQL:
#' Uses the 'psql' executable to upload. Set the POSTGRES_PATH environment variable to the Postgres
#' binary path, e.g. 'C:/Program Files/PostgreSQL/11/bin'.
#' binary path, e.g. 'C:/Program Files/PostgreSQL/11/bin' on Windows or '/Library/PostgreSQL/16/bin'
#' on MacOs.
#'
#' @examples
#' \dontrun{
Expand Down Expand Up @@ -217,6 +218,13 @@ insertTable.default <- function(connection,
)
tempEmulationSchema <- oracleTempSchema
}
if (Andromeda::isAndromedaTable(data)) {
warn("Batch-wise uploading of Andromeda tables currently not supported. Loading entire table in memory.",
.frequency = "regularly",
.frequency_id = "useMppBulkLoad"
)
data <- as.data.frame(data)
}
if (camelCaseToSnakeCase) {
colnames(data) <- SqlRender::camelCaseToSnakeCase(colnames(data))
}
Expand All @@ -236,18 +244,16 @@ insertTable.default <- function(connection,
if (is.vector(data) && !is.list(data)) {
data <- data.frame(x = data)
}
if (length(data) < 1) {
if (ncol(data) < 1) {
abort("data must have at least one column")
}
if (is.null(names(data))) {
names(data) <- paste("V", 1:length(data), sep = "")
}
if (length(data[[1]]) > 0) {
if (!is.data.frame(data)) {
if (!is.data.frame(data)) {
if (nrow(data) > 0) {
data <- as.data.frame(data, row.names = 1:length(data[[1]]))
}
} else {
if (!is.data.frame(data)) {
} else {
data <- as.data.frame(data)
}
}
Expand Down
2 changes: 1 addition & 1 deletion cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
This update includes 3 changes and 1 bugfixes. (see NEWS.md).
This update includes 2 bugfixes. (see NEWS.md).

---

Expand Down
2 changes: 1 addition & 1 deletion docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions docs/articles/Connecting.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/articles/DbiAndDbplyr.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/articles/Querying.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/authors.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions docs/news/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ articles:
Connecting: Connecting.html
DbiAndDbplyr: DbiAndDbplyr.html
Querying: Querying.html
last_built: 2023-11-08T13:18Z
last_built: 2023-11-28T09:55Z

2 changes: 1 addition & 1 deletion docs/pull_request_template.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/DatabaseConnector-package.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/DatabaseConnectorDbiResult-class.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/DatabaseConnectorDriver-class.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/DatabaseConnectorDriver.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/DatabaseConnectorJdbcResult-class.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/assertTempEmulationSchemaSet.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/computeDataHash.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/connect.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/createConnectionDetails.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/createDbiConnectionDetails.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/createZipFile.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/dateAdd.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/dateDiff.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/dateFromParts.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit be58698

Please sign in to comment.