Query
Run or plan SQL queries against DynamoDB.
queryBefore You Start
- See Query Modes for when to use
executevsplanand what each response field means. - See Pagination for how to page through large result sets using
maxRowsandresumeIdx. - See Response Formats to choose between row arrays and key-value objects.
- See the SQL Reference for the full list of supported SQL features and current limitations.
Authentication
All requests require a bearer token obtained fromPOST /v1/auth/token. Pass it in the Authorization header:
query scope.Authorizations
Bearer token obtained from POST /v1/auth/token. Pass in the Authorization header as Bearer <token>.
Body
The SQL SELECT statement to execute or plan. DynamoSQL supports SELECT only; INSERT, UPDATE, DELETE, and DDL are not supported.
"execute" (default) runs the query and returns rows. "plan" returns the optimizer's plan without executing or consuming DynamoDB read capacity. API clients require the query scope.
execute, plan Response
Query succeeded or returned a structured query error envelope.
- Option 1
- Option 2
true when the request was processed without errors, false otherwise. Always present.
true - Option 1
- Option 2
- Option 3
{
"data": [
[1, "Alice", "alice@example.com"],
[2, "Bob", "bob@example.com"]
],
"columns": ["id", "name", "email"],
"firstRowIdx": 0,
"resumeIdx": 10,
"planTime": 3,
"execTime": 47
}Short error message. Present when success is false.
Extended error detail. For SQL parse errors, includes the parser's verbose message with line and column position. May be absent even when error is present.