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

Method showIndexesQuery

src/dialects/db2/query-generator.js:538–553  ·  view source on GitHub ↗
(tableName)

Source from the content-addressed store, hash-verified

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 %>';
540 let schema = undefined;
541 if (_.isObject(tableName)) {
542 schema = tableName.schema;
543 tableName = tableName.tableName;
544 }
545 if (schema) {
546 sql = `${sql} AND TBCREATOR = <%= schemaName %>`;
547 }
548 sql = `${sql} ORDER BY NAME;`;
549 return _.template(sql, this._templateSettings)({
550 tableName: wrapSingleQuote(tableName),
551 schemaName: wrapSingleQuote(schema)
552 });
553 }
554
555 showConstraintsQuery(tableName, constraintName) {
556 let sql = `SELECT CONSTNAME AS "constraintName", TRIM(TABSCHEMA) AS "schemaName", TABNAME AS "tableName" FROM SYSCAT.TABCONST WHERE TABNAME = '${tableName}'`;

Callers 2

index.test.jsFile · 0.45
showIndexMethod · 0.45

Calls 1

wrapSingleQuoteFunction · 0.70

Tested by

no test coverage detected