Execute a Hrana JSON v3 cursor
/v1/disks/{disk}/sqlite/{database}/hrana/v3/cursorconst url = 'https://api.wabe.sh/v1/disks/demo/sqlite/mydb/hrana/v3/cursor';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"batch":{"steps":[{"stmt":{"sql":"SELECT 1 AS n"}}]}}'};
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/cursor \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "batch": { "steps": [ { "stmt": { "sql": "SELECT 1 AS n" } } ] } }'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.
object
object
One sql or sql_id, typed args or named_args, and optional want_rows (default true).
object
Hrana ok/error/not/and/or/is_autocommit condition; step references point to earlier steps.
Example
{ "batch": { "steps": [ { "stmt": { "sql": "SELECT 1 AS n" } } ] }}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.
Example
{"base_url":null,"baton":"YOUR_CURSOR_BATON"}{"type":"step_begin","step":0,"cols":[{"name":"n","decltype":null}]}{"type":"row","row":[{"type":"integer","value":"1"}]}{"type":"step_end","affected_row_count":0,"last_insert_rowid":null}{"type":"replication_index","replication_index":null}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.