options("width"=110)
tmp <- packageDescription( basename(getwd()) )
cat("#", tmp$Title)

Status

Project Status: WIP. cran checks Codecov

filelist.R   <- list.files("R", recursive = TRUE, pattern="\\.R$", ignore.case = TRUE, full.names = TRUE)
filelist.tests   <- list.files("tests", recursive = TRUE, pattern="\\.R$", ignore.case = TRUE, full.names = TRUE)
filelist.cpp <- list.files("src", recursive = TRUE, pattern="\\.cpp$", ignore.case = TRUE, full.names = TRUE)
lines.R      <- unlist(lapply(filelist.R, readLines))
lines.tests  <- unlist(lapply(filelist.tests, readLines))
lines.cpp    <- unlist(lapply(filelist.cpp, readLines))
length.R     <- length(grep("(^\\s*$)|(^\\s*#)|(^\\s*//)", lines.R,  value = TRUE, invert = TRUE))
length.tests <- length(grep("(^\\s*$)|(^\\s*#)|(^\\s*//)", lines.tests,  value = TRUE, invert = TRUE))
length.cpp   <- length(grep("(^\\s*$)|(^\\s*#)|(^\\s*//)", lines.cpp,  value = TRUE, invert = TRUE))

lines of R code: r length.R, lines of test code: r length.tests

Package Info

Version

source_files <- 
  grep(
    "/R/|/src/|/tests/",
    list.files(recursive = TRUE, full.names = TRUE), 
    value = TRUE
  )
last_change <- 
  as.character(
    format(max(file.info(source_files)$mtime), tz="UTC")
  )
cat(tmp$Version, "(",last_change,")")

Description

cat(tmp$Description)

License

cat(tmp$License, "<br>")
cat(tmp$Author)

Installation

Stable version from CRAN:

install.packages("db6")

Latest development version from Github:

devtools::install_github("petermeissner/db6")

Objects

db : A representation of a database within R. The object allows to get information about the database and objects stored in it (tables and such), to retrieve objects from it, and to manipulate it via queries and convenience methods.

db_con : The heart and work horse of all db objects and responsible for the actual information flow between R and the database with methods for connect, disconnect, reconnect, querying, and manipulating the database.

tb_table : A representation of a database table with particular methods to interact with tables - create, delete, append, copy, retrieve, filter, peak, and update.


Connections

loading packages

# packages
library(RSQLite)
library(db6)

A New Connection Object

# creating con object
db_con <- new_db_con(drv_fun = SQLite, ":memory:")

Connection Infos

# connection infos
db_con$con

db_con$info()

Auto Reconnect on Stale Connections

# Auto reconnect
db_con$disconnect()
db_con$con

db_con$info()
db_con$con


petermeissner/db6 documentation built on May 17, 2019, 8:21 a.m.