Code Monkey home page Code Monkey logo

Comments (6)

generalpiston avatar generalpiston commented on June 13, 2024

@Paul75 could you clarify a bit by giving your entity definition and full query?

from typeorm-encrypted.

Paul75 avatar Paul75 commented on June 13, 2024

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

from typeorm-encrypted.

generalpiston avatar generalpiston commented on June 13, 2024

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.

from typeorm-encrypted.

generalpiston avatar generalpiston commented on June 13, 2024

Closing since this seems like a non-issue.

from typeorm-encrypted.

Paul75 avatar Paul75 commented on June 13, 2024

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

from typeorm-encrypted.

generalpiston avatar generalpiston commented on June 13, 2024

@Paul75 correct. Your use-case is currently not the goal of this project. For MySQL, I'd look into MySQL encryption data-at-rest.

from typeorm-encrypted.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.