DynamoDB Query Builder
Compose the whole Query or Scan request — table, index, key condition, filter, projection, Limit, sort order, consistent reads, and pagination — and copy a runnable AWS SDK v3, CLI, or boto3 program, or the PartiQL statement.
From access pattern to runnable request
The expression is rarely the whole job. A production Query also decides which index to read, how many items to evaluate per request, which direction the sort key runs, whether the read must be strongly consistent, and what happens when the response comes back with a LastEvaluatedKey. Those request-level parameters live outside the expression string — and they’re where copy-pasted snippets usually go wrong.
This builder treats the request as the unit of work. You compose the key condition, filter, and projection on top of the same typed, reserved-word-safe model our Expression Builder uses, then set the request options beside them. The output isn’t a fragment: it’s a program you can run — imports, client setup, the call itself, and, when you enable “Fetch all pages”, the ExclusiveStartKey loop that drains every page of results.
The generated code stays honest about each target. The AWS CLI paginates by itself, so its Limit becomes --page-size and a single-request run gets --no-paginate; PartiQL declines the parameters that belong to the ExecuteStatement API rather than the statement; and a descending Query becomes ORDER BY on your sort key where that’s expressible.
Only need the expression itself — a condition, filter, or update expression with its placeholder maps, for any of the six operations? The DynamoDB Expression Builder is built for exactly that. Deciding between the two read operations first? Query vs Scan breaks down when each one is the right call.
Frequently asked questions
How is this different from the DynamoDB Expression Builder?
They split the problem deliberately. The Expression Builder is about expression syntax — key conditions, filters, update and condition expressions with their ExpressionAttributeNames/Values maps — across all six operations, and it emits the bare command. The Query Builder is about the complete Query or Scan request: table and index, key condition, filter, projection, plus the request-level parameters the expression tool doesn’t expose (Limit, sort order, ConsistentRead, ExclusiveStartKey), and it emits a runnable program with client setup and an optional pagination loop.
What does Limit actually limit in a Query or Scan?
Limit caps how many items DynamoDB evaluates per request, not how many matching items you get back. Filters run after the read, so a Query with Limit 25 and a FilterExpression can return fewer than 25 items — or none — while still consuming the read capacity of everything it evaluated, and pagination continues from LastEvaluatedKey. In the AWS CLI, which paginates automatically, the same parameter is set with --page-size.
How does DynamoDB pagination (LastEvaluatedKey) work?
A Query or Scan response that has more data includes a LastEvaluatedKey — the primary key of the last item read. You pass it back as ExclusiveStartKey on the next request and repeat until a response arrives without one. Turn on “Fetch all pages” and the generated SDK v3 and boto3 programs contain exactly that loop; the AWS CLI follows the pages by itself unless you pass --no-paginate.
When can I use a strongly consistent read?
ConsistentRead works on base tables and local secondary indexes, but not on global secondary indexes — a Query against a GSI with ConsistentRead set is rejected. A strongly consistent read also consumes twice the read capacity of an eventually consistent one. It’s an API parameter rather than part of the PartiQL statement text, which is why the PartiQL tab declines it honestly.
Is anything I enter here uploaded anywhere?
No. This is a static page: the request is composed and the code generated entirely in your browser, so table names, key values, and filters never reach a server. “Copy link” packs the whole request into the URL — sharing that link is the only way anything you typed leaves the page, and it’s in your hands.