odbcReConnect: If ODBC connection not functioning, re-connect.

Description Usage Arguments Details Value

Description

Attempts to create a dplyr::tbl() object. If that fails, then odbc::dbConnect() to re-connect.

Usage

1
odbcReConnect(con, on_table = dbplyr::in_schema("pg_catalog", "pg_type"))

Arguments

con

An established DBI/odbc connection object

on_table

The DB table, possibly in a schema, to use for test.

Details

Note: odbc::IsValid does not check the connection is actually still live, which is why we use dplyr::tbl() to test.

Will throw error Could not re-establish connection., if new connection is not identical() to original.

Value

The original, or re-estbalished, connection.


ds4ci/ds4ciMisc documentation built on May 15, 2019, 2:56 p.m.