Skip to contents

create a connection object to the Run ID Database. By default function will look for a config file using the config::get() function. If no file is found user provided username, host, and port will be used. In all cases the password will be obtained using an Azure token generated using the azure cli tool.

Usage

gr_db_connect(username = NULL, host = NULL, dbname = NULL)

Arguments

username

(optional) username for login

host

(optional) host for login

Value

a "PqConnection" object to be used in queries to database

Details

Azure accesstoken will be used for password authentication, users must have the Azure CLI tool installed. To verify try running az --version and confirm a version number and additional information is printed to the screen.

Examples

if (FALSE) {

# run with config file, file will be searched up directories starting from the working directory
con <- gr_db_connect()

# run with username, dbname, and host passed in as arguemnts
con <- gr_db_connect(
                     username = "myusername",
                     dbname = "dbname",
                     host = "host.com"
)
dplyr::tbl(con, "agency")
}