MCPcopy Index your code
hub / github.com/sequelize/sequelize / bulkDelete

Method bulkDelete

src/dialects/abstract/query-interface.js:979–996  ·  view source on GitHub ↗

* Delete multiple records from a table * * @param {string} tableName table name from where to delete records * @param {object} where where conditions to find records to delete * @param {object} [options] options * @param {boolean} [options.trunc

(tableName, where, options, model)

Source from the content-addressed store, hash-verified

977 * @returns {Promise}
978 */
979 async bulkDelete(tableName, where, options, model) {
980 options = Utils.cloneDeep(options);
981 options = _.defaults(options, { limit: null });
982
983 if (options.truncate === true) {
984 return this.sequelize.query(
985 this.queryGenerator.truncateTableQuery(tableName, options),
986 options
987 );
988 }
989
990 if (typeof identifier === 'object') where = Utils.cloneDeep(where);
991
992 return await this.sequelize.query(
993 this.queryGenerator.deleteQuery(tableName, where, options, model),
994 options
995 );
996 }
997
998 async select(model, tableName, optionsArg) {
999 const options = { ...optionsArg, type: QueryTypes.SELECT, model };

Callers 3

testFunction · 0.80
destroyMethod · 0.80

Calls 3

queryMethod · 0.45
truncateTableQueryMethod · 0.45
deleteQueryMethod · 0.45

Tested by 1

testFunction · 0.64