I am facing an issue while attempting to remove some data records from an entity. Typeorm does not seem to be utilizing the @Column definition of the entity, leading to an invalid SQL query:
@Entity('table')
export class TableEntity implements Table {
@Column({ name: 'user_id' })
@PrimaryColumn()
userId: number;
...
}
this.repository.delete({
userId: 1
})
DELETE FROM "table" WHERE "userId" = $1
instead of
DELETE FROM "table" where "user_id" = $1
which was my expectation. Can someone explain why this is happening?