-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Closed
Description
Issue type:
[ ] question
[x] bug report
[ ] feature request
[ ] documentation issue
Database system/driver:
[x] all
TypeORM version:
[x] latest
[ ] @next
[ ] 0.x.x (or put your version here)
Steps to reproduce or a small repository showing the problem:
If you add a transformer to a column which serializes the property value to the desired format, this transformation is not considered in SubjectChangedColumnsComputer and the column is always marked as changed if you are working with a complex object type for the column which is serialized to string for example.
export interface MyComplexType {
foo: string;
bar: number;
xy: Date;
}
export const myTransformer: ValueTransformer = {
from: dbValue => {
const parsed = (dbValue || '').split(',');
return { foo: parsed[0], bar: +parsed[1] || undefined };
},
to: entityValue => `${entityValue.foo},${entityValue.bar}`
};
@Entity('foo')
export class Foo {
@PrimaryGeneratedColumn({ type: 'int' })
readonly id: number;
@Column('text', { transformer: myTransformer })
transformed: MyComplexType;
}Why is column.getEntityValue() not called with the transform flag to true in computeDiffColumns of SubjectChangedColumnsComputer?
kiwikern, geotry, julientregoat, deanshelton913, shayded-exe and 1 more
Metadata
Metadata
Assignees
Labels
No labels