Correct way to deal with MySqlRawQueryResult
What is best practice to check if the data was created and how to get the newly added data?
db.insert(user).values({
firstname: data.data.firstname,
lastname: data.data.lastname,
username: data.data.username,
email: data.data.email,
password: hash
}).then((newUser) => {
//How do i check if the user was created?
}).catch((err) => {
return res.status(500).json(err)
})