Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SplitKey type for subindexing in token query service #719

Merged
merged 3 commits into from
May 29, 2024

Conversation

James-Mart
Copy link
Member

@James-Mart James-Mart commented May 23, 2024

  • Adds the SplitKey type to the token query service to allow subindexing on indices with a struct key
  • Eliminates redundant token table indices

@James-Mart James-Mart added the Dev Experience Related to the experience of developers label May 23, 2024
@James-Mart James-Mart requested a review from swatanabe May 23, 2024 20:58
@James-Mart James-Mart changed the title Add split key Add SplitKey type for subindexing May 23, 2024
Comment on lines 275 to 285
/// A split key is used to specify a subindex on indices with a struct key.
///
/// For example, a primr
/// Warning: No type checking! It's up to the user to ensure that T + Rest
/// is equivalent to the primary key)
template <typename Rest, typename T>
struct SplitKey
{
T value;
};

Copy link
Collaborator

Choose a reason for hiding this comment

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

The reason I suggested SplitKey is that it's non-intrusive. If we're adding this to the main Table.hpp header, a better solution would be to add an overload of subindex that takes an explicit type.
subindex<Rest>(key)

Copy link
Member Author

Choose a reason for hiding this comment

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

I decided to make this non-intrusive rather than try to figure out how to implement your subindex idea

@James-Mart James-Mart changed the title Add SplitKey type for subindexing Add SplitKey type for subindexing in token query service May 24, 2024
@Velua Velua mentioned this pull request May 29, 2024
@James-Mart James-Mart merged commit 83afce6 into main May 29, 2024
4 checks passed
@James-Mart James-Mart deleted the add-split-key branch May 29, 2024 14:50
@James-Mart James-Mart added System app Related to system services and their apps/plugins and removed Dev Experience Related to the experience of developers labels May 30, 2024
@James-Mart James-Mart changed the title Add SplitKey type for subindexing in token query service Add SplitKey type for subindexing in token query service May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
System app Related to system services and their apps/plugins
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants