Closed blazejkustra closed 2 months ago
In case you have any questions fell free to leave them here @afronski 👍
I'll add some e2e tests next week.
One remark: as in the proposed example, the original case from #30 looks good.
However, one of the allowed scenarios does not work:
export class TableUser extends Entity { @attribute.partitionKey.string() id: string; // --> This throws a "role mismatch" - and it's perfectly allowed as a reprojection for GSI. <-- // "Attribute "type" is decorated with a wrong role in "TableUser" Entity." @attribute.sortKey.string() @attribute.gsi.partitionKey.string({ indexName: 'index-1' }) type: string; @attribute.gsi.sortKey.string({ indexName: 'index-1' }) email: string; // ... }
Should be fixed with https://github.com/blazejkustra/dynamode/pull/31/commits/3edd9548bf2be21d1be998793c3d2ba874e80c69, great find! (I haven't used DynamoDB for a while so I forgot about this use case which is 100% valid)
@blazejkustra Thanks for the update - I rechecked the case presented above, and it works as expected now.
LGTM. 🙇
I'll add some e2e tests and merge this week. Thank you!
Update: I found one issue connected to entity metadata caused by this change 😢 I have to rethink how getEntityAttributes
is implemented but I have little time this week.
Turned out it is an edge case that I can fix in a different PR. Added remaining tests and merging now. Thanks @afronski for the review!
Summary:
Code sample:
Model
General
GitHub linked issue:
30
Type of change:
Is this a breaking change?
Other: