ยฉ 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Teamโ€ข3y agoโ€ข
2 replies
Matoslav

Compare enums in select

I want to compare enum from my
offer
offer
schema with query parameter (that is basically string).

export const offerType = pgEnum('type', ['SEARCH']);
export const offerType = pgEnum('type', ['SEARCH']);


query used in
where
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?
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Enums
Drizzle TeamDTDrizzle Team / help
2y ago
Enums
Drizzle TeamDTDrizzle Team / help
3y ago
I need help with Enums in Drizzle.
Drizzle TeamDTDrizzle Team / help
2y ago
Subquery in select
Drizzle TeamDTDrizzle Team / help
3y ago