Skip to contents

Safely disconnects an established database connection using the DBI package.

Usage

disconnect_connection(con)

Arguments

con

A database connection object created by DBI::dbConnect or any similar function that establishes a connection to a database.

Value

TRUE, invisibly. Throws an error if the disconnection fails.

Examples

if (FALSE) { # \dontrun{
con <- get_wrds_connection()
disconnect_connection(con)
} # }