Skip to content

feat(Indexes): getIndexKey, getIndexValues#215

Merged
agviegas merged 3 commits into
ThatOpen:mainfrom
ShaMan123:feat/index-values
May 29, 2026
Merged

feat(Indexes): getIndexKey, getIndexValues#215
agviegas merged 3 commits into
ThatOpen:mainfrom
ShaMan123:feat/index-values

Conversation

@ShaMan123
Copy link
Copy Markdown
Contributor

@ShaMan123 ShaMan123 commented May 14, 2026

Description

Expose getIndexKey so it is easy to get a single key given its index
Expose getIndexValues so it is easy to run inverse lookups using getInverseIndexEntry

Additional context


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following:

  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Follow the Conventional Commits v1.0.0 standard for PR naming (e.g. feat(examples): add hello-world example).
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@ShaMan123 ShaMan123 changed the title feat(Indexes): getIndexValue feat(Indexes): getIndexValue May 14, 2026
Copy link
Copy Markdown
Contributor Author

@ShaMan123 ShaMan123 left a comment

Choose a reason for hiding this comment

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

What do you think about making the methods generic so that:

model.getIndexValues<string>(indexName) satisfies string[]

See #224

This was referenced May 21, 2026
@ShaMan123 ShaMan123 changed the title feat(Indexes): getIndexValue feat(Indexes): getIndexValues May 23, 2026
@ShaMan123 ShaMan123 changed the title feat(Indexes): getIndexValues feat(Indexes): getIndexKey, getIndexValues May 23, 2026
@agviegas agviegas merged commit a2d945f into ThatOpen:main May 29, 2026
agviegas added a commit that referenced this pull request May 29, 2026
Add generic type params to the index read methods so callers no longer
need manual casts. Extends the generics to the getIndexKey/getIndexValues
helpers from #215, keeps getInverseIndexEntry's nullable return honest,
and fixes a latent getValues type error.

Co-Authored-By: ShaMan123 <34343793+ShaMan123@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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