Allow TimestampNowField to output TTL for DynamoDB #101
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds the following options to the TimestampNowField transformer:
All of these options have sane defaults to ensure backward compatibility.
The idea behind the first two is that DynamoDB expects a TTL value per item inserted.
The idea behind the last option is that the current implementation outputs time since epoch in milliseconds. DynamoDB expects a TTL value in Unix time, which is the time since epoch in seconds.
The current
ValidEnum
andConfigUtils::getEnum
don't agree with each other on which field to use for theChronoUnit
enum. One usesChronoUnit::name
the other uses the enum value.We could handle this on 2 ways.
ValidChronoUnit
to connect-utils this would mean we use values like "DAYS".ValidEnum
andConfigUtils::getEnum
play nice withChronoUnit
this would mean we use values like "Days"From my limited experience with adding my own enum for the target type, it seems option 1 would be more in line with existing things.