varPromise=require('bluebird/js/main/promise')()// use this syntax to be able to modify bluebird without affecting other users
varPromise=require('bluebird')
,EventEmitter=require('events').EventEmitter
,_then=Promise.prototype._then;
,proxyEventKeys=['success','error','sql']
,Utils=require('./utils')
,deprecatedSeen={}
,deprecated=function(message){
if(deprecatedSeen[message])return;
console.warn(message);
deprecatedSeen[message]=true;
};
/**
* A slightly modified version of bluebird promises. This means that, on top of the methods below, you can also call all the methods listed on the link below.
*
* The main difference is that sequelize promises allows you to attach a listener that will be called with the generated SQL, each time a query is run.
*
* The sequelize promise class works seamlessly with other A+/thenable libraries, with one exception.
* If you want to propagate SQL events across `then`, `all` calls etc., you must use sequelize promises exclusively.