vikstrous/dataloadgen

Loading values which do not have comparable indices

Opened this issue · 1 comments

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](...)

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?