tsynamo
tsynamo copied to clipboard
Add support for specifying IndexName in queries
Example:
const cmd = tsynamoClient
.query("myTable")
.keyCondition("userId", "=", "123")
.index("myIndex")
.compile();
compiles to QueryCommand with "IndexName": "myIndex"
The problem is, need to figure out how to täsä when using a secondary index. Tsynamo would need to know the secondary index partition and sort keys probably. Since only some attributes are projected from the main table to the index, tsynamo needs to know what attributes are available in the index.
Another unknown is if there is a need to differentiate GSI and LSI
https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/SecondaryIndexes.html
Or just yolo and #32 😄
Thanks for the issue! I will look into the index documentation.