function query(queryObject, connection) {
    connection.sqlStatement = queryObject;

    return executeQuery(connection).then(dataSet => {
        let columnnames = [];
        let rows = [];

        if (dataSet && dataSet.length > 0) {
            // First row contains the column names
            columnnames = dataSet[0].Data.map(columnname => columnname.VarCharValue);

            // Loop through the remaining rows to extract data
            rows = dataSet.slice(1).map(row => row.Data.map(element => element.VarCharValue));
        }

        return {columnnames, rows};
    });
}
The following method will execute a query against the specified connection
@param {object} queryObject - The SQL to query against the connection
@param {object} connection - Connection parameters
@returns {Promise} that resolves to { columnnames, rows }