Shortcut for .returning()

Is there a shortcut for .returning() where there's only one table I'm selecting from? I write:
.returning({
id: userSchema.id,
email: userSchema.email,
username: userSchema.username,
name: userSchema.name,
})
.returning({
id: userSchema.id,
email: userSchema.email,
username: userSchema.username,
name: userSchema.name,
})
would prefer to write:
.returning({ id, email, username, name})
// or
.returning([ 'id', 'email', 'username', 'name'])
.returning({ id, email, username, name})
// or
.returning([ 'id', 'email', 'username', 'name'])
2 Replies
Angelelz
Angelelz12mo ago
.returning({ ...getTableColumns(userSchema) })
Angelelz
Angelelz12mo ago
Drizzle ORM - next gen TypeScript ORM
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.
Want results from more Discord servers?
Add your server