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

Loading values which do not have comparable indices #13

Open
KevinJTaylor opened this issue May 1, 2024 · 1 comment
Open

Loading values which do not have comparable indices #13

KevinJTaylor opened this issue May 1, 2024 · 1 comment

Comments

@KevinJTaylor
Copy link

Basically it is difficult to create a loader for an index which is not comparable such as github.com/google/uuid. I believe I need to convert the uuid to/from a string and when loading data (via a query), unless I am missing something?

Loader[KeyT comparable, ValueT any]

NewLoader[KeyT comparable, ValueT any](...)
@vikstrous
Copy link
Owner

The keys have to be comparable because they are used as map keys to deduplicate requests. But the uuid type is [16]byte, so it should be comparable https://pkg.go.dev/github.com/google/uuid#UUID. Which type are you running into issues with?

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

No branches or pull requests

2 participants