How to make BaseEntity.save() not to execute select query each time before update

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



How to make BaseEntity.save() not to execute select query each time before update



When using typeorm I noticed, that each time I make a change entity and call save() it makes 'Select' query beforehand.
How to get rid of it?



For example, I call:


const entity = await Entity.findOne( where: foo: 'bar')
entity.biz = 2;
await entity.save()



And as I can see in query log it first makes a 'Select' call for 'findOne' - receives an entity, and then before save calls another 'Select' searching again for entity by id and after that performs update().









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

Creating a leaderboard in HTML/JS