oharaandrew314 / dynamodb-kotlin-module

Kotlin Module for the dynamodb-enhanced SDk
Apache License 2.0
26 stars 3 forks source link

Support for DynamoDbVersionAttribute to enable Optimistic Locking #12

Closed emanodame closed 11 months ago

emanodame commented 12 months ago

I see there is no Kt annotation for DynamoDbVersionAttribute. Will you be able to add it ? Or any workarounds that can be applied to get this functionality?

oharaandrew314 commented 11 months ago

Seems reasonable. I'll look into adding support.

Is this a new annotation? Or have I just never noticed it?

emanodame commented 11 months ago

I believe it’s been around for a year or so. There’s a few annotations that are packaged with the DDB Enhanced client package that bring useful functionality.

Version annotation being one of them, you may also be interested in looking at DynamoDBAutoGeneratedTimestamp

emanodame commented 11 months ago

Also i recommend making the project more open for extension via dependency injection/ interfaces. Then it would be possible to customise and add these behaviours even if it is not fully supported.

Apart from this , thanks for this lib. This current is blocking my current team from using it but will definitely use it once this is fixed !

oharaandrew314 commented 11 months ago

I've rejigged the internals so that extensions are now supported. See this sample for an example. Make sure to register the extension to your enhanced client, like normal.