testConnection: Test a connection

testConnectionR Documentation

Test a connection

Description

Test your conncection to local or remote servers. The function will return a logical of length one invisibly with TRUE for success and FALSE if any of the connection attempts fail.

Usage

testConnection(x, logger = loggerConnection, ...)

## S4 method for signature 'Credentials'
testConnection(x, logger = loggerConnection, ...)

## S4 method for signature 'CredentialsList'
testConnection(x, logger = loggerConnection, ...)

loggerConnection(x, status)

loggerSuppress(x, status)

Arguments

x

(Credentials | CredentialsList) a credentials object.

logger, status

(function) a logger function. Has two arguments, first is x second is used to indicate success and failure as logical(1).

...

arguments passed to sendQuery

Examples


workingConnection <- Credentials(drv = SQLite, dbname = ":memory:")
testConnection(workingConnection)

## To suppress logging:
testConnection(workingConnection, loggerSuppress)


INWT/dbtools documentation built on Aug. 21, 2022, 9:37 p.m.