Replies: 2 comments
-
Hey @anmolint! Slonik properly emits an array for built-in types, but for any custom enum array, values are returned as This is where the Type Parsers come into play. You can pass these in the You can simply set your type parser to:
I wish this wasn't necessary, but unfortunately it is 😅 |
Beta Was this translation helpful? Give feedback.
-
I would suggest looking into const assertions everywhere you are using TS enums as the latter are fraught with gotchas. https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-4.html#const-assertions With zod you then use |
Beta Was this translation helpful? Give feedback.
-
Hi , I have been working on sloink for my personal project and found it quite helpful but I have a question
I have a table defined as
with alert_channel defined as
when running a fetch query
the client errors out telling it did not receive the correct data
the zod schema is defined as
where enum is defined as
the query
but this results in error from alert_channel any help appreciated thanks 😄
Beta Was this translation helpful? Give feedback.
All reactions