Today you need to do it like this.
There must be a better solution that doesn't need getConnection().
const db = require('larvitdb');
db.pool.getConnection(function(err, dbCon) {
const sql = 'SELECT * FROM users WHERE username LIKE ' + dbCon.escapeId(postData);
dbCon.query(sql, function(err, rows) {
dbCon.release(); // Always release your connection when the query is done
if (err)
throw err;
});
});
Today you need to do it like this.
There must be a better solution that doesn't need getConnection().