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

Method handleShowIndexesQuery

src/dialects/db2/query.js:464–494  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

462 }
463
464 handleShowIndexesQuery(data) {
465 let currItem;
466 const result = [];
467 data.forEach(item => {
468 if (!currItem || currItem.name !== item.Key_name) {
469 currItem = {
470 primary: item.keyType === 'P',
471 fields: [],
472 name: item.name,
473 tableName: item.tableName,
474 unique: item.keyType === 'U',
475 type: item.type
476 };
477
478 _.forEach(item.COLNAMES.replace(/\+|-/g, x => { return ` ${ x}`; }).split(' '), column => {
479 let columnName = column.trim();
480 if ( columnName ) {
481 columnName = columnName.replace(/\+|-/, '');
482 currItem.fields.push({
483 attribute: columnName,
484 length: undefined,
485 order: column.indexOf('-') === -1 ? 'ASC' : 'DESC',
486 collate: undefined
487 });
488 }
489 });
490 result.push(currItem);
491 }
492 });
493 return result;
494 }
495
496 handleInsertQuery(results, metaData) {
497 if (this.instance) {

Callers 1

formatResultsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected