is_connected {sqlhelper}R 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")

[Package sqlhelper version 0.2.1 Index]