Skip to content

Read Only Tracking Not Disabled (ARCH3054)

Key typescript.orm.readonly-tracking-not-disabled · Severity warning · Category orm

When a read-only query loads fully tracked, hydrated entities, the identity-map and change-tracking cost is wasted. Use a lighter read mode.

const users = await userRepo.find({ where: { active: true } });
return users.map(u => ({ id: u.id, name: u.name })); // read only
const users = await userRepo.find({
where: { active: true },
select: { id: true, name: true },
});
return users; // lightweight, untracked read

Use a lightweight read mode (AsNoTracking/.values()/select/lean) for read-only queries.