Skip to content

Fix #10: PK for local secondary index must default to 'pk'#22

Merged
mvhenten merged 1 commit intomainfrom
fix-lsi-pk
Dec 3, 2025
Merged

Fix #10: PK for local secondary index must default to 'pk'#22
mvhenten merged 1 commit intomainfrom
fix-lsi-pk

Conversation

@mvhenten
Copy link
Owner

@mvhenten mvhenten commented Dec 3, 2025

No description provided.

Copilot AI review requested due to automatic review settings December 3, 2025 08:16
@mvhenten mvhenten enabled auto-merge (squash) December 3, 2025 08:17
@mvhenten mvhenten merged commit e050417 into main Dec 3, 2025
7 checks passed
@mvhenten mvhenten deleted the fix-lsi-pk branch December 3, 2025 08:17
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes issue #10 by ensuring that Local Secondary Indexes (LSI) in DynamoDB share the same partition key field name (pk) as the primary index, which is a requirement for LSI in DynamoDB.

Key Changes:

  • Added isLocalSecondaryIndex helper function to identify LSI indexes (lsi1-lsi5)
  • Modified field name generation logic to omit the index prefix for LSI partition keys
  • Added a demo example showing LSI usage with the byAge index

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/decorators/$index.ts Implements LSI partition key field name logic to ensure LSI indexes share the same pk field as the primary index
demo/main.tsp Adds example usage of Local Secondary Index (lsi1) for querying Person by age

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants