TJBlackman
Explore posts from serversDTDrizzle Team
•Created by TJBlackman on 5/14/2024 in #help
Make varchar field one of string union
An enum is saved in the DB as an integer, correct? I'm using postgres...
6 replies
DTDrizzle Team
•Created by TJBlackman on 5/14/2024 in #help
Make varchar field one of string union
Thank you both! I am choosing to use the
pgEnum
feature.6 replies
DTDrizzle Team
•Created by 균어 on 3/15/2024 in #help
how to get generic table type
This might help you
https://orm.drizzle.team/docs/goodies
Also, you might have to pass in the expected return type as a generic:
const result = await findById<UserTableType[]>(id, usersTable);
imo, your function is too generic you should just make getById
functions for each of your tables. getUserById
getPostById
etc..2 replies