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

Method handleShowIndexesQuery

src/dialects/sqlite/query.js:433–451  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

431 }
432
433 async handleShowIndexesQuery(data) {
434 // Sqlite returns indexes so the one that was defined last is returned first. Lets reverse that!
435 return Promise.all(data.reverse().map(async item => {
436 item.fields = [];
437 item.primary = false;
438 item.unique = !!item.unique;
439 item.constraintName = item.name;
440 const columns = await this.run(`PRAGMA INDEX_INFO(\`${item.name}\`)`);
441 for (const column of columns) {
442 item.fields[column.seqno] = {
443 attribute: column.name,
444 length: undefined,
445 order: undefined
446 };
447 }
448
449 return item;
450 }));
451 }
452
453 getDatabaseMethod() {
454 if (this.isInsertQuery() || this.isUpdateQuery() || this.isUpsertQuery() || this.isBulkUpdateQuery() || this.sql.toLowerCase().includes('CREATE TEMPORARY TABLE'.toLowerCase()) || this.options.type === QueryTypes.BULKDELETE) {

Callers 1

_handleQueryResponseMethod · 0.95

Calls 2

runMethod · 0.95
allMethod · 0.80

Tested by

no test coverage detected