Code Generator
Turn the query you just ran into a ready-to-paste snippet for Node.js, Python, Java, C#, Go, Ruby, PHP or the AWS CLI, or generate a complete CRUD example for the table.
Opening the generator
Click </> Code in the toolbar with a table open. The Code Generator dialog shows a language tab strip, a mode switch, an info bar and a Copy button. Node.js and Current Query are selected each time it opens.
| Tab | Library |
|---|---|
| Node.js | AWS SDK for JavaScript v3 with the DocumentClient (ESM, top-level await) |
| Python | boto3 Table resource, or execute_statement for PartiQL |
| Java | AWS SDK for Java v2 |
| C# | AWSSDK.DynamoDBv2, async |
| Go | aws-sdk-go-v2 |
| Ruby | aws-sdk-dynamodb |
| PHP | aws/aws-sdk-php v3 with Marshaler |
| AWS CLI | aws dynamodb scan, query or execute-statement |
Current Query mode
The snippet reproduces whatever is in the Filters panel right now, with the connection’s region baked in. The info bar badge tells you which operation it reflects: SCAN, QUERY or PARTIQL.
- Scan — table name, Limit equal to the page size, and the filter expression with its attribute names and values. Node.js, Python and the AWS CLI carry the full filter; other languages emit the table name and limit.
- Query — the key condition exactly as DynamoOps built it, including the sort-key operator, between bounds and the index name when one is selected.
- PartiQL — the statement text passed to ExecuteStatement.
import { DynamoDBClient } from "@aws-sdk/client-dynamodb";
import { DynamoDBDocumentClient, QueryCommand } from "@aws-sdk/lib-dynamodb";
const client = DynamoDBDocumentClient.from(new DynamoDBClient({ region: "us-east-1" }));
const result = await client.send(new QueryCommand({
TableName: "orders",
IndexName: "status-index",
KeyConditionExpression: "#pk = :pkval",
ExpressionAttributeNames: { "#pk": "status" },
ExpressionAttributeValues: { ":pkval": "shipped" },
Limit: 50,
}));
console.log(result.Items);Full CRUD mode
Switch the mode to Full CRUD for a self-contained example file per language that creates, reads by key, lists, updates and deletes items in the open table, with the correct key names and placeholder values typed to match the schema. Install hints for each package manager are embedded as comments.
Tips
- Run the query first so the snippet reflects a working access pattern, then copy it into a test.
- Values that look numeric in the Query form are emitted as numbers, mirroring what DynamoOps sent to AWS.
- Snippets use the region of the active connection; replace it or read it from the environment in your code.
- The
Copybutton copies the visible snippet only. Switch tabs to copy another language.