// already there
querybuilder
.[...]
.where('LOWER(users.email) = :email', { email: email.toLowerCase() });
// unsafe via repository, since params are unescaped:
repo.findOne({
where: {
email: Raw(alias => `LOWER(${alias}) = '${email.toLowerCase()}'`).
},
});
// would be nice to have:
repo.findOne({
where: {
email: Raw(alias => 'LOWER(${alias}) = :email', { email: email.toLowerCase() }),
},
});
const [result, total] = await this.findAndCount(
{
where: { title: Raw(alias => `LOWER(${alias}) Like '%${value}%'`) },
take: take,
skip: skip
}
);
return {
data: result,
count: total
}
출처
https://github.com/typeorm/typeorm/issues/1231
https://github.com/typeorm/typeorm/blob/master/docs/find-options.md
https://github.com/typeorm/typeorm/issues/4418
https://github.com/typeorm/typeorm/issues/3329
https://github.com/typeorm/typeorm/issues/2475