is_connected: Test whether a database is connected

View source: R/is_connected.R

is_connectedR Documentation

Test whether a database is connected

Description

Test whether a database is connected

Usage

is_connected(conn_name)

not_connected(conn_name)

Arguments

conn_name

Character. The name of a connection (run connection_info() for options)

Value

Logical, or NULL if conn_name does not identify exactly 1 connection

Examples

library(sqlhelper)

connect(
  system.file("examples/sqlhelper_db_conf.yml",
              package="sqlhelper")
)
connection_info()

is_connected("simple_sqlite")
is_connected("foo")
DBI::dbDisconnect(live_connection("simple_sqlite"))
is_connected("simple_sqlite")
not_connected("simple_sqlite")
disconnect()
is_connected("simple_sqlite")
not_connected("simple_sqlite")

sqlhelper documentation built on May 29, 2024, 4:29 a.m.