Writing at a Timestamp

There are cases where it is very useful to write at a specific timestamp (e.g., in the past or the future). TileDB allows you to do that by simply opening the array for writing at the desired timestamp, similar to reads:

#include <tiledb/tiledb.h>

// ... create TileDB context

// Open array for writing at a timestamp
tiledb_array_t* array;
tiledb_array_alloc(ctx, array_name, &array);
tiledb_array_open_at(ctx, array, TILEDB_WRITE, timestamp);
// or use tiledb_array_open_at_with_key for encrypted arrays

// Create the query
tiledb_query_t* query;
tiledb_query_alloc(ctx, array, TILEDB_WRITE, &query);

// ... perform the write as usual

// Close array
tiledb_array_close(ctx, array);

// Clean up
tiledb_array_free(&array);
tiledb_query_free(&query);

Last updated