Closed Paul75 closed 4 years ago
@Paul75 could you clarify a bit by giving your entity definition and full query?
Hello,
I do this in repository :
public async findByLieuVie(): Promise<Usager[]> {
const query = this.createQueryBuilder('usager')
.select('COUNT(DISTINCT usager.cp) as nombre , SUBSTRING(usager.cp,1,2)', 'codePostal')
.groupBy('SUBSTRING(usager.cp,1,2)');
const result = await query.execute();
console.log('result vie nombre', result);
return result;
}
And When execute the api in POSTMAN for exemple or seeresult in console of firefox I see the good result into 'nombre' but into 'codePostal' have not see 75 but the two first crypted characters.....
Like :
[
[
{
"nombre": "25915",
"codePostal": "pM"
}
]
]
Thanks
Assuming cp
is the encrypted column -- the transformer kicks in AFTER the result is returned from the database. Complex queries won't work. To do complex queries on an encrypted field, your database would have to be in charge of encryption/decryption.
Closing since this seems like a non-issue.
Hello,
Thank you but therefore to carry out requests of this kind I cannot use your tool but in Mysql request manage decryption? So using your program can I not get the result? I understood well ?
Thank you
@Paul75 correct. Your use-case is currently not the goal of this project. For MySQL, I'd look into MySQL encryption data-at-rest.
Hello
When I do like this :
That return good number (nb) but the result is returned (cp) the two letters but not decrypred ... Exemple have in CP value 75011 (crypted: start by pM) and return pM not 75.
Thanks