Using
Executes exactly one LuraSQL statement against `domain` and returns its typed result. `expand` resolves REFERENCES columns of a SELECT into embedded objects (or `"*"` for every REFERENCES column).
applies to v0.5.1const url = 'https://example.com/store-api/rel/example/sql';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"expand":["example"],"params":[{}],"sql":"example"}'};
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://example.com/store-api/rel/example/sql \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "expand": [ "example" ], "params": [ {} ], "sql": "example" }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Relational domain
Request Bodyrequired
Section titled “Request Bodyrequired”object
REFERENCES columns to resolve into embedded objects, or ["*"] for
all of them. Only valid for SELECT; non-empty on DML/DDL → 400.
Positional parameters (JSON array), bound to the ? placeholders.
Omitted ⇒ empty array.
object
Exactly one LuraSQL statement (more → 400 MultipleStatements).
Example generated
{ "expand": [ "example" ], "params": [ {} ], "sql": "example"}Responses
Section titled “Responses”Statement result. Shape depends on the statement class — DDL: {“ok”:true}; INSERT/UPDATE/DELETE: {“affected”,“last_pk”}; SELECT: {“columns”:[{“name”,“type”}],“rows”:[[…]],“row_count”,“limit_applied”,“expanded”?}. rows are arrays (not objects) so same-named JOIN columns don’t collide.
object
Example generated
{}Syntax, type, parameter-count, or expand error
Access level too low for this statement
Domain, table, column, or index not found
Conflict — duplicate key, unique violation, name collision, …
Domain is being deleted
Response exceeds max_response_bytes
Per-domain request budget exceeded
Relational engine disabled
Insufficient Storage — disk space or memory runs short; the write was not applied. Reads go on; retry after the seconds in Retry-After.