Chelabase
Data

Run a query

POST
/data/v1/query

Runs one operation (select, insert, update, delete or a function call), or a batch of them in order, in one transaction as the key's role. With a public key and a Chelabase-User token it runs as authenticated with the user's claims. Row-level security applies throughout.

Authorization

AuthorizationBearer <token>

A data API key (chk_pub_… or chk_sec_…) as Authorization: Bearer <key>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

One operation, or a batch of them, as a JSON tree. Unknown fields are rejected everywhere

One operation, or a batch of them, as a JSON tree. Unknown fields are rejected everywhere

database?string

The Postgres database to run in (1 to 63 bytes); the key's main database when left out

Length1 <= length <= 63
from*TableName

"name" (in the database's default schema) or "schema.name", matched exactly

Match^[^.]+(\.[^.]+)?$
limit?|

At most this many rows (the server caps it)

Range0 <= value
offset?|

Skip this many rows first

Range0 <= value
op*"select"

Value in

  • "select"
orderBy?array<>
select?array<|>|

The columns to return; every column when left out

Items1 <= items
v*1

The query language's version

Value in

  • 1
where?||||null

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/data/v1/query" \  -H "Content-Type: application/json" \  -d '{    "from": "string",    "op": "select",    "v": 1  }'
null