-
Notifications
You must be signed in to change notification settings - Fork 91
Description
Your R help file does not specify how to handle multiple extraSettings for postgres:
DatabaseConnector/man/connect.Rd
Lines 109 to 117 in bee58a3
| PostgreSQL: | |
| \itemize{ | |
| \item \code{user}. The user used to log in to the server | |
| \item \code{password}. The password used to log on to the server | |
| \item \code{server}. This field contains the host name of the server and the database holding the | |
| relevant schemas: host/database | |
| \item \code{port}. Specifies the port on the server (default = 5432) | |
| \item \code{extraSettings}. The configuration settings for the connection (i.e. SSL Settings such | |
| as "ssl=true") |
nor does the related vignette or pdf document
looking at
Line 479 in bee58a3
| connectionString <- paste(connectionString, connectionDetails$extraSettings, sep = "?") |
it appears that the connectPostgreSql function expects a single string for extraSettings, but the option separator is not specified. I had initially attempted ; ala MS SQL, but I should have been using & for postgres (similar to redshift).
My request is, at the very least, please include a multi-parameter string for extraSettings for postgres in the help file. Ideally you could accept a character vector of length >1, rather than just a simple "string" and parse for the individual depending on the DBMS that they are using.
An example of this would be to modify
Line 479 in bee58a3
| connectionString <- paste(connectionString, connectionDetails$extraSettings, sep = "?") |
to read
connectionString <- paste(connectionString, connectionDetails$extraSettings, sep = "?", collapse="&")
this will have no impact if length(connectionDetails$extraSettings) == 1, but if length(...)>1 (and class(connectionDetails$extraSettings) == 'character' still) it will collapse it appropriately
you could then make similar changes for the other database types.
my current work-around is, when calling createConnectionDetails, to specify that extraSettings = paste(c("sslmode=require","ssl=true","currentSchema=myschema"),collapse="&"), but such a solution requires the end-user to know the correct separator for their RDMS connection string and is honestly no better than just setting the string to "sslmode=require&ssl=true¤tSchema=myschema" directly