varchar but cast to typescript enum?

I have the following table:
export const Table = pgTable('table', {
  ...
  status: varchar('status', { length: 32 }).notNull(),
  ...


The type of this field will be string. I don't want to use a db enum, but I want to automatically define the type of this field as type STATUS, which is a TS enum.

How would I do this?
Was this page helpful?