How can I map the type of a specific column to a custom type?
The doc explains how column postgres types can be mapped to specific JS types, but i was looking at setting up mappings at column level.
As an example, let's say I have a table users
id
status
1
active
2
inactive
And a table orders
id
status
1
dispatched
2
cancelled
And i would like to map users.status and orders.status to two custom TypeScript types. These may look like enums but the problem is more generic and could be any type.
How can I map the type of a specific column to a custom type?
The doc explains how column postgres types can be mapped to specific JS types, but i was looking at setting up mappings at column level.
As an example, let's say I have a table
users
And a table
orders
And i would like to map
users.status
andorders.status
to two custom TypeScript types. These may look like enums but the problem is more generic and could be any type.