MCPcopy
hub / github.com/sequelize/sequelize / handleShowIndexesQuery

Method handleShowIndexesQuery

lib/dialects/sqlite/query.js:413–431  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

411 }
412
413 async handleShowIndexesQuery(data) {
414 // Sqlite returns indexes so the one that was defined last is returned first. Lets reverse that!
415 return Promise.all(data.reverse().map(async item => {
416 item.fields = [];
417 item.primary = false;
418 item.unique = !!item.unique;
419 item.constraintName = item.name;
420 const columns = await this.run(`PRAGMA INDEX_INFO(\`${item.name}\`)`);
421 for (const column of columns) {
422 item.fields[column.seqno] = {
423 attribute: column.name,
424 length: undefined,
425 order: undefined
426 };
427 }
428
429 return item;
430 }));
431 }
432
433 getDatabaseMethod() {
434 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