Schema to type

Hey guys, how do you make a schema item as a static type ?

for example, this thing:
export const orderItems = pgTable("orderItem", {
        product_id: serial("product_id").notNull(),
        order_id: serial("order_id").notNull(),
        quantity: integer("quantity")

    },
    (orderItems) => ({
            compoundKey: primaryKey(orderItems.product_id, orderItems.order_id),
        }
    ))

as

{
productId: number,
order_id: number,
quantity: number
}
Was this page helpful?