loadManyToManyRelationIdsAndGroup returns undefined related
for existing entities
#7152
Open
2 of 22 tasks
Labels
Issue Description
Until yesterday all of our entities had an integer id. Now, some of them do have an UUID instead. So, their id property is of type string and saved in a BIN(16) column. In order to query an UUID entity, we need to transform the UUID string into a Buffer. Sadly TypeORM does not do that on querying relations (having a binary id) but we can work around that by, among other places, using a transformer in the entity.
Since we do use a DataLoader, we use
RelationIdLoader#loadManyToManyRelationIdsAndGroup
to perform batch loading.Expected Behavior
Using
RelationIdLoader#loadManyToManyRelationIdsAndGroup
should give us the related entities of the given UUID entities, as it still works for entities with an integer id (not needing a transformer).Actual Behavior
The
related
property ofRelationIdLoader#loadManyToManyRelationIdsAndGroup
`s return value is undefined for every entity, since the transformer is not applied for the ids (see first comment in this issue).My Environment
Relevant Database Driver(s)
MariaDB
aurora-data-api
aurora-data-api-pg
better-sqlite3
cockroachdb
cordova
expo
mongodb
mysql
nativescript
oracle
postgres
react-native
sap
sqlite
sqlite-abstract
sqljs
sqlserver
Are you willing to resolve this issue by submitting a Pull Request?
The text was updated successfully, but these errors were encountered: