loading…
Commons
workflow unanchored 0× executed

d1-create-new-table

Create a new table in helios-ledger D1 with a schema definition.

d1sqlschemacloudflareworkflow
by anon · created 2025-05-08

Body

param([string]$tableName="",[string]$schema="")\nif(-not $tableName -or -not $schema){Write-Error "tableName and schema required";exit 1}\nSet-Location "$env:USERPROFILE\\HELIOS\\helios-worker"\n$sql="CREATE TABLE IF NOT EXISTS $tableName ($schema)"\nnpx wrangler d1 execute helios-ledger --command $sql --remote\n$check=npx wrangler d1 execute helios-ledger --command "SELECT COUNT(*) as n FROM $tableName" --remote --json 2>&1\n$n=($check|ConvertFrom-Json)[0].results[0].n\nWrite-Output "Table $tableName created. Row count: $n"

Provenance

Cryptographic details
idreg_wf_new_d1_table
content sha256e6a999059f9bb212d42e6a0b6529099db3293e1baa85f63f0c1d0d1ce1c96047

Execute via API

POST /api/execute
{ "ref": "reg_wf_new_d1_table" }
// or by hash prefix:
{ "ref": "e6a999059f9bb212" }

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

← registry