Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

dbDisconnect

Disconnect (close) a connection


Description

This closes the connection, discards all pending work, and frees resources (e.g., memory, sockets).

Usage

dbDisconnect(conn, ...)

Arguments

conn

A DBIConnection object, as returned by dbConnect().

...

Other parameters passed on to methods.

Value

dbDisconnect() returns TRUE, invisibly.

Specification

A warning is issued on garbage collection when a connection has been released without calling dbDisconnect(), but this cannot be tested automatically. A warning is issued immediately when calling dbDisconnect() on an already disconnected or invalid connection.

See Also

Examples

con <- dbConnect(RSQLite::SQLite(), ":memory:")
dbDisconnect(con)

DBI

R Database Interface

v1.1.1
LGPL (>= 2.1)
Authors
R Special Interest Group on Databases (R-SIG-DB) [aut], Hadley Wickham [aut], Kirill Müller [aut, cre] (<https://orcid.org/0000-0002-1416-3412>), R Consortium [fnd]
Initial release
2021-01-04

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.