-
Notifications
You must be signed in to change notification settings - Fork 49
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
add attribute converters for "standard" values #1381
Conversation
…ions of the word "standard")
A new generated diff is ready to view.
|
...mapper/dynamodb-mapper/common/src/aws/sdk/kotlin/hll/dynamodbmapper/values/ValueConverter.kt
Outdated
Show resolved
Hide resolved
...amodb-mapper/common/src/aws/sdk/kotlin/hll/dynamodbmapper/values/collections/MapConverter.kt
Outdated
Show resolved
Hide resolved
...mapper/common/src/aws/sdk/kotlin/hll/dynamodbmapper/values/collections/StringSetConverter.kt
Outdated
Show resolved
Hide resolved
...amodb-mapper/common/src/aws/sdk/kotlin/hll/dynamodbmapper/values/scalars/NumberConverters.kt
Outdated
Show resolved
Hide resolved
.../dynamodb-mapper/common/test/aws/sdk/kotlin/hll/dynamodbmapper/values/ValueConvertersTest.kt
Outdated
Show resolved
Hide resolved
...mapper/dynamodb-mapper/common/src/aws/sdk/kotlin/hll/dynamodbmapper/values/ValueConverter.kt
Outdated
Show resolved
Hide resolved
...amodb-mapper/common/src/aws/sdk/kotlin/hll/dynamodbmapper/values/collections/MapConverter.kt
Outdated
Show resolved
Hide resolved
...mapper/common/src/aws/sdk/kotlin/hll/dynamodbmapper/values/collections/StringSetConverter.kt
Outdated
Show resolved
Hide resolved
...amodb-mapper/common/src/aws/sdk/kotlin/hll/dynamodbmapper/values/scalars/NumberConverters.kt
Outdated
Show resolved
Hide resolved
.../dynamodb-mapper/common/test/aws/sdk/kotlin/hll/dynamodbmapper/values/ValueConvertersTest.kt
Outdated
Show resolved
Hide resolved
...er/common/src/aws/sdk/kotlin/hll/dynamodbmapper/values/smithytypes/DocumentValueConverter.kt
Outdated
Show resolved
Hide resolved
+ `fromAv`/`toAv` → `fromAttributeValue`→`toAttributeValue` + Commonizing string/char/chararray converters + Update number parsing to use non-nullable lambda types + Miscellaneous fixes and naming tweaks
A new generated diff is ready to view.
|
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.
Looks good, I like the DSL test setup
* Converts between potentially `null` values and | ||
* [DynamoDB `NULL` values](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.NamingRulesDataTypes.html#HowItWorks.DataTypes.Null). | ||
* Note that this class is a [SplittingConverter] and the logic for handling non-null values is undefined in this class. | ||
* Thus, it is typically used in conjunction with |
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.
nit: unfinished sentence
* Creates a [ValueConverter] which converts between number type [N] and | ||
* [DynamoDB `N` values](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.NamingRulesDataTypes.html#HowItWorks.DataTypes.Number) | ||
*/ | ||
public fun <N> numberConverter(numberToStringConverter: Converter<N, String>): ValueConverter<N> = |
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.
Should we capitalize this function name to match others?
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.
Yes, I was inconsistent here.
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.
nit: add metadata like description, module name
settings.gradle.kts
Outdated
plugins { | ||
id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0" | ||
} |
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.
What is this being used for?
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.
Whoops, that's an unintentional addition (I was using it on another branch for some debug). Removing!
…in KDocs, remove frivolous dependencies, add module metadata just like I asked of others
Quality Gate passedIssues Measures |
…lin (#1451) * initial poc commit of DynamoDB Mapper (#1232) * add support for Mapper initialization (#1237) * implement mapper pipeline (#1266) * initial implementation of codegen for low-level operations/types (#1357) * initial implementation of secondary index support (#1375) * Create new codegen module and refactor annotation processor to use it (#1382) * feat: add Schema generator Gradle plugin (#1385) * Fix plugin test package * add attribute converters for "standard" values (#1381) * fix: schema generator plugin test module (#1394) * feat: annotation processor codegen configuration (#1392) * feat: add `@DynamoDbIgnore` annotation (#1402) * DDB Mapper filter expressions (runtime components) (#1401) * feat: basic annotation processing (#1399) * add DSL overloads, paginators, and better builder integration for DDB Mapper ops codegen (#1409) * chore: split dynamodb-mapper-codegen into two modules (#1414) * emit DDB_MAPPER business metric (#1426) * feat: setup DynamoDbMapper publication (#1419) * DDB Mapper filter expressions (codegen components) (#1424) * correct docs * mark every HLL/DDBM API experimental (#1428) * fix accidental inclusion of expression attribute members in high-level DynamoDB Mapper requests (#1432) * Upgrade to latest build plugin version * fix: various issues found during testing (#1450) * chore: update Athena changelog notes for 1.3.57 (2024-10-18) release (#1449) * feat: update AWS API models * feat: update AWS service endpoints metadata * chore: release 1.3.60 * chore: bump snapshot version to 1.3.61-SNAPSHOT * feat: initial release of Developer Preview of DynamoDB Mapper for Kotlin * Fix Kotlin gradle-plugin version * fix: ddb mapper tests (#1453) * Bump build plugin version --------- Co-authored-by: Matas <lauzmata@amazon.com> Co-authored-by: aws-sdk-kotlin-ci <aws-kotlin-sdk-automation@amazon.com>
Issue #
Related to #472
Description of changes
This change fills out new
ValueConverter
implementations for "standard" types (using a somewhat arbitrary definition of the word "standard"). Specifically they include:String
,Int
,Boolean
, etc.List
,Map
, andSet
Url
,Document
, andInstant
I also introduced a
ValueConvertersTest
class to streamline unit testing with a DSL. I'll be interested to hear feedback on whether this is effective or if it just obscures things.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.