Nodejs async/await mysql query select ... problem!

hello comm, here my problem i have an async function that have to return the rows from my sql query i do => const rows = await sql.query(query); i get a result but not result rows but a bunch of data about the query what im doing wrong ! this function should wait for the sql query return … thanks for help

// getting tx pending list from db
async function getTxPendingList() {
    let error = null;

    const sql = Mysql.createConnection({
        host: 'localhost',
        user: 'root',
        password: 'password',
        database: 'royalnim'
    });
    sql.on('error', function (err) {
        error = err;
        console.log('ERROR => ' + err);
    });
    await sql.connect();

    try {
        const query = "SELECT * FROM transactions WHERE `state` = 'pending'";
        const rows = await sql.query(query);
        return rows;
    } catch (err) {
        console.log('ERROR => ' + err);
        return err;
    } finally {
        sql.end();
    }
}

ok i find the solution for my problem here if the can help other… i was using mysql module but i find with mysql2/promise module its work just perfect here the code … more clean and readable

const Mysql = require('mysql2/promise');

const sql = Mysql.createPool({
    host: 'localhost',
    user: 'root',
    password: 'password',
    database: 'royalnim',
    waitForConnections: true,
    connectionLimit: 100,
    queueLimit: 0
});

// getting tx pending list from db
async function getTxPendingList() {
    try {
        const query = "SELECT * FROM transactions WHERE `state` = 'pending'";
        const rows = await sql.query(query);
        return rows[0];
    } catch (err) {
        console.log('ERROR => ' + err);
        return err;
    }
}