{"id":"4130ec304bd5ea61","repo":"sequelize/sequelize","slug":"dialect-name-does-not-support-the-typename-d","errorCode":null,"errorMessage":"${dialect.name} does not support the ${typeName} data type.\nSee https://sequelize.org/docs/v7/models/data-types/ for a list of supported data types.","messagePattern":"(.+?) does not support the (.+?) data type\\.\nSee https://sequelize\\.org/docs/v7/models/data-types/ for a list of supported data types\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/src/abstract-dialect/data-types-utils.ts","lineNumber":121,"sourceCode":"\n  throw new Error(\n    'attributeTypeToSql received a type that is neither a string or an instance of AbstractDataType',\n  );\n}\n\nexport function getDataTypeParser(\n  dialect: AbstractDialect,\n  dataType: DataTypeClassOrInstance,\n): (value: unknown) => unknown {\n  const type = normalizeDataType(dataType, dialect);\n\n  return (value: unknown) => {\n    return type.parseDatabaseValue(value);\n  };\n}\n\nexport function throwUnsupportedDataType(dialect: AbstractDialect, typeName: string): never {\n  throw new Error(`${dialect.name} does not support the ${typeName} data type.\nSee https://sequelize.org/docs/v7/models/data-types/ for a list of supported data types.`);\n}\n","sourceCodeStart":103,"sourceCodeEnd":124,"githubUrl":"https://github.com/sequelize/sequelize/blob/7e1deec499d5afbb8d1877c2f4d545cead1214ec/packages/core/src/abstract-dialect/data-types-utils.ts#L103-L124","documentation":"throwUnsupportedDataType is called by a DataType's `_checkOptionSupport` (or option checks) when the active dialect's `supports.dataTypes.*` table indicates the type — or a particular option of it — is not available. It produces a dialect-specific message and links to the data-types docs. This is the canonical 'this dialect does not have that type' failure.","triggerScenarios":"Declaring a model with a type the dialect lacks: e.g. `DataTypes.CITEXT` on MySQL/SQL Server, `DataTypes.JSONB` on non-Postgres, `DataTypes.BIGINT.UNSIGNED` on a dialect without unsigned bigints, `DataTypes.HSTORE` outside Postgres, or an option like `STRING.BINARY` where `COLLATE_BINARY` is unsupported.","commonSituations":"Switching dialects (e.g. developing on Postgres with JSONB then deploying to MySQL); using a type only supported by one DB; turning on an unsupported option (zerofill, unsigned, precision on TIME).","solutions":["Use a type the target dialect supports (e.g. replace JSONB with JSON, CITEXT with STRING + a case-insensitive collation).","Drop the unsupported option (e.g. remove `.UNSIGNED`, `.BINARY`, or precision).","Keep dialect-specific types behind a dialect check and provide an alternative per dialect."],"exampleFix":"// before (on MySQL)\nsequelize.define('User', { meta: { type: DataTypes.JSONB } });\n// after\nsequelize.define('User', { meta: { type: DataTypes.JSON } });","handlingStrategy":"validation","validationCode":"function assertTypeSupported(dialect: any, typeId: string) {\n  if (!dialect.supports?.dataTypes?.[typeId]) {\n    throw new Error(`${dialect.name} does not support ${typeId}; choose a dialect-appropriate type.`);\n  }\n}","typeGuard":"function isTypeSupportedByDialect(dialect: any, typeId: string): boolean {\n  return Boolean(dialect?.supports?.dataTypes?.[typeId]);\n}","tryCatchPattern":null,"preventionTips":["Keep model definitions dialect-portable; avoid dialect-only types (JSONB, CITEXT, HSTORE) unless you target that dialect exclusively.","When supporting multiple dialects, branch on `sequelize.dialect.name` and select an appropriate type per dialect.","Run model-sync tests against every supported dialect in CI to catch unsupported types."],"tags":["core","data-types","dialect","compatibility"],"analyzedSha":"7e1deec499d5afbb8d1877c2f4d545cead1214ec","analyzedAt":"2026-08-03T18:58:44.549Z","schemaVersion":2}