Get plain typescript type from enum
Hi,
I am working on a NestJS + Drizzle app and I have the following in my schema:
Elsewhere in my code, I am writing a NestJS service that aims to resolve a user based on their current session cookie and I'd like to return the following type:
Is there a way to somehow make the
Ideally in this scenario, I'd have
I am working on a NestJS + Drizzle app and I have the following in my schema:
Elsewhere in my code, I am writing a NestJS service that aims to resolve a user based on their current session cookie and I'd like to return the following type:
Is there a way to somehow make the
permissions field always have a type in sync with the pgEnum? I tried InferColumnType but that clearly isn't correctIdeally in this scenario, I'd have
permissions be the following type: "admin"|"moderator"|"user"|"banned" but of course derived somehow from the original enum declaration