We have existing code that basically use the following pool object from mysql:
var mysql = require('mysql');
var pool = mysql.createPool(connectionParams);
pool.query(...);
And we added orm to the same project:
app.use(orm.express(myConfig, {
define: function(db, models, next) {
db.settings.set('query.debug', true);
models.User = new User(db);
next();
}
}));
I'm to find a solution to share the mysql connection without migrating all existing code over. Is there a way that I can either:
Get the pool object from the orm db object (I can't seem to find it), or
create a pool object from the orm db object to share the same connection?
Thanks in advance!