cache_postgres | R Documentation |
A Caching object for postgres
A Caching object for postgres
Create a cache backend with postgres
new()
Start a new postgres cache
cache_postgres$new( ..., cache_table = "bankrcache", algo = "sha512", compress = FALSE )
...
Parameters passes do DBI::dbConnect(RPostgres::Postgres(), ...)
cache_table
On initialize()
, the cache object will create a table
to store the cache. Default name is bankrcache
. Change it if you already
have a table named bankrcache
in your DB.
algo
for {memoise}
compatibility, the digest()
algorithm
compress
for {memoise}
compatibility, should the data be compressed?
A cache_postgres object
has_key()
Does the cache contains a given key?
cache_postgres$has_key(key)
key
Name of the key.
TRUE/FALSE
get()
Get a key from the cache
cache_postgres$get(key)
key
Name of the key.
The value stored using the key
set()
Set a key in the cache
cache_postgres$set(key, value)
key
Name of the key.
value
Value to store
Used for side effect
reset()
Clear all the cache
cache_postgres$reset()
Used for side-effect
remove()
Remove a key/value pair
cache_postgres$remove(key)
key
Name of the key.
Used for side-effect
keys()
List all the keys in the cache
cache_postgres$keys()
A list of keys
digest()
Function that runs an hash algo.
For compatibily with {memoise}
cache_postgres$digest(...)
...
the value to hash
A function
clone()
The objects of this class are cloneable with this method.
cache_postgres$clone(deep = FALSE)
deep
Whether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.