DataStorageMariaDB | R Documentation |
Implementation of the DataStorage
R6 class to MariaDB backend using a
unified API for read/write operations
shiny.telemetry::DataStorage
-> shiny.telemetry::DataStorageSQLFamily
-> DataStorageMariaDB
new()
Initialize the data storage class
DataStorageMariaDB$new( username = NULL, password = NULL, hostname = "127.0.0.1", port = 3306, dbname = "shiny_telemetry" )
username
string with a MariaDB username.
password
string with the password for the username.
hostname
string with hostname of MariaDB instance.
port
numeric value with the port number of MariaDB instance.
dbname
string with the name of the database in the MariaDB instance.
clone()
The objects of this class are cloneable with this method.
DataStorageMariaDB$clone(deep = FALSE)
deep
Whether to make a deep clone.
## Not run:
data_storage <- DataStorageMariaDB$new(user = "mariadb", 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.