sync_cache: sync_cache

View source: R/cache_readwrite.R

sync_cacheR Documentation

sync_cache

Description

Syncs cached files across storage depths by incrementally updating using cache_update or simply copying and converting the most recently-modified cache to the other locations using cache_read and cache_write.

Usage

sync_cache(
  table_name,
  type,
  incremental = FALSE,
  date_column = NULL,
  whole_file = !cache_exists_any(table_name, type),
  ...
)

Arguments

table_name

string

type

string, e.g. "tessi" or "stream"

incremental

boolean, whether to incrementally update the caches by using cache_update or simply copying the whole file.

date_column

character name of the column to be used for determining the date of last row update, useful for incremental updates.

whole_file

boolean, whether to copy the whole file using file.copy or to convert it using cache_read and cache_write. The default is to convert if the cache is in a recognizable arrow format and to copy if it is not.

...

additional parameters passed on to cache_update

Value

invisible

Examples

## Not run: 
x <- data.table(a = c(1, 2, 3))
write_cache(x, "test", "stream", primary_keys = c("a"))
sync_cache("test", "stream")

## End(Not run)

skysyzygy/tessilake documentation built on June 14, 2025, 6:50 p.m.