Establishes a connection to the database
connect( database = NULL, host = "localhost", port = 5432, username = NULL, password = NULL, sqlite_file = NULL )
database | target db |
---|---|
host | db host: typically "localhost" |
port | db port number |
username | db username |
password | db password |
sqlite_file | filename as character vector if using an sqlite db (in which case this is the only argument that needs to be supplied) |
a database object connection
db_pth <- system.file("testdata/synthetic_db.sqlite3", package = "inspectEHR") ctn <- connect(sqlite_file = db_pth) class(ctn)#> [1] "SQLiteConnection" #> attr(,"package") #> [1] "RSQLite"