Right now a lot of our codebase uses samples such as the one below.
var results = await query('SELECT * FROM something');
What this does is actually return an array with our results[] inside of it, along with our field data. We don't want this, and this can cause some issues when checking if results.length > 0 (which it always will be).
We need to change all occurences to
var [results] = await query('SELECT * FROM something');
So we strip the extra data we don't want, preventing some headaches in the future.
Right now a lot of our codebase uses samples such as the one below.
What this does is actually return an array with our results[] inside of it, along with our field data. We don't want this, and this can cause some issues when checking if results.length > 0 (which it always will be).
We need to change all occurences to
So we strip the extra data we don't want, preventing some headaches in the future.