Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multiple extraSettings for postgres #273

Open
MPagel opened this issue Jun 5, 2024 · 0 comments
Open

multiple extraSettings for postgres #273

MPagel opened this issue Jun 5, 2024 · 0 comments
Labels
enhancement New functionality that could be added help wanted Will probably not be addressed by the package maintainer, but could be addressed by someone else

Comments

@MPagel
Copy link

MPagel commented Jun 5, 2024

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

@schuemie schuemie added enhancement New functionality that could be added help wanted Will probably not be addressed by the package maintainer, but could be addressed by someone else labels Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New functionality that could be added help wanted Will probably not be addressed by the package maintainer, but could be addressed by someone else
Projects
None yet
Development

No branches or pull requests

2 participants