Node/MySQL2/bluebird promises not working
<p>I have the following code:</p>

<pre><code>var Promise = require('bluebird');
var mysql = require('mysql2/promise');

var pool = mysql.createPool({
host: 'localhost',
user: 'root',
password: 'root',
database: 'crux'
});

Database.prototype.listProjects = function () {
    return getConnection()
        .then(function (connection) {
            return connection.query('SELECT * FROM project');
        })
};

function getConnection() {
    return pool.getConnection().disposer(function (connection, promise) {
        connection.release();
    });
}
</code></pre>

<p>But when I run this I get this error:</p>

<pre><code>TypeError: pool.getConnection(...).disposer is not a function
    at getConnection (...
    at Database.listProjects(...
    .... 
</code></pre>

<p>I've been trying to follow the sample code on the MySQL2 github site. But I cannot see why this is not working. <code>pool.getConnection()</code> seems to be returning a promise as far as I can tell.</p>

<p>Anyone done code like this? </p>