-
Notifications
You must be signed in to change notification settings - Fork 870
Add support for DynamoDBAutoGeneratedTimestampAttribute and DynamoDbUpdateBehaviorAttribute #3892
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development
Are you sure you want to change the base?
Add support for DynamoDBAutoGeneratedTimestampAttribute and DynamoDbUpdateBehaviorAttribute #3892
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see the code paths updated for the batch and transact write operations.
sdk/src/Services/DynamoDBv2/Custom/DataModel/ContextInternal.cs
Outdated
Show resolved
Hide resolved
Transact write operation is updated and there is an integration test added - Test_AutoGeneratedTimestampAttribute_TransactWrite_Simple Batch write operation does not offer support for autogenerated values as the operation does not support update expressions and this behavior is consistent with the Java SDK as well as DynamoDBVersionAttribute. |
after testing, looks like Batch write operation on Java SDK it offers support for autogenerated timestamps and ignores the DynamoDbUpdateBehavior. I will update the implementation to cover this. |
autogenerated timestamp implementation updated to cover also batch write operation |
Add
Description
New Attributes:
[DynamoDBAutoGeneratedTimestamp]
and[DynamoDbUpdateBehavior]
[DynamoDBAutoGeneratedTimestamp]
Automatically sets the property to the current UTC timestamp (DateTime.UtcNow
) on item save.[DynamoDbUpdateBehavior]
Specifies the update behavior for a property when performing DynamoDB update operations. This attribute can be used to control whether a property is always updated, only updated if not null.Update Behavior Modes:
IfNotExists
: Set the value only when the item is created.Always
: Set the value on both create and update.Usage:
Motivation and Context
Testing
unit and integration tests added
Screenshots (if appropriate)
Types of changes
Checklist
License