Table definition to TS type

Is it possible to get a TS type from a Drizzle Schema Table definition?
Something like this:
export const users = pgTable('user', {
    id: text('id')
        .primaryKey()
        .$default(() => `${Math.random()}`),
    name: text('name'),
    email: text('email').notNull(),
    emailVerified: timestamp('emailVerified', { mode: 'date' }),
    image: text('image')
})

👆 would convert to 👇
type User = {
  id: string
  name: string
  email: string
  emailVerified: string
  image: string
}
Was this page helpful?