`returning` does not allow arguments according to typescript

Hi everyone, I'm seeing a weird typescript error while using the returning function on an insert query. I have the following code:
public async create(user: NewUser): Promise<User> {
const [createdUser] = await this.client
.insert(usersTable)
.values(user)
.returning({ ...defaultSelect });
if (createdUser == null) {
throw new Error("Unexpected 'undefined' return for user insert");
}

return createdUser;
}
public async create(user: NewUser): Promise<User> {
const [createdUser] = await this.client
.insert(usersTable)
.values(user)
.returning({ ...defaultSelect });
if (createdUser == null) {
throw new Error("Unexpected 'undefined' return for user insert");
}

return createdUser;
}
But I'm getting the error in the image. Has this happened to anyone else? According to the docs it's possible to pass an argument to returning. Thanks!
No description
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server