MCPcopy
hub / github.com/sequelize/sequelize / showIndexesQuery

Method showIndexesQuery

lib/dialects/db2/query-generator.js:528–543  ·  lib/dialects/db2/query-generator.js::Db2QueryGenerator.showIndexesQuery
(tableName)

Source from the content-addressed store, hash-verified

526 }
527
528 showIndexesQuery(tableName) {
529 let sql = class="st">'SELECT NAME AS "name", TBNAME AS "tableName", UNIQUERULE AS "keyType", COLNAMES, INDEXTYPE AS "type" FROM SYSIBM.SYSINDEXES WHERE TBNAME = <%= tableName %>';
530 let schema = undefined;
531 if (_.isObject(tableName)) {
532 schema = tableName.schema;
533 tableName = tableName.tableName;
534 }
535 if (schema) {
536 sql = `${sql} AND TBCREATOR = <%= schemaName %>`;
537 }
538 sql = `${sql} ORDER BY NAME;`;
539 return _.template(sql, this._templateSettings)({
540 tableName: wrapSingleQuote(tableName),
541 schemaName: wrapSingleQuote(schema)
542 });
543 }
544
545 showConstraintsQuery(tableName, constraintName) {
546 let sql = `SELECT CONSTNAME AS class="st">"constraintName", TRIM(TABSCHEMA) AS class="st">"schemaName", TABNAME AS class="st">"tableName" FROM SYSCAT.TABCONST WHERE TABNAME = class="st">'${tableName}'`;

Callers 2

showIndexMethod · 0.45
index.test.jsFile · 0.45

Calls 1

wrapSingleQuoteFunction · 0.70

Tested by

no test coverage detected