OriginChainDB
Database endpoints

Query in a transaction

Runs a read-only query plan inside the transaction at its snapshot, including the transaction's own buffered writes.

POST /v1/tenants/{tenant}/tx/{tx_id}/query

Query the snapshot plus your pending writesThese reads do not make buffered writes visible to other transactions.
  1. Choose the transaction IDUse the transaction's existing read snapshot.
  2. Supply a read-only planQuery stored data plus this transaction's buffered changes.
  3. Read the returned rowsFinish the transaction separately with commit or rollback.

Before you start

Use your database bearer token.

Connection setup

Begin a transaction and replace TX_ID with its returned tx_id. Finish the transaction with commit or rollback.

Path parameters

FieldTypeRequired
tenantstringRequired
tx_idstringRequired

Headers

FieldTypeRequiredDescription
x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key.
x-oc-db-keystringOptionalAPI key of the x-oc-db-user user.

Request body

application/json

Limits and accepted values
  • A query plan tree tagged by op, e.g. {"op":"scan","schema":"ns.table"}, optionally wrapped in filter, project, sort, limit, distinct, aggregate, window, join, set-operation or CTE nodes.
  • Plans that read outside a full-table scan (index scans, count fast paths, graph traversals) and write plans are refused with 400.
FieldTypeRequired
opstringRequired

Read the result

rows includes data visible at the transaction's snapshot plus its own buffered writes. This does not mean those writes are committed or visible to another transaction.

Response statuses

HTTP status reference
StatusWhat to do
200OK
400Correct the request before retrying.
401Check the credential and Authorization header.
402Check feature access or available credits.
403Check tenant access, roles and permissions.
404Check the resource ID and API route.
409Resolve the conflict before retrying.
413Split or reduce the request body.
415Send the required Content-Type.
422Correct the values or unsupported combination.
429Honor Retry-After when present; back off.
499The client cancelled the request.
500Check the outcome before retrying a write.
501Check deployment support for this operation.
503Honor Retry-After when present; check write outcomes.
© 2026 Silicoyn Technologies Pvt Ltd