script
unanchored
d1-export-table-json
Export any D1 table to JSON via wrangler.
d1backupexportcloudflare
Body
param([string]$db="helios-ledger",[string]$table="records",[string]$out="backup.json",[string]$limit="10000")\nSet-Location "$env:USERPROFILE\\HELIOS\\helios-worker"\n$sql="SELECT * FROM $table LIMIT $limit"\n$raw=npx wrangler d1 execute $db --command $sql --remote --json 2>&1\n$data=$raw|ConvertFrom-Json\n$data[0].results|ConvertTo-Json -Depth 5|Out-File $out -Encoding utf8\nWrite-Output "Exported $($data[0].results.Count) rows to $out"
Provenance
Cryptographic details
| id | reg_d1_backup |
| content sha256 | b5cbfcdf9c54b0f846e94fc215569914a8ac4db1d4fb3f697fdd9668b8358840 |
Execute via API
POST /api/execute
{ "ref": "reg_d1_backup" }
// or by hash prefix:
{ "ref": "b5cbfcdf9c54b0f8" }
Resolves this artifact by hash — deterministic, provenance-proven. Generation cost is zero when the hash exists.