Disconnect (close) the connection of the connector
Source:R/cnt_generics.R
, R/dbi_methods.R
disconnect_cnt.Rd
Generic implementing of how to disconnect from the relevant connections. Mostly relevant for DBI connectors.
connector_dbi: Uses
DBI::dbDisconnect()
to create a table reference to close a DBI connection.
Usage
disconnect_cnt(connector_object, ...)
# S3 method for class 'connector_dbi'
disconnect_cnt(connector_object, ...)
Arguments
- connector_object
connector The connector object to use.
- ...
Additional arguments passed to the method for the individual connector.
Value
invisible connector_object.
Examples
# Open and close a DBI connector
cnt <- connector_dbi$new(RSQLite::SQLite())
cnt$conn
#> <SQLiteConnection>
#> Path:
#> Extensions: TRUE
cnt |>
disconnect_cnt()
cnt$conn
#> <SQLiteConnection>
#> DISCONNECTED