How to get from the first array element in the sql query async/await?

Feature request:
let userData = await connection.query('SELECT ...', [id]);

I make a selection by one user, by its id. The output is: [ RowDataPacket { ... } ]
To get access to the object, I use the extra design:
if (userData && userData[0]) {
 userData = userData[0];
 }

How can I make life easier?
June 7th 19 at 14:50
1 answer
June 7th 19 at 14:52
Use ORM such as sequelize

Find more questions by tags JavaScriptNode.js