Creates a row in snapshots with status CREATED. Does not import any data.
Details
Snapshot mutability rule: snapshots are mutable only while their status is
CREATED (imports/seal will fail for SEALED and FAILED snapshots).
If snapshot_id is NULL, generates an id of the form
snapshot_{YYYYmmdd_HHMMSS}_{4-hex} (v0.1.1 spec, appendix A section 3.1).
Timestamps are stored in UTC and normalized to ISO8601 ...Z form.
Errors:
ledgr_snapshot_existsifsnapshot_idalready exists.
Articles
Durable experiment stores:
vignette("experiment-store", package = "ledgr")
system.file("doc", "experiment-store.html", package = "ledgr")
Examples
db_path <- tempfile(fileext = ".duckdb")
con <- ledgr_db_init(db_path)
snapshot_id <- ledgr_snapshot_create(
con,
snapshot_id = "snapshot_20200101_000000_abcd"
)
snapshot_id
#> [1] "snapshot_20200101_000000_abcd"
DBI::dbDisconnect(con, shutdown = TRUE)