DataStorageSQLite {shiny.telemetry}R Documentation

Data storage class with SQLite provider

Description

Implementation of the DataStorage R6 class to SQLite backend using a unified API for read/write operations

Super classes

shiny.telemetry::DataStorage -> shiny.telemetry::DataStorageSQLFamily -> DataStorageSQLite

Methods

Public methods

Inherited methods

Method new()

Initialize the data storage class

Usage
DataStorageSQLite$new(db_path = "user_stats.sqlite")
Arguments
db_path

string with path to sqlfile


Method clone()

The objects of this class are cloneable with this method.

Usage
DataStorageSQLite$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Examples

db_path <- tempfile(fileext = ".sqlite")
data_storage <- DataStorageSQLite$new(db_path = db_path)

data_storage$insert("example", "test_event", "session1")
data_storage$insert("example", "input", "s1", list(id = "id1"))
data_storage$insert("example", "input", "s1", list(id = "id2", value = 32))

data_storage$insert(
  "example", "test_event_3_days_ago", "session1",
  time = lubridate::as_datetime(lubridate::today() - 3)
)

data_storage$read_event_data()
data_storage$read_event_data(Sys.Date() - 1, Sys.Date() + 1)

file.remove(db_path)

[Package shiny.telemetry version 0.2.0 Index]