Skip to content
This repository was archived by the owner on Feb 23, 2020. It is now read-only.
This repository was archived by the owner on Feb 23, 2020. It is now read-only.

Provide converters for AttributeValueUpdate #2

@behos

Description

@behos

This will allow us to have stronly-typed updates

Not sure how we'd prefer to create it. We could offer an impl for each DynamoDBItem argument

#[derive(DynamoDBItem)]
struct MyItem {
    a: i32,
    b: String
}

impl MyItem {
    fn update_a(&self, operation: Option<AttributeAction>, value: i32) -> AttributeValueUpdate {
        ...
    }

    fn update_b(&self, operation: Option<AttributeAction>, value: String) -> AttributeValueUpdate {
        ...
    }
}

Alternatively we can return pairs of (String, AttributeValueUpdate) where String is the field name. We can then collect all of those updates into a HashMap to use for updates

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions