Zum Inhalt springen

Unbounded Query No Limit (ARCH3061)

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

Key typescript.orm.unbounded-query-no-limit · Severity warning · Category orm

Fetching an entire table with no LIMIT/pagination risks memory blowup on large tables when the result feeds a list or response. Always bound the query.

async function listUsers() {
return await userRepo.find(); // entire table
}
async function listUsers(page = 0, size = 50) {
return await userRepo.find({ skip: page * size, take: size });
}

Add take/limit and pagination to bound the number of rows fetched.