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?
5 Replies
What is your dialect? Mysql?
Mysql / MariaDB @angelelz
I believe for insert it would be
newUser[0].affectedRows === 1
and afterwards i can just get it by
const user = newUser[0]
?No, you either use the data you used in the insert statement or do a select afterwards
Mysql doesn't return the date you just inserted