Open C45tr0 opened 6 years ago
Not sure whats up with the coverage. I'll try and look into it. Any suggestions would be helpful.
It seems that this change would also effect attributes that use -
, _
, .
, and0-9
which are otherwise permissible keys. I think this is an unintended consequence that would effect people using keys like user-name
who do not want to have the -
encoded this way. Am I reading this right?
AWS Naming Rules: http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.NamingRulesDataTypes.html
@dangerginger No, this does not transform the key actually stored in the database. It affects the alias that is used to reference a key in a projection/query expression.
Basically, it escapes key names that AWS does not permit to appear bare in an expression (ProjectionExpression
, FilterExpression
, etc.). Note that we apply this process to every key already, because some words are reserved in DynamoDB expressions, and quoting every key prevents reserved word errors without us having to maintain a matching set of reserved words.
Applying this transformation to everything but ASCII letters is simple, easy to verify, and does not affect the operation nor the results of the query in any observable way, except that it will work in more cases than simply stripping out unacceptable characters (because two distinct keys could become equal by simply stripping out unacceptable characters, and then we have a name collision).
Ok I'm good with this one. @C45tr0 any last thoughts? If not let's get this merged.
Do I just need to rebase this and we are good? Sorry, didn't see the responses on here.
@C45tr0 I left a code comment above pointing out a possible cleaned key collision scenario.
@cdhowie are you talking about the comment from your PR? https://github.com/clarkie/dynogels/pull/37#issuecomment-331222837
Sorry, if I am just over looking it, but I do not see a code comment in this pr. Also, referring to the collisions, the test added does do some checks of the specific scenario you pointed out. Of course adding more would be good, but not sure of other scenarios at this time.
Is there something I can do to help get this merged?
Hey, this bug fix is not merged yet?
Update to #37 to include Document paths