Skip to content
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

Support reading/writing typed structs in DynamoDB #72

Closed
cbroglie opened this issue Jan 30, 2015 · 5 comments
Closed

Support reading/writing typed structs in DynamoDB #72

cbroglie opened this issue Jan 30, 2015 · 5 comments
Labels
feature-request A feature should be added or improved. needs-review This issue or pull request needs review from a core team member.

Comments

@cbroglie
Copy link

Instead of making callers deal with items of the form map[string]dynamodb.AttributeValue, it's convenient to be able to read and write typed structs.

I previously implemented a solution for goamz (AdRoll/goamz#276), and the same approach will work as both projects use similar types (compare https://github.com/awslabs/aws-sdk-go/blob/master/gen/dynamodb/dynamodb.go#L334 to https://github.com/AdRoll/goamz/blob/master/dynamodb/dynamizer/dynamizer.go#L18).

Happy to look into porting over my changes if there is interest in a similar solution.

@lsegal lsegal added the feature-request A feature should be added or improved. label Jan 30, 2015
@justonia
Copy link

justonia commented Feb 3, 2015

I haven't done a deep comparison between my solution and your goamz one. Barring bugs I am unaware of, mine supports the same semantics as encoding/json -- eg nested types, pointer fields, etc. I do not support int or string sets yet mapping into attribute values. How does that compare to what you have implemented so far?

@cbroglie
Copy link
Author

cbroglie commented Feb 3, 2015

My version doesn't support sets either as the intention was to map to and from structs representing JSON documents, and there is no built in representation of sets.

It supports all the JSON struct tags since it leverages encoding/json to do some of the marshalling.

Overall the implementations look fairly similar to me.

@cdunn
Copy link

cdunn commented Feb 4, 2015

+1 on this add. currently using the marshaling on goamz

@tgross
Copy link

tgross commented Feb 7, 2015

@cbroglie given my comment in AdRoll/goamz#308 (comment), I'd be happy to help out on this ticket here in any way I can.

cbroglie pushed a commit to cbroglie/aws-sdk-go that referenced this issue Feb 14, 2015
This is just an initial implementation, and it doesn't include support
for advanced functionality like conditional operations. As such, the
API will likely need to change. But it's a first step towards
simplifying reading/writing typed objects from DynamoDB (see aws#72)
@cbroglie
Copy link
Author

Closing since #231 was merged

@diehlaws diehlaws added needs-review This issue or pull request needs review from a core team member. and removed review-needed labels Jan 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved. needs-review This issue or pull request needs review from a core team member.
Projects
None yet
6 participants