loading…
Commons
workflow unanchored 1× executed

backup-all-d1-tables

Export all known tables from helios-ledger D1 to dated JSON files.

d1backupexportall-tablesworkflow
by anon · created 2025-05-08

Body

param([string]$outDir="$env:USERPROFILE\\backups\\$(Get-Date -Format yyyyMMdd)")\nNew-Item -ItemType Directory -Force $outDir|Out-Null\nSet-Location "$env:USERPROFILE\\HELIOS\\helios-worker"\n$tables=@("records","merkle_tree","accounts","chatlog","commons_stamps","commons_registry","commons_members","hemo_accounts","hemo_ledger")\nforeach($t in $tables){\n  $raw=npx wrangler d1 execute helios-ledger --command "SELECT * FROM $t" --remote --json 2>&1\n  try{\n    $data=($raw|ConvertFrom-Json)[0].results\n    $out=Join-Path $outDir "$t.json"\n    $data|ConvertTo-Json -Depth 10|Out-File $out -Encoding utf8\n    Write-Output "Backed up $t ($($data.Count) rows)"\n  }catch{Write-Output "SKIP $t"}\n}

Provenance

Cryptographic details
idreg_wf_backup_d1_all
content sha256f39dcc0f34908cdf14a38d5d2abfa9f1160ceba3456475e3ac6bf75689cab05b

Execute via API

POST /api/execute
{ "ref": "reg_wf_backup_d1_all" }
// or by hash prefix:
{ "ref": "f39dcc0f34908cdf" }

Resolves this artifact by hash — deterministic, provenance-proven. Generation cost is zero when the hash exists.

← registry