Make varchar field one of string union

I know that CHECK constraint hasn't been implemented yet, but I want to implement a Role field that is a varchar that can only be set to "user", "paid-user", or "admin" and I want the schema definition in TS to reflect this.

I know this wont set the constraint at the DB level, but I want to TS definition to reflect that only the above union of strings are valid. How can I tell drizzle that this field should be this specific TS type?

 role: varchar("role", { length: 50 }).notNull(), // user|paid-user|admin
Was this page helpful?