不要怂,就是干,撸起袖子干!

Commit a9158201 by Ruben Bridgewater

Deprecate the query-chainer

1 parent 99ea44d8
# Next
- [BUG] Enable standards conforming strings on connection in postgres. Adresses [#3545](https://github.com/sequelize/sequelize/issues/3545)
- [BUG] instance.removeAssociation(s) do not fire the select query twice anymore
- [BUG] Error messages thrown by the db in languages other than english do not crash the app anymore (mysql, mariadb and postgres only) [#3567](https://github.com/sequelize/sequelize/pull/3567)
- [FEATURE] All querys can be logged individually by inserting `logging: fn` in the query option.
- The query-chainer is deprecated and will be removed in version 2.2. Please use promises instead.
# 2.0.6
- [BUG] Don't update virtual attributes in Model.update. Fixes [#2860](https://github.com/sequelize/sequelize/issues/2860)
......
......@@ -409,7 +409,7 @@ module.exports = (function() {
var self = this
, attributes = this.tableAttributes;
return Promise.resolve().then(function () {
return Promise.try(function () {
if (options.force) {
return self.drop(options);
}
......
'use strict';
var Utils = require(__dirname + '/utils');
var Utils = require(__dirname + '/utils')
, deprecatedSeen = {}
, deprecated = function(message) {
if (deprecatedSeen[message]) return;
console.warn(message);
deprecatedSeen[message] = true;
};
module.exports = (function() {
/**
......@@ -12,6 +18,8 @@ module.exports = (function() {
var QueryChainer = function(emitters) {
var self = this;
deprecated('The query chainer is deprecated, and due for removal in v. 2.2. Please use promises (http://sequelize.readthedocs.org/en/latest/api/promise/) instead!');
this.finishedEmits = 0;
this.emitters = [];
this.serials = [];
......
......@@ -5,11 +5,16 @@ var chai = require('chai')
, expect = chai.expect
, Support = require(__dirname + '/support')
, QueryChainer = require('../../lib/query-chainer')
, CustomEventEmitter = require('../../lib/emitters/custom-event-emitter');
, CustomEventEmitter;
chai.config.includeStack = true;
describe(Support.getTestDialectTeaser('QueryChainer'), function() {
before(function() {
CustomEventEmitter = require('../../lib/emitters/custom-event-emitter');
});
beforeEach(function() {
this.queryChainer = new QueryChainer();
});
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!