-
Notifications
You must be signed in to change notification settings - Fork 31
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
de/serialize functions #86
Conversation
@@ -28,9 +28,37 @@ Dyno.multi = function(readConfig, writeConfig) { | |||
}; | |||
|
|||
var types = require('./lib/types'); | |||
Dyno.createSet = types.createSet; | |||
Dyno.toDynamoTypes = types.toDynamoTypes; | |||
Dyno.typesFromDynamo = types.typesFromDynamo; |
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.
@rclark, the only problem with removing typesFromDynamo is that dynamodb-replicator is currently calling dyno.getItem
with the wire-formatted Key that it reads from the kinesis stream. Since dyno.getItem
no longer supports wire-formatted inputs (ref #85 ), and we don't know the structure of the key beforehand, we'll have to call typesFromDynamo on the Key before calling dyno.getItem
with it. I imagine there are plenty of other use cases for it too.
cc/ @willwhite
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.
Caught this in mapbox/dynamodb-replicator@ce342ab by removing dyno from the lambda function entirely.
I'm on the fence about exposing these conversion functions. I'm with you in that I can imagine other use cases, but I'm leaning towards keeping them internal until some of those use-cases become clearly un-imaginary.
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.
Yeah, when I wrote this I hadn't seen mapbox/dynamodb-replicator@ce342ab, and I forgot about just using straight-up AWS SDK. We'll wait until other use cases arrive.
Changed CLI to use Dyno.serialize
cc @willwhite feel free to try and add more "tricky" cases to the test. The difficult part of all this is dealing with buffer objects, and turning them into round-tripable strings