I have a function that keeps returning an undefined object every time I call the function. I was wondering if there is a specific way of solving this problem. In index.js, I am calling the sqlQuery.getItem method and expecting it to return a row from the db however it returns undefined each time.
index.js
'use strict';
const Alexa = require('alexa-sdk');
const mysql = require('promise-mysql');
const querydb = require('./sqlQuery.js');
var testSQL = 'SELECT uWeight, uHeight from users where pin=1100';
//querydb.getItem(testSQL);
var values = querydb.getItem(testSQL);
if(values == undefined){
    console.log('Error');
}
else{
    console.log(values);
}
databaseConnection.js
var mysql = require('promise-mysql');
pool = mysql.createPool({
    host: "mytrainerdb.cbh07n2xwds2.us-east-1.rds.amazonaws.com",
    database: "trainerdb",
    user: "user",
    password: "password"
});
function getSqlConnection() {
  return pool.getConnection().disposer(function(connection) {
    pool.end(connection);
  });
}
module.exports = getSqlConnection;
sqlQuery.js
var Promise = require("bluebird");
var getSqlConnection = require('./databaseConnection');
var hello = "hello";
function getItem(sql){
    Promise.using(getSqlConnection(), function(connection) {
        return connection.query(sql).then(function(rows) {
            console.log(rows[0]);
            return (rows[0]);         
        }).catch(function(error) {
          return (error);
        });
    })
}
module.exports.getItem = getItem;
 
    