-
const [record] = await db
.select({
...user,
})
.from(user) i was trying to spread every columns to select function. No matter how hard I looked, I couldn't find a way. Is there a reason why it's not supported or any other good way? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
@binochoi if you trying to select all field you don't need to pass anything in the select function, just leave it be. The schema obj contain not just the table collumn but also some other table meta data, if you want to use the schema obj you have to destructoring the it and select only the table fields |
Beta Was this translation helpful? Give feedback.
Drizzle has a helper function for this.
getTableColumns