How to make BaseEntity.save() not to execute select query each time before update
Clash 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.