Doron Torangy
DTDrizzle Team
•Created by Doron Torangy on 2/4/2024 in #help
Self referencing column breaks table type in typescript
I have the following table:
However typescript infers the type of
categoriesTable
as any
It's only when I remove .references(() => categoriesTable.id, { onDelete: 'set null' })
that typescript infers the type correctly
If so, how can I still create a self reference in this case?2 replies
DTDrizzle Team
•Created by Doron Torangy on 7/14/2023 in #help
Get type for select query?
Hey guys, is there a way to infer the "select" type for a given table? for example:
I have a
UsersService
class with getUsers
method. I want callers to be able to select specific columns.
Is is possible to achieve this type safety and autocomplete without directly using the drizzle client?6 replies