uuid's being inferred as strings

When I use InferModel on a table that has a uuid type, I see that the column gets inferred as a string instead of as a uuid type. Seems like the migrations are correctly using the native postgres uuid type, so confused why it's not being returned as a UUID
3 Replies
Dan
Dan2y ago
TypeScript doesn't have a dedicated type for UUID, so it's represented as a string.
NeonCop
NeonCopOP2y ago
hmmm so the right way to do it would be to use something like zod to validate / generate the typescript types? guessing this will make sense once Select schema goes live
Dan
Dan2y ago
It depends on your use case, but in general yes, the ORM doesn't validate the values you pass to it at runtime, only on type level
Want results from more Discord servers?
Add your server