DatabaseConnector - This R package provides function for connecting to various DBMSs. Together with the SqlRender package, the main goal of DatabaseConnector is to provide a uniform interface across database platforms: the same code should run and produce equivalent results, regardless of the database back end.
https://github.com/ohdsi/DatabaseConnector?tab=readme-ov-file
STEP 4 (Optionally) To use Windows Authentication for SQL Server, download the authentication DDL file as described https://ohdsi.github.io/DatabaseConnector/articles/Connecting.html#obtaining-drivers
library(DatabaseConnector)
downloadJdbcDrivers("postgresql")
conn <- connect(dbms = "postgresql",
connectionString = "jdbc:postgresql://localhost:5432/postgres",
user = "ohdsi_admin_user",
password = "123456X")
PostgreSQL JDBC Driver https://github.com/pgjdbc/pgjdbc
need to debug this
querySql(conn, "SELECT TOP 3 * FROM person")
https://ohdsi.github.io/DatabaseConnector/reference/connect.html#windows-authentication-for-sql-server-1
User Documentation
Documentation can be found on the package website.
PDF versions of the documentation are also available:
Vignette: Connecting to a database
Vignette: Querying a database
Vignette: Using DatabaseConnector through DBI and dbplyr
Package manual: DatabaseConnector manual
Support
Developer questions/comments/feedback: OHDSI Forum
We use the GitHub issue tracker for all bugs/issues/enhancements
DatabaseConnector - This R package provides function for connecting to various DBMSs. Together with the SqlRender package, the main goal of DatabaseConnector is to provide a uniform interface across database platforms: the same code should run and produce equivalent results, regardless of the database back end.
https://github.com/ohdsi/DatabaseConnector?tab=readme-ov-file
STEP 4 (Optionally) To use Windows Authentication for SQL Server, download the authentication DDL file as described https://ohdsi.github.io/DatabaseConnector/articles/Connecting.html#obtaining-drivers
library(DatabaseConnector)
downloadJdbcDrivers("postgresql")
conn <- connect(dbms = "postgresql",
connectionString = "jdbc:postgresql://localhost:5432/postgres",
user = "ohdsi_admin_user",
password = "123456X")
PostgreSQL JDBC Driver https://github.com/pgjdbc/pgjdbc
need to debug this
querySql(conn, "SELECT TOP 3 * FROM person")
https://ohdsi.github.io/DatabaseConnector/reference/connect.html#windows-authentication-for-sql-server-1
User Documentation
Documentation can be found on the package website.
PDF versions of the documentation are also available:
Vignette: Connecting to a database
Vignette: Querying a database
Vignette: Using DatabaseConnector through DBI and dbplyr
Package manual: DatabaseConnector manual
Support
Developer questions/comments/feedback: OHDSI Forum
We use the GitHub issue tracker for all bugs/issues/enhancements