Records
CRUD over any table plus the list grammar — projections, filters, full text, nearest-vector, geo radius, ordering and cursor paging — every value bound, never spliced into a statement.
A table's records are the surface's core resource:
| method | path | answers |
|---|---|---|
| GET | /v1/{ns}/{db}/tables/{t}/records | {"records": [{"id", …fields}], "after"?: cursor} |
| POST | same | 201 {"record": {…}} — the record as stored, defaults applied |
| GET | …/records/{id} | 200 {"record": {…}} or 404 |
| PATCH | …/records/{id} | merge — unnamed fields are kept; 200 {"record"} |
| PUT | …/records/{id} | replace — unnamed fields are dropped; 200 {"record"} |
| DELETE | …/records/{id} | 200 {"deleted": true} |
The PATCH/PUT split is the language's own merge-versus-replace rule wearing HTTP verbs. Reach for PATCH when your object is a patch; PUT when it is the whole record — a form that reposts three of a record's five fields with PUT deletes the other two.
A record id is checked as grammar (letters, digits, _ and -); anything else
in a body or a query value is bound as a parameter after the statement is
read, so a value that looks like syntax stays a string:
curl -H "Authorization: Bearer $TOKEN" \
'http://127.0.0.1:8000/v1/app/main/tables/orders/records' \
-X POST -H 'Content-Type: application/json' \
-d '{"note": "a'"'"'; DROP TABLE orders; --"}'
# stored as one string; nothing runs
The list grammar
GET …/records takes the query as parameters, every value percent-encoded:
select=f1,f2— a projection.where=field:op:value— repeatable, conditions ANDed. Ops:eq ne gt gte lt lte like ilike in null not-null none not-none. A string value is a TessariQL string literal (single quotes, the lexer's escape set); a number is itself.search=field:term— full text over an analysed field; the term is bound.nearest=field:metric:[…]— the exact vector order,metricone ofcosine euclidean. Conflicts withorderandafter(400): a nearest read is already ordered.within=field:lat,lon,radius_m— a geo radius read.order=field.asc/order=field.desc,limit=n(default 100, ceiling 1000),after=<cursor>.
curl -H "Authorization: Bearer $TOKEN" \
'http://127.0.0.1:8000/v1/app/main/tables/orders/records?where=total:gte:5&where=tenant:eq:'"'"'a'"'"'&order=total.desc&limit=10'
A full page answers an after cursor — the bare id of the last record. Pass
it back to continue; a counted offset does not exist here on purpose, because
a counted page shifts under a concurrent insert and page 500 would do five
hundred pages of work.
An unknown parameter or operator is a 400 naming it and the closed set —
the grammar refuses rather than guesses, so a typo'd filter never quietly
reads the whole table.
What the answers carry
A create answers the record as stored — defaults filled, server fields
minted — so a client never has to guess what landed. Reads run through your
session like everything else: a table your grants do not reach is a 404,
and a row guard narrows the listing exactly as it narrows a SELECT.