Compare enums in select

I want to compare enum from my offer schema with query parameter (that is basically string). export const offerType = pgEnum('type', ['SEARCH']); query used in where statement: eq(offers.type, query.type) error from nestjs server:
[Nest] 6660 - 06. 07. 2023, 19:22:57 ERROR [ExceptionsHandler] invalid input syntax for type integer: "SEARCH"
error: invalid input syntax for type integer: "SEARCH"
[Nest] 6660 - 06. 07. 2023, 19:22:57 ERROR [ExceptionsHandler] invalid input syntax for type integer: "SEARCH"
error: invalid input syntax for type integer: "SEARCH"
How am I supposed to check equality of enum and string in my select query?
1 Reply
NinjaBunny
NinjaBunny2y ago
can you show the code that you’re running? and the types for query?
Want results from more Discord servers?
Add your server