Skip to content

DDB HLL Bootstrap#4485

Open
aajtodd wants to merge 3 commits intofeat-ddb-mapperfrom
feat-ddb-mapper-bootstrap
Open

DDB HLL Bootstrap#4485
aajtodd wants to merge 3 commits intofeat-ddb-mapperfrom
feat-ddb-mapper-bootstrap

Conversation

@aajtodd
Copy link
Contributor

@aajtodd aajtodd commented Jan 20, 2026

Description

Bootstrap DDB mapper crates and add some of the core traits and types.

This is a POC implementation based on a working design.

Checklist

  • For changes to the smithy-rs codegen or runtime crates, I have created a changelog entry Markdown file in the .changelog directory, specifying "client," "server," or both in the applies_to key.
  • For changes to the AWS SDK, generated SDK code, or SDK runtime crates, I have created a changelog entry Markdown file in the .changelog directory, specifying "aws-sdk-rust" in the applies_to key.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@aajtodd aajtodd requested a review from a team as a code owner January 20, 2026 15:33
@github-actions
Copy link

A new generated diff is ready to view.

  • No codegen difference in the AWS SDK
  • Client Test (ignoring whitespace)
  • No codegen difference in the Server Test
  • No codegen difference in the Server Test Python
  • No codegen difference in the Server Test Typescript

A new doc preview is ready to view.

Copy link
Contributor

@ysaito1001 ysaito1001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left minor questions, but bootstrapping looks good 🚀


/// Converts this KeySpec to a HashMap suitable for DynamoDB API calls.
pub fn to_key_map(&self) -> HashMap<String, AttributeValue> {
let mut map = HashMap::new();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use with_capacity ?

}
}

/// Helper trait for creating KeySpec from partition-key-only tables.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Helper function rather than helper trait?

/// For converting complete structs to/from DynamoDB items, see [`ItemConverter`].
pub trait AttributeValueConvert: Clone + Send + Sync + 'static {
/// Converts this value to a DynamoDB AttributeValue.
fn to_attribute_value(&self) -> Result<AttributeValue, ConversionError>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: should there be into_attribute_value(self) -> Result<AttributeValue, ConversionError> like the Into trait? The implementers of this trait method in covert.rs internally clone incoming references anyway and AttributeValue is cloneable.


[dependencies]
aws-sdk-dynamodb = "1"
aws-smithy-types = "1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do (or will) we use this dependency (i.e. anything other than re-exports from aws-sdk-dynamodb)?

Copy link
Contributor

@landonxjames landonxjames left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Couple of questions, but nothing blocking

@@ -0,0 +1,17 @@
[package]
name = "aws-sdk-dynamodb-mapper"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we sold on dynamodb-mapper? I know thats what the Java library is called so maybe that is just the branding we go with. But I don't find it very descriptive. Is it an ORM? Is it more like serde-dynamo? I don't actually have a better name to suggest though so ¯_(ツ)_/¯

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's open ended but likely a point to be decided by the SEP.

* SPDX-License-Identifier: Apache-2.0
*/

//! AttributeValueConvert implementations for standard Rust types.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe worth having feature gated conversions for serde-dynamo types in here as well? Not necessary this early, but we probably should be thinking about how we will integrate with popular existing libraries.

/// Represents a complete DynamoDB key specification with attribute names and values.
#[derive(Debug, Clone)]
pub struct KeySpec {
partition_keys: Vec<(String, AttributeValue)>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We were already discussing the issue with too many allocations for DDB calls, wonder if this should be a slice just to not force more allocations? Probably a premature optimization at this point

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it affects quite a bit actually. Having a slice or even Cow here has a lot of fallout.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants