easydb_disconnect {easydb} | R Documentation |
Disconnect from database
Description
Simple wrapper around [DBI::dbDisconnect()]
Usage
easydb_disconnect(connection)
Arguments
connection |
coneection generated by [easydb_connect] |
Value
Invisibly returns TRUE
Examples
if(interactive()) {
# Choose config file path
# Do NOT use tempfile in practice.
# Instead, choose a fixed location such as '~/.easydb'
config <- tempfile('.example_config')
# Initialise config file
easydb_init(config)
# Connect to SQLite database
path_to_db <- system.file(package = 'easydb', 'testdbs/mtcars.sqlite')
con <- easydb_connect(dbname = path_to_db, config_file = config)
# Disconnect from database when finished
easydb_disconnect(con)
}
[Package easydb version 1.1.0 Index]