| DataStoragePostgreSQL {shiny.telemetry} | R Documentation |
Data storage class with PostgreSQL provider
Description
Implementation of the DataStorage R6 class to PostgreSQL backend using a
unified API for read/write operations
Super classes
shiny.telemetry::DataStorage -> shiny.telemetry::DataStorageSQLFamily -> DataStoragePostgreSQL
Methods
Public methods
Inherited methods
Method new()
Initialize the data storage class
Usage
DataStoragePostgreSQL$new( username = NULL, password = NULL, hostname = "127.0.0.1", port = 5432, dbname = "shiny_telemetry", driver = "RPostgreSQL" )
Arguments
usernamestring with a PostgreSQL username.
passwordstring with the password for the username.
hostnamestring with hostname of PostgreSQL instance.
portnumeric value with the port number of PostgreSQL instance.
dbnamestring with the name of the database in the PostgreSQL instance.
driverstring, to select PostgreSQL driver among
c("RPostgreSQL", "RPostgres").
Method clone()
The objects of this class are cloneable with this method.
Usage
DataStoragePostgreSQL$clone(deep = FALSE)
Arguments
deepWhether to make a deep clone.
Examples
## Not run:
data_storage <- DataStoragePostgreSQL$new(user = "postgres", password = "mysecretpassword")
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)
data_storage$close()
## End(Not run)
[Package shiny.telemetry version 0.3.0 Index]