{"id":"c61d37cfbd10d989","repo":"sequelize/sequelize","slug":"the-include-attribute-for-indexes-is-not-supported","errorCode":null,"errorMessage":"The include attribute for indexes is not supported by ${this.dialect.name} dialect","messagePattern":"The include attribute for indexes is not supported by (.+?) dialect","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/src/abstract-dialect/query-generator.js","lineNumber":739,"sourceCode":"          result += ` ${operator}`;\n        }\n      }\n\n      if (this.dialect.supports.index.length > 0 && field.length > 0) {\n        result += `(${field.length})`;\n      }\n\n      if (field.order) {\n        result += ` ${field.order}`;\n      }\n\n      return result;\n    });\n\n    let includeSql;\n    if (options.include) {\n      if (!this.dialect.supports.index.include) {\n        throw new Error(\n          `The include attribute for indexes is not supported by ${this.dialect.name} dialect`,\n        );\n      }\n\n      if (options.include instanceof Literal) {\n        includeSql = `INCLUDE ${options.include.val}`;\n      } else if (Array.isArray(options.include)) {\n        includeSql = `INCLUDE (${options.include.map(field => (field instanceof Literal ? field.val : this.quoteIdentifier(field))).join(', ')})`;\n      } else {\n        throw new TypeError('The include attribute for indexes must be an array or a literal.');\n      }\n    }\n\n    if (!options.name) {\n      // Mostly for cases where addIndex is called directly by the user without an options object (for example in migrations)\n      // All calls that go through sequelize should already have a name\n      options = nameIndex(options, options.prefix);\n    }","sourceCodeStart":721,"sourceCodeEnd":757,"githubUrl":"https://github.com/sequelize/sequelize/blob/7e1deec499d5afbb8d1877c2f4d545cead1214ec/packages/core/src/abstract-dialect/query-generator.js#L721-L757","documentation":"Error \"The include attribute for indexes is not supported by ${this.dialect.name} dialect\" thrown in sequelize/sequelize.","triggerScenarios":"Defining an index with the include option on a dialect that does not support covering indexes.","commonSituations":"Sharing model definitions across dialects.","solutions":["Remove the include attribute from the index definition; covering indexes with INCLUDE are only supported by some dialects (Postgres, MSSQL)."],"exampleFix":"{ indexes: [{ fields: ['a', 'b'] }] } // no include","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"7e1deec499d5afbb8d1877c2f4d545cead1214ec","analyzedAt":"2026-08-03T18:58:44.549Z","schemaVersion":2}