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

Method deleteQuery

src/dialects/db2/query-generator.js:510–536  ·  view source on GitHub ↗
(tableName, where, options = {}, model)

Source from the content-addressed store, hash-verified

508 }
509
510 deleteQuery(tableName, where, options = {}, model) {
511 const table = this.quoteTable(tableName);
512 const query = 'DELETE FROM <%= table %><%= where %><%= limit %>';
513
514 where = this.getWhereConditions(where, null, model, options);
515
516 let limit = '';
517
518 if (options.offset > 0) {
519 limit = ` OFFSET ${ this.escape(options.offset) } ROWS`;
520 }
521 if (options.limit) {
522 limit += ` FETCH NEXT ${ this.escape(options.limit) } ROWS ONLY`;
523 }
524
525 const replacements = {
526 limit,
527 table,
528 where
529 };
530
531 if (replacements.where) {
532 replacements.where = ` WHERE ${replacements.where}`;
533 }
534
535 return _.template(query, this._templateSettings)(replacements);
536 }
537
538 showIndexesQuery(tableName) {
539 let sql = 'SELECT NAME AS "name", TBNAME AS "tableName", UNIQUERULE AS "keyType", COLNAMES, INDEXTYPE AS "type" FROM SYSIBM.SYSINDEXES WHERE TBNAME = <%= tableName %>';

Callers 3

delete.test.jsFile · 0.45
deleteMethod · 0.45
bulkDeleteMethod · 0.45

Calls 3

quoteTableMethod · 0.80
getWhereConditionsMethod · 0.80
escapeMethod · 0.45

Tested by

no test coverage detected