Is there a better way to access enum types?

// the schema
export const MarketplaceIntegrationType = pgEnum('MarketplaceIntegrationType', [
  'Amazon',
  'Walmart',
  'Etsy',
  'Shopify'
]);
type: MarketplaceIntegrationType('type').notNull()

// the code
let integrationType: typeof marketplaceIntegrations.$inferSelect.type;

is there a better way to do this other than manually creating a type to use everywhere? its not very ergonomic to type this out like that

i can also do something like
(typeof MarketplaceIntegrationType.enumValues)[number]

but this sucks too
Was this page helpful?