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

Commit 27a67a99 by Mick Hansen

Revert "Feature #488 : Added benchmarking support in query logs"

1 parent 59ddc4b8
# 3.17.0 # 3.17.0
- [CRITICAL] Fixed injection vulnerability for order/limit - [CRITICAL] Fixed injection vulnerability for order/limit
- [FIXED] MySQL throws error when null GEOMETRY data results in empty buffer [#4953](https://github.com/sequelize/sequelize/issues/4953) - [FIXED] MySQL throws error when null GEOMETRY data results in empty buffer [#4953](https://github.com/sequelize/sequelize/issues/4953)
- [ADDED] Support for benchmarking the execution time for SQL queries [#488](https://github.com/sequelize/sequelize/issues/488)
# 3.16.0 # 3.16.0
- [ADDED] PostgreSQL tsrange (Range of timestamp without time zone) data type support. - [ADDED] PostgreSQL tsrange (Range of timestamp without time zone) data type support.
......
...@@ -3,8 +3,7 @@ ...@@ -3,8 +3,7 @@
var Utils = require('../../utils') var Utils = require('../../utils')
, AbstractQuery = require('../abstract/query') , AbstractQuery = require('../abstract/query')
, sequelizeErrors = require('../../errors.js') , sequelizeErrors = require('../../errors.js')
, parserStore = require('../parserStore')('mssql') , parserStore = require('../parserStore')('mssql');
, microtime = require('microtime');
var Query = function(connection, sequelize, options) { var Query = function(connection, sequelize, options) {
this.connection = connection; this.connection = connection;
...@@ -31,14 +30,7 @@ Query.prototype.run = function(sql, parameters) { ...@@ -31,14 +30,7 @@ Query.prototype.run = function(sql, parameters) {
var self = this; var self = this;
this.sql = sql; this.sql = sql;
//do we need benchmark for this query execution
var benchmark = this.sequelize.options.benchmark || this.options.benchmark;
if (!benchmark) {
this.sequelize.log('Executing (' + (this.connection.uuid || 'default') + '): ' + this.sql, this.options); this.sequelize.log('Executing (' + (this.connection.uuid || 'default') + '): ' + this.sql, this.options);
} else {
var queryBegin = microtime.now();
}
var promise = new Utils.Promise(function(resolve, reject) { var promise = new Utils.Promise(function(resolve, reject) {
// TRANSACTION SUPPORT // TRANSACTION SUPPORT
...@@ -71,11 +63,6 @@ Query.prototype.run = function(sql, parameters) { ...@@ -71,11 +63,6 @@ Query.prototype.run = function(sql, parameters) {
var results = []; var results = [];
var request = new self.connection.lib.Request(self.sql, function(err) { var request = new self.connection.lib.Request(self.sql, function(err) {
if (benchmark) {
self.sequelize.log('Executed (' + (self.connection.uuid || 'default') + '): ' + self.sql + ' in ' + (microtime.now() - queryBegin) + 'μs', self.options);
}
if (err) { if (err) {
err.sql = sql; err.sql = sql;
reject(self.formatError(err)); reject(self.formatError(err));
......
...@@ -3,8 +3,7 @@ ...@@ -3,8 +3,7 @@
var Utils = require('../../utils') var Utils = require('../../utils')
, AbstractQuery = require('../abstract/query') , AbstractQuery = require('../abstract/query')
, uuid = require('node-uuid') , uuid = require('node-uuid')
, sequelizeErrors = require('../../errors.js') , sequelizeErrors = require('../../errors.js');
, microtime = require('microtime');
var Query = function(connection, sequelize, options) { var Query = function(connection, sequelize, options) {
this.connection = connection; this.connection = connection;
...@@ -27,22 +26,10 @@ Query.prototype.run = function(sql, parameters) { ...@@ -27,22 +26,10 @@ Query.prototype.run = function(sql, parameters) {
var self = this; var self = this;
this.sql = sql; this.sql = sql;
//do we need benchmark for this query execution
var benchmark = this.sequelize.options.benchmark || this.options.benchmark;
if (!benchmark) {
this.sequelize.log('Executing (' + (this.connection.uuid || 'default') + '): ' + this.sql, this.options); this.sequelize.log('Executing (' + (this.connection.uuid || 'default') + '): ' + this.sql, this.options);
} else {
var queryBegin = microtime.now();
}
var promise = new Utils.Promise(function(resolve, reject) { var promise = new Utils.Promise(function(resolve, reject) {
self.connection.query(self.sql, function(err, results) { self.connection.query(self.sql, function(err, results) {
if (benchmark) {
self.sequelize.log('Executed (' + (self.connection.uuid || 'default') + '): ' + self.sql + ' in ' + (microtime.now() - queryBegin) + 'μs', self.options);
}
if (err) { if (err) {
err.sql = sql; err.sql = sql;
......
...@@ -5,8 +5,7 @@ var Utils = require('../../utils') ...@@ -5,8 +5,7 @@ var Utils = require('../../utils')
, QueryTypes = require('../../query-types') , QueryTypes = require('../../query-types')
, Promise = require('../../promise') , Promise = require('../../promise')
, sequelizeErrors = require('../../errors.js') , sequelizeErrors = require('../../errors.js')
, _ = require('lodash') , _ = require('lodash');
, microtime = require('microtime');
var Query = function(client, sequelize, options) { var Query = function(client, sequelize, options) {
this.client = client; this.client = client;
...@@ -63,14 +62,7 @@ Query.prototype.run = function(sql, parameters) { ...@@ -63,14 +62,7 @@ Query.prototype.run = function(sql, parameters) {
, query = ((parameters && parameters.length) ? this.client.query(this.sql, parameters) : this.client.query(this.sql)) , query = ((parameters && parameters.length) ? this.client.query(this.sql, parameters) : this.client.query(this.sql))
, rows = []; , rows = [];
//do we need benchmark for this query execution
var benchmark = this.sequelize.options.benchmark || this.options.benchmark;
if (!benchmark) {
this.sequelize.log('Executing (' + (this.client.uuid || 'default') + '): ' + this.sql, this.options); this.sequelize.log('Executing (' + (this.client.uuid || 'default') + '): ' + this.sql, this.options);
} else {
var queryBegin = microtime.now();
}
var promise = new Promise(function(resolve, reject) { var promise = new Promise(function(resolve, reject) {
query.on('row', function(row) { query.on('row', function(row) {
...@@ -90,11 +82,6 @@ Query.prototype.run = function(sql, parameters) { ...@@ -90,11 +82,6 @@ Query.prototype.run = function(sql, parameters) {
}); });
query.on('end', function(result) { query.on('end', function(result) {
if (benchmark) {
self.sequelize.log('Executed (' + (self.client.uuid || 'default') + '): ' + self.sql + ' in ' + (microtime.now() - queryBegin) + 'μs', self.options);
}
if (receivedError) { if (receivedError) {
return; return;
} }
......
...@@ -6,8 +6,7 @@ var Utils = require('../../utils') ...@@ -6,8 +6,7 @@ var Utils = require('../../utils')
, AbstractQuery = require('../abstract/query') , AbstractQuery = require('../abstract/query')
, QueryTypes = require('../../query-types') , QueryTypes = require('../../query-types')
, sequelizeErrors = require('../../errors.js') , sequelizeErrors = require('../../errors.js')
, parserStore = require('../parserStore')('sqlite') , parserStore = require('../parserStore')('sqlite');
, microtime = require('microtime');
var Query = function(database, sequelize, options) { var Query = function(database, sequelize, options) {
this.database = database; this.database = database;
...@@ -85,14 +84,7 @@ Query.prototype.run = function(sql, parameters) { ...@@ -85,14 +84,7 @@ Query.prototype.run = function(sql, parameters) {
this.sql = sql; this.sql = sql;
} }
//do we need benchmark for this query execution
var benchmark = this.sequelize.options.benchmark || this.options.benchmark;
if (!benchmark) {
this.sequelize.log('Executing (' + (this.database.uuid || 'default') + '): ' + this.sql, this.options); this.sequelize.log('Executing (' + (this.database.uuid || 'default') + '): ' + this.sql, this.options);
} else {
var queryBegin = microtime.now();
}
promise = new Promise(function(resolve) { promise = new Promise(function(resolve) {
var columnTypes = {}; var columnTypes = {};
...@@ -103,11 +95,6 @@ Query.prototype.run = function(sql, parameters) { ...@@ -103,11 +95,6 @@ Query.prototype.run = function(sql, parameters) {
} else { } else {
resolve(new Promise(function(resolve, reject) { resolve(new Promise(function(resolve, reject) {
var afterExecute = function(err, results) { var afterExecute = function(err, results) {
if (benchmark) {
self.sequelize.log('Executed (' + (self.database.uuid || 'default') + '): ' + self.sql + ' in ' + (microtime.now() - queryBegin) + 'μs', self.options);
}
if (err) { if (err) {
err.sql = self.sql; err.sql = self.sql;
reject(self.formatError(err)); reject(self.formatError(err));
......
...@@ -992,7 +992,7 @@ Model.prototype.sync = function(options) { ...@@ -992,7 +992,7 @@ Model.prototype.sync = function(options) {
}); });
return Promise.map(indexes, function (index) { return Promise.map(indexes, function (index) {
return self.QueryInterface.addIndex(self.getTableName(options), _.assign({logging: options.logging, benchmark: options.benchmark}, index), self.tableName); return self.QueryInterface.addIndex(self.getTableName(options), _.assign({logging: options.logging}, index), self.tableName);
}); });
}).then(function () { }).then(function () {
if (options.hooks) { if (options.hooks) {
...@@ -1006,7 +1006,6 @@ Model.prototype.sync = function(options) { ...@@ -1006,7 +1006,6 @@ Model.prototype.sync = function(options) {
* @param {Object} [options] * @param {Object} [options]
* @param {Boolean} [options.cascade=false] Also drop all objects depending on this table, such as views. Only works in postgres * @param {Boolean} [options.cascade=false] Also drop all objects depending on this table, such as views. Only works in postgres
* @param {Function} [options.logging=false] A function that gets executed while running the query to log the sql. * @param {Function} [options.logging=false] A function that gets executed while running the query to log the sql.
* @param {Boolean} [options.benchmark=false] Print query execution time in microseconds when logging SQL.
* @return {Promise} * @return {Promise}
*/ */
Model.prototype.drop = function(options) { Model.prototype.drop = function(options) {
...@@ -1025,7 +1024,6 @@ Model.prototype.dropSchema = function(schema) { ...@@ -1025,7 +1024,6 @@ Model.prototype.dropSchema = function(schema) {
* @param {Object} [options] * @param {Object} [options]
* @param {String} [options.schemaDelimiter='.'] The character(s) that separates the schema name from the table name * @param {String} [options.schemaDelimiter='.'] The character(s) that separates the schema name from the table name
* @param {Function} [options.logging=false] A function that gets executed while running the query to log the sql. * @param {Function} [options.logging=false] A function that gets executed while running the query to log the sql.
* @param {Boolean} [options.benchmark=false] Print query execution time in microseconds when logging SQL.
* @return {this} * @return {this}
*/ */
Model.prototype.schema = function(schema, options) { // testhint options:none Model.prototype.schema = function(schema, options) { // testhint options:none
...@@ -1059,7 +1057,6 @@ Model.prototype.schema = function(schema, options) { // testhint options:none ...@@ -1059,7 +1057,6 @@ Model.prototype.schema = function(schema, options) { // testhint options:none
* *
* @param {Object} [options] The hash of options from any query. You can use one model to access tables with matching schemas by overriding `getTableName` and using custom key/values to alter the name of the table. (eg. subscribers_1, subscribers_2) * @param {Object} [options] The hash of options from any query. You can use one model to access tables with matching schemas by overriding `getTableName` and using custom key/values to alter the name of the table. (eg. subscribers_1, subscribers_2)
* @param {Function} [options.logging=false] A function that gets executed while running the query to log the sql. * @param {Function} [options.logging=false] A function that gets executed while running the query to log the sql.
* @param {Boolean} [options.benchmark=false] Print query execution time in microseconds when logging SQL.
* @return {String|Object} * @return {String|Object}
*/ */
Model.prototype.getTableName = function(options) { // testhint options:none Model.prototype.getTableName = function(options) { // testhint options:none
...@@ -1307,7 +1304,6 @@ Model.prototype.all = function(options) { ...@@ -1307,7 +1304,6 @@ Model.prototype.all = function(options) {
* @param {Function} [options.logging=false] A function that gets executed while running the query to log the sql. * @param {Function} [options.logging=false] A function that gets executed while running the query to log the sql.
* @param {Object} [options.having] * @param {Object} [options.having]
* @param {String} [options.searchPath=DEFAULT] An optional parameter to specify the schema search_path (Postgres only) * @param {String} [options.searchPath=DEFAULT] An optional parameter to specify the schema search_path (Postgres only)
* @param {Boolean} [options.benchmark=false] Print query execution time in microseconds when logging SQL.
* *
* @see {Sequelize#query} * @see {Sequelize#query}
* @return {Promise<Array<Instance>>} * @return {Promise<Array<Instance>>}
...@@ -1506,10 +1502,9 @@ Model.prototype.find = Model.prototype.findOne; ...@@ -1506,10 +1502,9 @@ Model.prototype.find = Model.prototype.findOne;
* @param {Object} [options.where] A hash of search attributes. * @param {Object} [options.where] A hash of search attributes.
* @param {Function} [options.logging=false] A function that gets executed while running the query to log the sql. * @param {Function} [options.logging=false] A function that gets executed while running the query to log the sql.
* @param {DataType|String} [options.dataType] The type of the result. If `field` is a field in this Model, the default will be the type of that field, otherwise defaults to float. * @param {DataType|String} [options.dataType] The type of the result. If `field` is a field in this Model, the default will be the type of that field, otherwise defaults to float.
* @param {Boolean} [options.distinct] Applies DISTINCT to the field being aggregated over * @param {boolean} [options.distinct] Applies DISTINCT to the field being aggregated over
* @param {Transaction} [options.transaction] Transaction to run query under * @param {Transaction} [options.transaction] Transaction to run query under
* @param {Boolean} [options.plain] When `true`, the first returned value of `aggregateFunction` is cast to `dataType` and returned. If additional attributes are specified, along with `group` clauses, set `plain` to `false` to return all values of all returned rows. Defaults to `true` * @param {boolean} [options.plain] When `true`, the first returned value of `aggregateFunction` is cast to `dataType` and returned. If additional attributes are specified, along with `group` clauses, set `plain` to `false` to return all values of all returned rows. Defaults to `true`
* @param {Boolean} [options.benchmark=false] Print query execution time in microseconds when logging SQL.
* *
* @return {Promise<options.dataType|object>} Returns the aggregate result cast to `options.dataType`, unless `options.plain` is false, in which case the complete data result is returned. * @return {Promise<options.dataType|object>} Returns the aggregate result cast to `options.dataType`, unless `options.plain` is false, in which case the complete data result is returned.
*/ */
...@@ -1563,7 +1558,6 @@ Model.prototype.aggregate = function(attribute, aggregateFunction, options) { ...@@ -1563,7 +1558,6 @@ Model.prototype.aggregate = function(attribute, aggregateFunction, options) {
* @param {Transaction} [options.transaction] Transaction to run query under * @param {Transaction} [options.transaction] Transaction to run query under
* @param {Function} [options.logging=false] A function that gets executed while running the query to log the sql. * @param {Function} [options.logging=false] A function that gets executed while running the query to log the sql.
* @param {String} [options.searchPath=DEFAULT] An optional parameter to specify the schema search_path (Postgres only) * @param {String} [options.searchPath=DEFAULT] An optional parameter to specify the schema search_path (Postgres only)
* @param {Boolean} [options.benchmark=false] Print query execution time in microseconds when logging SQL.
* *
* @return {Promise<Integer>} * @return {Promise<Integer>}
*/ */
...@@ -1799,7 +1793,6 @@ Model.prototype.bulkBuild = function(valueSets, options) { // testhint options:n ...@@ -1799,7 +1793,6 @@ Model.prototype.bulkBuild = function(valueSets, options) { // testhint options:n
* @param {Transaction} [options.transaction] Transaction to run query under * @param {Transaction} [options.transaction] Transaction to run query under
* @param {Function} [options.logging=false] A function that gets executed while running the query to log the sql. * @param {Function} [options.logging=false] A function that gets executed while running the query to log the sql.
* @param {String} [options.searchPath=DEFAULT] An optional parameter to specify the schema search_path (Postgres only) * @param {String} [options.searchPath=DEFAULT] An optional parameter to specify the schema search_path (Postgres only)
* @param {Boolean} [options.benchmark=false] Print query execution time in microseconds when logging SQL.
* *
* @return {Promise<Instance>} * @return {Promise<Instance>}
*/ */
...@@ -1824,7 +1817,6 @@ Model.prototype.create = function(values, options) { ...@@ -1824,7 +1817,6 @@ Model.prototype.create = function(values, options) {
* @param {Object} [options.defaults] Default values to use if building a new instance * @param {Object} [options.defaults] Default values to use if building a new instance
* @param {Object} [options.transaction] Transaction to run query under * @param {Object} [options.transaction] Transaction to run query under
* @param {Function} [options.logging=false] A function that gets executed while running the query to log the sql. * @param {Function} [options.logging=false] A function that gets executed while running the query to log the sql.
* @param {Boolean} [options.benchmark=false] Print query execution time in microseconds when logging SQL.
* *
* @return {Promise<Instance,initialized>} * @return {Promise<Instance,initialized>}
* @alias findOrBuild * @alias findOrBuild
...@@ -2001,7 +1993,6 @@ Model.prototype.findCreateFind = function(options) { ...@@ -2001,7 +1993,6 @@ Model.prototype.findCreateFind = function(options) {
* @param {Transaction} [options.transaction] Transaction to run query under * @param {Transaction} [options.transaction] Transaction to run query under
* @param {Function} [options.logging=false] A function that gets executed while running the query to log the sql. * @param {Function} [options.logging=false] A function that gets executed while running the query to log the sql.
* @param {String} [options.searchPath=DEFAULT] An optional parameter to specify the schema search_path (Postgres only) * @param {String} [options.searchPath=DEFAULT] An optional parameter to specify the schema search_path (Postgres only)
* @param {Boolean} [options.benchmark=false] Print query execution time in microseconds when logging SQL.
* *
* @alias insertOrUpdate * @alias insertOrUpdate
* @return {Promise<created>} Returns a boolean indicating whether the row was created or updated. * @return {Promise<created>} Returns a boolean indicating whether the row was created or updated.
...@@ -2065,7 +2056,6 @@ Model.prototype.insertOrUpdate = Model.prototype.upsert; ...@@ -2065,7 +2056,6 @@ Model.prototype.insertOrUpdate = Model.prototype.upsert;
* @param {Function} [options.logging=false] A function that gets executed while running the query to log the sql. * @param {Function} [options.logging=false] A function that gets executed while running the query to log the sql.
* @param {Boolean} [options.returning=false] Append RETURNING * to get back auto generated values (Postgres only) * @param {Boolean} [options.returning=false] Append RETURNING * to get back auto generated values (Postgres only)
* @param {String} [options.searchPath=DEFAULT] An optional parameter to specify the schema search_path (Postgres only) * @param {String} [options.searchPath=DEFAULT] An optional parameter to specify the schema search_path (Postgres only)
* @param {Boolean} [options.benchmark=false] Print query execution time in microseconds when logging SQL.
* *
* @return {Promise<Array<Instance>>} * @return {Promise<Array<Instance>>}
*/ */
...@@ -2216,8 +2206,6 @@ Model.prototype.bulkCreate = function(records, options) { ...@@ -2216,8 +2206,6 @@ Model.prototype.bulkCreate = function(records, options) {
* @param {Transaction} [options.transaction] Transaction to run query under * @param {Transaction} [options.transaction] Transaction to run query under
* @param {Boolean|function} [options.logging] A function that logs sql queries, or false for no logging * @param {Boolean|function} [options.logging] A function that logs sql queries, or false for no logging
* @param {String} [options.searchPath=DEFAULT] An optional parameter to specify the schema search_path (Postgres only) * @param {String} [options.searchPath=DEFAULT] An optional parameter to specify the schema search_path (Postgres only)
* @param {Boolean} [options.benchmark=false] Print query execution time in microseconds when logging SQL.
*
* @return {Promise} * @return {Promise}
* *
* @see {Model#destroy} for more information * @see {Model#destroy} for more information
...@@ -2241,7 +2229,6 @@ Model.prototype.truncate = function(options) { ...@@ -2241,7 +2229,6 @@ Model.prototype.truncate = function(options) {
* @param {Boolean} [options.cascade=false] Only used in conjunction with TRUNCATE. Truncates all tables that have foreign-key references to the named table, or to any tables added to the group due to CASCADE. * @param {Boolean} [options.cascade=false] Only used in conjunction with TRUNCATE. Truncates all tables that have foreign-key references to the named table, or to any tables added to the group due to CASCADE.
* @param {Transaction} [options.transaction] Transaction to run query under * @param {Transaction} [options.transaction] Transaction to run query under
* @param {Function} [options.logging=false] A function that gets executed while running the query to log the sql. * @param {Function} [options.logging=false] A function that gets executed while running the query to log the sql.
* @param {Boolean} [options.benchmark=false] Print query execution time in microseconds when logging SQL.
* @return {Promise<Integer>} The number of destroyed rows * @return {Promise<Integer>} The number of destroyed rows
*/ */
Model.prototype.destroy = function(options) { Model.prototype.destroy = function(options) {
...@@ -2272,7 +2259,7 @@ Model.prototype.destroy = function(options) { ...@@ -2272,7 +2259,7 @@ Model.prototype.destroy = function(options) {
}).then(function() { }).then(function() {
// Get daos and run beforeDestroy hook on each record individually // Get daos and run beforeDestroy hook on each record individually
if (options.individualHooks) { if (options.individualHooks) {
return self.findAll({where: options.where, transaction: options.transaction, logging: options.logging, benchmark: options.benchmark}).map(function(instance) { return self.findAll({where: options.where, transaction: options.transaction, logging: options.logging}).map(function(instance) {
return self.runHooks('beforeDestroy', instance, options).then(function() { return self.runHooks('beforeDestroy', instance, options).then(function() {
return instance; return instance;
}); });
...@@ -2321,7 +2308,6 @@ Model.prototype.destroy = function(options) { ...@@ -2321,7 +2308,6 @@ Model.prototype.destroy = function(options) {
* @param {Boolean} [options.individualHooks=false] If set to true, restore will find all records within the where parameter and will execute before / after bulkRestore hooks on each row * @param {Boolean} [options.individualHooks=false] If set to true, restore will find all records within the where parameter and will execute before / after bulkRestore hooks on each row
* @param {Number} [options.limit] How many rows to undelete * @param {Number} [options.limit] How many rows to undelete
* @param {Function} [options.logging=false] A function that gets executed while running the query to log the sql. * @param {Function} [options.logging=false] A function that gets executed while running the query to log the sql.
* @param {Boolean} [options.benchmark=false] Print query execution time in microseconds when logging SQL.
* @param {Transaction} [options.transaction] Transaction to run query under * @param {Transaction} [options.transaction] Transaction to run query under
* *
* @return {Promise<undefined>} * @return {Promise<undefined>}
...@@ -2349,7 +2335,7 @@ Model.prototype.restore = function(options) { ...@@ -2349,7 +2335,7 @@ Model.prototype.restore = function(options) {
}).then(function() { }).then(function() {
// Get daos and run beforeRestore hook on each record individually // Get daos and run beforeRestore hook on each record individually
if (options.individualHooks) { if (options.individualHooks) {
return self.findAll({where: options.where, transaction: options.transaction, logging: options.logging, benchmark: options.benchmark, paranoid: false}).map(function(instance) { return self.findAll({where: options.where, transaction: options.transaction, logging: options.logging, paranoid: false}).map(function(instance) {
return self.runHooks('beforeRestore', instance, options).then(function() { return self.runHooks('beforeRestore', instance, options).then(function() {
return instance; return instance;
}); });
...@@ -2399,7 +2385,6 @@ Model.prototype.restore = function(options) { ...@@ -2399,7 +2385,6 @@ Model.prototype.restore = function(options) {
* @param {Boolean} [options.returning=false] Return the affected rows (only for postgres) * @param {Boolean} [options.returning=false] Return the affected rows (only for postgres)
* @param {Number} [options.limit] How many rows to update (only for mysql and mariadb) * @param {Number} [options.limit] How many rows to update (only for mysql and mariadb)
* @param {Function} [options.logging=false] A function that gets executed while running the query to log the sql. * @param {Function} [options.logging=false] A function that gets executed while running the query to log the sql.
* @param {Boolean} [options.benchmark=false] Print query execution time in microseconds when logging SQL.
* @param {Transaction} [options.transaction] Transaction to run query under * @param {Transaction} [options.transaction] Transaction to run query under
* *
* @return {Promise<Array<affectedCount,affectedRows>>} * @return {Promise<Array<affectedCount,affectedRows>>}
...@@ -2485,7 +2470,7 @@ Model.prototype.update = function(values, options) { ...@@ -2485,7 +2470,7 @@ Model.prototype.update = function(values, options) {
// Get instances and run beforeUpdate hook on each record individually // Get instances and run beforeUpdate hook on each record individually
if (options.individualHooks) { if (options.individualHooks) {
return self.findAll({where: options.where, transaction: options.transaction, logging: options.logging, benchmark: options.benchmark}).then(function(_instances) { return self.findAll({where: options.where, transaction: options.transaction, logging: options.logging}).then(function(_instances) {
instances = _instances; instances = _instances;
if (!instances.length) { if (!instances.length) {
return []; return [];
......
...@@ -81,8 +81,7 @@ var url = require('url') ...@@ -81,8 +81,7 @@ var url = require('url')
* @param {Boolean} [options.quoteIdentifiers=true] Set to `false` to make table names and attributes case-insensitive on Postgres and skip double quoting of them. * @param {Boolean} [options.quoteIdentifiers=true] Set to `false` to make table names and attributes case-insensitive on Postgres and skip double quoting of them.
* @param {String} [options.transactionType='DEFERRED'] Set the default transaction type. See `Sequelize.Transaction.TYPES` for possible options. Sqlite only. * @param {String} [options.transactionType='DEFERRED'] Set the default transaction type. See `Sequelize.Transaction.TYPES` for possible options. Sqlite only.
* @param {String} [options.isolationLevel='REPEATABLE_READ'] Set the default transaction isolation level. See `Sequelize.Transaction.ISOLATION_LEVELS` for possible options. * @param {String} [options.isolationLevel='REPEATABLE_READ'] Set the default transaction isolation level. See `Sequelize.Transaction.ISOLATION_LEVELS` for possible options.
* @param {Boolean} [options.typeValidation=false] Run built in type validators on insert and update, e.g. validate that arguments passed to integer fields are integer-like. * @param {Boolean} [options.typeValidation=false] Run built in type validators on insert and update, e.g. validate that arguments passed to integer fields are integer-like
* @param {Boolean} [options.benchmark=false] Print query execution time in microseconds when logging SQL.
*/ */
/** /**
...@@ -148,8 +147,7 @@ var Sequelize = function(database, username, password, options) { ...@@ -148,8 +147,7 @@ var Sequelize = function(database, username, password, options) {
transactionType: Transaction.TYPES.DEFERRED, transactionType: Transaction.TYPES.DEFERRED,
isolationLevel: Transaction.ISOLATION_LEVELS.REPEATABLE_READ, isolationLevel: Transaction.ISOLATION_LEVELS.REPEATABLE_READ,
databaseVersion: 0, databaseVersion: 0,
typeValidation: false, typeValidation: false
benchmark: false
}, options || {}); }, options || {});
if (this.options.dialect === 'postgresql') { if (this.options.dialect === 'postgresql') {
......
...@@ -39,7 +39,6 @@ ...@@ -39,7 +39,6 @@
"inflection": "^1.6.0", "inflection": "^1.6.0",
"lodash": "^3.9.3", "lodash": "^3.9.3",
"moment": "^2.11.0", "moment": "^2.11.0",
"microtime": "^2.0.0",
"moment-timezone": "^0.5.0", "moment-timezone": "^0.5.0",
"node-uuid": "~1.4.4", "node-uuid": "~1.4.4",
"semver": "^5.0.1", "semver": "^5.0.1",
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!