This package helps build the connection string required to use OHDSI DatabaseConnector with BigQuery
Requires R (version 3.1.0 or higher), and jsonlite
You will need to install devtools and run the following commands in R
library(devtools)
install_github("jdposada/BQJdbcConnectionStringR")
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)