Skip to content
View Markdown

Execute a Hrana JSON v3 pipeline

POST/v1/disks/{disk}/sqlite/{database}/hrana/v3/pipeline
POST
/v1/disks/{disk}/sqlite/{database}/hrana/v3/pipeline
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.

disk
required
string
/^[A-Za-z0-9_-]{1,128}$/

Example

demo

Project disk name, or the disk ID in the actor runtime disk URL.

database
required
string
/^[A-Za-z0-9_-]{1,128}$/

Example

mydb
Media typeapplication/json
object
baton

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.

string | null
requests
required
Array<object>

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
type
required
string
Allowed values: execute batch sequence describe get_autocommit store_sql close_sql close

Example

{
"requests": [
{
"type": "execute",
"stmt": {
"sql": "SELECT 1 AS n"
}
},
{
"type": "close"
}
]
}

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.

Media typeapplication/json
object
baton
required

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.

string | null
base_url
required
string | null
results
required
Array<object>
object
type
required
Allowed values: ok error
response

Successful operation result, including typed statement values or batch step results/errors.

object
error
object
code
required
string
message
required
string
extended_code
string

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.

Media typeapplication/json
object
error
required
string
message
required
string

Actor runtime token does not authorize this disk or instance generation.

Media typeapplication/json
object
error
required
string
message
required
string

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.