Status
lines of R code: 261, lines of test code: 73
Version
0.1.3 ( 2018-10-31 14:49:32 )
Description
A convenience R6 class framework around DBI that provides classes for connection, db, table, … with methods around SQL verbs create, insert, update, delete, select, … and many more.
License
MIT + file LICENSE Peter Meissner [aut, cre], [ctb]
Installation
Stable version from CRAN:
install.packages("db6")
Latest development version from Github:
devtools::install_github("petermeissner/db6")
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.
loading packages
# packages
library(RSQLite)
library(db6)
# creating con object
db_con <- new_db_con(drv_fun = SQLite, ":memory:")
# connection infos
db_con$con
## <SQLiteConnection>
## Path: :memory:
## Extensions: TRUE
db_con$info()
## $class
## [1] "SQLiteConnection"
##
## $dbname
## [1] ":memory:"
# Auto reconnect
db_con$disconnect()
db_con$con
## <SQLiteConnection>
## Path: :memory:
## Extensions: TRUE
db_con$info()
## $class
## [1] "SQLiteConnection"
##
## $dbname
## [1] ":memory:"
db_con$con
## <SQLiteConnection>
## Path: :memory:
## Extensions: TRUE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.