Skip to content

multiple extraSettings for postgres #273

@MPagel

Description

@MPagel

Your R help file does not specify how to handle multiple extraSettings for postgres:

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

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

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&currentSchema=myschema" directly

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew functionality that could be addedhelp wantedWill probably not be addressed by the package maintainer, but could be addressed by someone else

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions