Skip to contents

Restores an audit_trail() previously saved with write_trail(). The file format is detected automatically from the file extension (.rds for RDS, .json for JSON), or can be specified explicitly via format.

Usage

read_trail(file, format = NULL)

Arguments

file

Path to an RDS or JSON file created by write_trail().

format

One of "rds", "json", or NULL (default). When NULL, the format is inferred from the file extension.

Value

A reconstructed audit_trail() object with all S3 classes restored.

Examples

trail <- audit_trail("example")
mtcars |> audit_tap(trail, "raw")
tmp <- tempfile(fileext = ".rds")
write_trail(trail, tmp)
restored <- read_trail(tmp)
print(restored)
#> 
#> ── Audit Trail: "example" ──────────────────────────────────────────────────────
#> Created: 2026-03-24 12:14:32
#> Snapshots: 1
#> 
#>   #  Label  Rows  Cols  NAs  Type
#>   ─  ─────  ────  ────  ───  ────
#>   1  raw      32    11    0  tap