Closed purkhusid closed 9 months ago
There may be a possible issue with ambiguity as to which index corresponds to a query, but I think we should be able to determine the correct one based on the query expression. Do you want to have a go at doing a PR - maybe do some query expression tests to try and verify queries select the correct inverted index?
I'll try to find some time soon to take a look at this then.
I'm trying to create a table that has a GSI with the Hash key and Sort key inverted.
The way I would do it is that I have the following record:
This fails when doing a query by the GSI hash key and sort key because of this check: https://github.com/purkhusid/FSharp.AWS.DynamoDB/blob/710558033727f9cab1a7c1917146fc1cb5c5485b/src/FSharp.AWS.DynamoDB/TableContext.fs#L80-L80
I don't see any reason for not allowing this type of record since this is a very common thing to do with DynamoDB.
I could take a stab at fixing this if you would be OK with the change.