wod
Explore posts from serverswhere array_field has enum value
Hello there 👋
Today I'm experimenting with kysely, coming from prisma. I got stuck on rewriting the first query
I have a
ShippingMethod
table with stores
field, which is array of Store
enum
I have this prisma query, filtering shipping methods which have Store.PUBLIC
in the stores
array field:
Could anyone please guide me on how to achieve the same with kysely and postgresql dialect?
I've found this can be achieved in postgresql using ANY(stores)
, but I wasn't able to build the query (https://commandprompt.com/education/how-to-check-if-postgresql-array-contains-a-value/).
Thanks in advance! 🙏8 replies