typeorm-linq-repository icon indicating copy to clipboard operation
typeorm-linq-repository copied to clipboard

LOWER called on an enum value resulting in a pg error

Open ivanjd opened this issue 5 years ago • 0 comments

In the following query if I don't specify {matchCase: true} the lib tries to call LOWER() on the enum and pg throws an error. The enum is defined as follows:

issueRepo.getAll()
.where(i => i.status)
.equal(IssueStatus.Pending, {matchCase: true});
export enum IssueStatus{
  Pending = 'pending',
  Closed = 'closed',
  ...
}

And the property in the entity definition is decorated like that:

@Column({ type: 'enum', enum: IssueStatus})

This is a follow up of #85

BTW, it will be nice to have a setting that specifies if LOWER is called on strings in the first place. In all of my usecases calling LOWER is not needed.

ivanjd avatar Jan 03 '20 08:01 ivanjd