Using
Streams the archive with HTTP Range support for resumable downloads.
applies to v0.5.1const url = 'https://example.com/store-api/backups/example/download';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://example.com/store-api/backups/example/download \ --header 'Authorization: Bearer <token>'The archive is NDJSON. Its first line is the manifest, format version 2:
format_version, id, created_at, luradb_version, scope,
include_auth, encoding, schedule, and
shards: data shards of the server that wrote it. Informational only: a restore places every domain by the shard count of the server it runs on, so an archive restores into any shard count.lsn_cut:{kv, json, rel}, per engine a write-ahead-log position that every write in the archive is at or below (a lower bound of the cut); 0 for an engine outside the scope. Positions keep growing across restarts, so they compare across runs of the server.kv_snapshot_ts,json_snapshot_ts,rel_snapshot_ts: per engine, the newest read-snapshot stamp among the data shards; 0 for an engine outside the scope.
All shards of one engine are read at one consistent cut: an archive that holds a write holds every write confirmed before it. The relational cut is taken before the KV and JSON cuts. Domain lines carry their domain’s name; sections follow in the order KV, JSON, relational, auth; the last line is the checksum.
A relational domain is a rel-domain line (name, created_at), then
its tables by creation, its views, and per table its rows and
AUTOINCREMENT state:
rel-table:domain,name,columns(eachname,typeas SQL type name,nullable,primary_key,autoincrement,unique, an optionaldefaultof{"kind": "null"},{"kind": "current_timestamp"}or{"kind": "literal", "value": …}, an optionalreferencesnaming the target table) andindexes(name,column,unique; every index under its stored name).rel-view:domain,name,sql, the stored SELECT text.rel-row:domain,table,row, every column by name, NULL asnull, KVREF/JSONREF links as stored.rel-seq:domain,table,hw: the next insert without a key getshw + 1.
Values are JSON numbers (INTEGER, REAL), booleans, strings (TEXT, KVREF,
JSONREF) and, for TIMESTAMP, integer milliseconds since the Unix epoch.
Archives of format version 1, which lack shards and lsn_cut, and
archives without relational lines remain restorable.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Backup id
Responses
Section titled “Responses”Full NDJSON archive
Partial content (Range request)
Invalid backup id
Backup not found
The backup job for this id is still running
Backup is disabled