{"id":"da6891ed69bc0e0a","repo":"sequelize/sequelize","slug":"showindexesquery-has-not-been-implemented-in-thi","errorCode":null,"errorMessage":"showIndexesQuery has not been implemented in ${this.dialect.name}.","messagePattern":"showIndexesQuery has not been implemented in (.+?)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/src/abstract-dialect/query-generator-typescript.ts","lineNumber":444,"sourceCode":"\n      return `SET CONSTRAINTS ${constraintFragment} ${type.toString()}`;\n    }\n\n    if (constraints?.length) {\n      constraintFragment = constraints\n        .map(constraint => this.quoteIdentifier(constraint))\n        .join(', ');\n    }\n\n    return `SET CONSTRAINTS ${constraintFragment} ${type.toString()}`;\n  }\n\n  showConstraintsQuery(_tableName: TableOrModel, _options?: ShowConstraintsQueryOptions): string {\n    throw new Error(`showConstraintsQuery has not been implemented in ${this.dialect.name}.`);\n  }\n\n  showIndexesQuery(_tableName: TableOrModel): string {\n    throw new Error(`showIndexesQuery has not been implemented in ${this.dialect.name}.`);\n  }\n\n  removeIndexQuery(\n    _tableName: TableOrModel,\n    _indexNameOrAttributes: string | string[],\n    _options?: RemoveIndexQueryOptions,\n  ): string {\n    throw new Error(`removeIndexQuery has not been implemented in ${this.dialect.name}.`);\n  }\n\n  /**\n   * Generates an SQL query that returns all foreign keys of a table or the foreign key constraint of a given column.\n   *\n   * @deprecated Use {@link showConstraintsQuery} instead.\n   * @param _tableName The table or associated model.\n   * @param _columnName The name of the column. Not supported by SQLite.\n   * @returns The generated SQL query.\n   */","sourceCodeStart":426,"sourceCodeEnd":462,"githubUrl":"https://github.com/sequelize/sequelize/blob/7e1deec499d5afbb8d1877c2f4d545cead1214ec/packages/core/src/abstract-dialect/query-generator-typescript.ts#L426-L462","documentation":"Thrown by the base showIndexesQuery, an abstract stub each dialect must override. It backs queryInterface.showIndex / getIndexes and the sync-time index reconciliation. Reaching it means the active dialect's query generator never implemented index introspection.","triggerScenarios":"Calling queryInterface.showIndex(table) (or model.sync performing index verification) on a dialect whose generator has no showIndexesQuery override.","commonSituations":"A community/experimental dialect that ships index creation but not index introspection. Syncing models that declare indexes against such a dialect.","solutions":["Upgrade the dialect package to one that implements showIndexesQuery.","Read indexes from the catalog directly via sequelize.query.","If authoring the dialect, add showIndexesQuery (see packages/postgres/src/query-generator-typescript.internal.ts:206)."],"exampleFix":"// before\nconst indexes = await queryInterface.showIndex('users');\n\n// after (no showIndexesQuery)\nconst [indexes] = await sequelize.query(\n  `SELECT indexname AS name, indexdef AS definition\n   FROM pg_indexes WHERE tablename = 'users'`,\n  { type: QueryTypes.SELECT }\n);","handlingStrategy":"fallback","validationCode":"if (\n  sequelize.dialect.queryGenerator.showIndexesQuery ===\n  AbstractQueryGenerator.prototype.showIndexesQuery\n) {\n  throw new Error(`${sequelize.dialect.name} has no showIndexesQuery`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  return await queryInterface.showIndex(table);\n} catch (e) {\n  if (/showIndexesQuery has not been implemented/.test((e as Error).message)) {\n    return sequelize.query(indexesSqlFor(sequelize.dialect.name, table), {\n      type: QueryTypes.SELECT,\n    });\n  }\n  throw e;\n}","preventionTips":["Verify the dialect implements index introspection before relying on sync-time index reconciliation.","Keep catalog-query fallbacks per dialect for index metadata."],"tags":["query-interface","indexes","not-implemented","introspection"],"analyzedSha":"7e1deec499d5afbb8d1877c2f4d545cead1214ec","analyzedAt":"2026-08-03T18:58:44.549Z","schemaVersion":2}