Skip to content

jdposada/BQJdbcConnectionStringR

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BQJdbcConnectionString

This package helps build the connection string required to use OHDSI DatabaseConnector with BigQuery

Dependencies

Requires R (version 3.1.0 or higher), and jsonlite

Installation

You will need to install devtools and run the following commands in R

    library(devtools)
    install_github("jdposada/BQJdbcConnectionStringR")

How to use

Example of usage with DatabaseConnector

jsonPath <- "/Users/jdposada/.config/gcloud/application_default_credentials.json"
bqDriverPath <- "/Users/jdposada/BqJdbcDrivers"

connectionString <-  createBQConnectionString(projectId = "som-rit-starr",
                                              defaultDataset = "jdposada_explore",
                                              authType = 2,
                                              jsonCredentialsPath = jsonPath)

connectionDetails <- DatabaseConnector::createConnectionDetails(dbms="bigquery",
                                                                connectionString=connectionString,
                                                                user="",
                                                                password='',
                                                                pathToDriver = bqDriverPath)

# Create a connection
connection <- connect(connectionDetails)

# Test with a sql query to the concept table
sql = "select * from starr-omop-deid.concept limit 10;"
concepts <- querySql(connection, sql)

About

Helper function to build a connection string to use the JDBC BigQuery driver in R in conjunction with OHDSI DatabaseConnector package

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages