OHDSI / OHDSI/DatabaseConnector

multiple extraSettings for postgres

Open
#273 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement help wanted
Dominant language
R
Stars
57
Forks
93
Avg merge
10d 12h
Merged PRs (30d)
1

Description

Your R help file does not specify how to handle multiple extraSettings for postgres:
https://github.com/OHDSI/DatabaseConnector/blob/bee58a314996123b59e08bd489bf712e14391c4f/man/connect.Rd#L109-L117

nor does the related vignette or pdf document

looking at
https://github.com/OHDSI/DatabaseConnector/blob/bee58a314996123b59e08bd489bf712e14391c4f/R/Connect.R#L479

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 https://github.com/OHDSI/DatabaseConnector/blob/bee58a314996123b59e08bd489bf712e14391c4f/R/Connect.R#L479
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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read R/Connect.R around line 479 and man/connect.Rd lines 109-117, then locate the related vignette and PDF documentation. Update the PostgreSQL extraSettings documentation with a multi-parameter example and clarify the required separator; consider the requested character-vector behavior separately if the scope is expanded.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql, r
Domain
databases, documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.