Execute a Hrana JSON v3 pipeline
/v1/disks/{disk}/sqlite/{database}/hrana/v3/pipelineconst url = 'https://api.wabe.sh/v1/disks/demo/sqlite/mydb/hrana/v3/pipeline';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"requests":[{"type":"execute","stmt":{"sql":"SELECT 1 AS n"}},{"type":"close"}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.wabe.sh/v1/disks/demo/sqlite/mydb/hrana/v3/pipeline \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "requests": [ { "type": "execute", "stmt": { "sql": "SELECT 1 AS n" } }, { "type": "close" } ] }'SDK base /v1/disks/{disk}/sqlite/{database}/hrana/. Named databases are independent within a disk. Bearer authentication is required on every continuation. Transaction TTL defaults to 60 seconds, idle sessions outside a transaction to 30 seconds. The previous custom SQL and libsql URI routes are disabled. Protobuf, WebSocket and replication are outside this profile.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Example
demoProject disk name, or the disk ID in the actor runtime disk URL.
Example
mydbRequest Bodyrequired
Section titled “Request Bodyrequired”object
Omit or use null for a new session. Pass the latest baton to continue; the SDK rotates tokens. A cursor header baton becomes usable only after body EOF.
Operation payload follows the Hrana JSON v3 profile; execute has stmt, batch has batch.steps, SQL-cache operations use sql_id and SQL text.
object
Example
{ "requests": [ { "type": "execute", "stmt": { "sql": "SELECT 1 AS n" } }, { "type": "close" } ]}Responses
Section titled “Responses”Protocol results; statement errors can occur inside HTTP 200. SQL COMMIT acknowledges buffered state without an object-store flush. Cursor EOF alone does not commit an open transaction.
object
Omit or use null for a new session. Pass the latest baton to continue; the SDK rotates tokens. A cursor header baton becomes usable only after body EOF.
object
Successful operation result, including typed statement values or batch step results/errors.
object
object
Example
{ "baton": null, "base_url": null, "results": [ { "type": "ok", "response": { "type": "execute", "result": { "cols": [ { "name": "n", "decltype": null } ], "rows": [ [ { "type": "integer", "value": "1" } ] ], "affected_row_count": 0, "last_insert_rowid": null } } }, { "type": "ok", "response": { "type": "close" } } ]}Invalid names or protocol request.
Missing, invalid or revoked project API key, or an invalid runtime access token.
object
Actor runtime token does not authorize this disk or instance generation.
object
Invalid, expired, wrong-scope or retired-session baton.
SQL execution/admission/backpressure deadline expired.
Request or configured resource limit exceeded.
SQL execution unavailable or storage failure.