Credentials: Credentials Class

View source: R/Credentials.R

Credentials-classR Documentation

Credentials Class

Description

Use this function to store your database credentials.

Usage

Credentials(drv, ...)

## S3 method for class 'Credentials'
as.list(x, ...)

## S3 method for class 'Credentials'
as.character(x, ...)

CredentialsList(...)

## S4 method for signature 'CredentialsList,ANY,missing'
x[i, j, ..., drop = TRUE]

CredentialsFromURL(url, ...)

Arguments

drv

(function) a driver. Will be called and passed to dbConnect

...

named arguments which can be passed to dbConnect

x

(Credentials) an instance

i, j, drop

passed to S3 extract method

url

(character) a database url of the form pkg::driver://username:password@host:port/database.

Details

CredentialsList can be used to construct a list of Credential objects. The advantage is, that all arguments can be vectors. Elements of length one are replicated to match the appropriate number of credentials. This is usefull whenever you run the same query on multiple databases where they only differ in the port but else expect the same credentials.

CredentialsFromURL can be used to construct a Credential objects from a dabase URL.

Examples

Credentials(drv = SQLite, dbname = ":memory:")
Credentials(drv = SQLite, dbname = c(":memory:", ":memory:"))

CredentialsFromURL("RSQLite::SQLite://memory")

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