Learn R Programming

dwtools (version 0.8.3.9)

add.db.conns: Append connection to dictionary

Description

Append connection to dictionary

Usage

add.db.conns(...)

Arguments

...
named connections to append on current connections dictionary at getOption('dwtools.db.conns').

Value

Invisibly direct return from options("dwtools.db.conns"=...) - the previous value for an option.

Examples

Run this code
suppressPackageStartupMessages(library(dwtools))
library(RSQLite) # install.packages("RSQLite")

sqlite1 = list(drvName="SQLite",dbname="sqlite1.db")
sqlite1$conn = dbConnect(SQLite(), dbname=sqlite1$dbname)
options("dwtools.db.conns"=list(sqlite1=sqlite1))
str(getOption("dwtools.db.conns"))

# add csv
csv1 = list(drvName = "csv")
# add sqlite second
sqlite2 = list(drvName="SQLite",dbname="sqlite2.db")
sqlite2$conn = dbConnect(SQLite(), dbname=sqlite2$dbname)

add.db.conns(csv1=csv1, sqlite2=sqlite2)
getOption("dwtools.db.conns")

Run the code above in your browser using DataLab