iasql icon indicating copy to clipboard operation
iasql copied to clipboard

Saving data from cloud to DB never updates existing records for non-mapper entities

Open dfellis opened this issue 3 years ago • 0 comments

Two solutions:

  1. Each mapper that has a top-level entity with references to these objects in lower levels needs to have special logic in their db.create and db.update mapper functions to identify these entities and check for duplicates themselves. Easier in the beginning, but scales poorly and prone to failure-by-omission
  2. The TypeORM wrapper gains the ability to do this automatically, but requires a declarative way to disambiguate and identify amongst all entities, accelerating the plans to remove the entityId functions and restore some decorators, but needs to cover all situations the functions now cover.

dfellis avatar Jan 22 '22 06:01 dfellis