Skip to content

Commit fff9e0b

Browse files
committed
Completed the work
1 parent 43a3a64 commit fff9e0b

File tree

8 files changed

+2285
-1
lines changed

8 files changed

+2285
-1
lines changed

docs/patterns/database-patterns/ddb-basic-operations.md

+21-1
Original file line numberDiff line numberDiff line change
@@ -309,4 +309,24 @@ pub async fn get_items(
309309
</CH.Code>
310310
</CH.Section>
311311

312-
## Running the Sample
312+
## Running the Sample
313+
314+
All of the above operations are available in the sample code found [./templates](https://github.com/serverlessdevelopers/serverless-rust/tree/main/templates/patterns/database-patterns/ddb-basic-operations/). You will find [client building](#creating-a-client) in addition to models, errors and a main function that will execute all of the examples.
315+
316+
In order to execute the code, make sure that you have three things configured:
317+
318+
1. An AWS Account with a DynamoDB created with just a partition key defined as `id`.
319+
2. Access locally to read/write/delete items from that DynamoDB table.
320+
3. An environment variable called `TABLE_NAME` set to the table name created in item 1.
321+
322+
When running the same, you'll see the following occur.
323+
324+
- A loop is run 100 times
325+
- An item is created
326+
- Then it is fetched
327+
- Every 10 items the UpdateItem operation is executed on the `updated_at` field
328+
- At the very end, the table is scanned and items are printed back out to the console
329+
330+
## Congratulations
331+
332+
Congratulations, you've seen how to establish a new Client with DDB and Rust in addition to the basic data plane operations. More to come on Pagination, Transactions and BatchItem Operations.

0 commit comments

Comments
 (0)