smalltableobject: Access (small) remote sql-tables just like data frames

Description Usage Format Value Fields Methods Examples

Description

Use object to query database table just like a data frame, using ...[x, y] notation.

Usage

1
2
3
4
sto1 <- smalltableobject$new(...) # Named sql-table on db-server.
sto1[1:10, 1]
sto1[1, 1] <- 99 # Trigger a write to db.
sto1[, ] <- sto1[1:10, ] # NB: must use [,]

Format

R6Class object with S3 class 'smalltableobject'.

Value

Database table wrapped in an R6 object.

Fields

get_host

Name of host

get_dbtype

Type of DB. Only "sqlite" allowed, currently.

get_db

Database part of table schema.

get_tablename

Table part of table schema.

Methods

Documentation

For full source code go to Github repo

subset_read

Don't call directly. Used with overloaded operator. Public by neccessity.

subset_write

Don't call directly. Used with overloaded operator. Public by neccessity.

print

Prints some helpful internal info about object. Also default method of object.

Examples

1
2
3
4
5
6
7
tf <- tempfile()
cn <- RSQLite::dbConnect(RSQLite::SQLite(), tf)
DBI::dbWriteTable(cn, "mytab", cars)
DBI::dbDisconnect(cn)
sto1 <- smalltableobject$new(dbtype = "sqlite", host = tf, tablename = "mytab")
class(sto1)
sto1[1, 1]

dan070/smalltableobject documentation built on July 8, 2019, 7:52 a.m.