{"id":"0e391ed833d00446","repo":"drizzle-team/drizzle-orm","slug":"unsupported-dialect","errorCode":null,"errorMessage":"unsupported dialect","messagePattern":"unsupported dialect","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"drizzle-kit/src/serializer/studio.ts","lineNumber":551,"sourceCode":"\t\t\t\t\tconst refTable = rel.referencedTable;\n\t\t\t\t\tconst fields = normalized.fields\n\t\t\t\t\t\t.map((it) => getColumnCasing(it, casing))\n\t\t\t\t\t\t.flat();\n\t\t\t\t\tconst refColumns = normalized.references\n\t\t\t\t\t\t.map((it) => getColumnCasing(it, casing))\n\t\t\t\t\t\t.flat();\n\n\t\t\t\t\tlet refSchema: string | undefined;\n\t\t\t\t\tif (is(refTable, PgTable)) {\n\t\t\t\t\t\trefSchema = pgTableConfig(refTable).schema;\n\t\t\t\t\t} else if (is(refTable, MySqlTable)) {\n\t\t\t\t\t\trefSchema = mysqlTableConfig(refTable).schema;\n\t\t\t\t\t} else if (is(refTable, SQLiteTable)) {\n\t\t\t\t\t\trefSchema = undefined;\n\t\t\t\t\t} else if (is(refTable, SingleStoreTable)) {\n\t\t\t\t\t\trefSchema = singlestoreTableConfig(refTable).schema;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Error('unsupported dialect');\n\t\t\t\t\t}\n\n\t\t\t\t\tlet type: 'one' | 'many';\n\t\t\t\t\tif (is(rel, One)) {\n\t\t\t\t\t\ttype = 'one';\n\t\t\t\t\t} else if (is(rel, Many)) {\n\t\t\t\t\t\ttype = 'many';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Error('unsupported relation type');\n\t\t\t\t\t}\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\tname,\n\t\t\t\t\t\ttype,\n\t\t\t\t\t\ttable: it.dbName,\n\t\t\t\t\t\tschema: it.schema || 'public',\n\t\t\t\t\t\tcolumns: fields,\n\t\t\t\t\t\trefTable: refTableName,","sourceCodeStart":533,"sourceCodeEnd":569,"githubUrl":"https://github.com/drizzle-team/drizzle-orm/blob/b7862528fd8fc39bc2653a6c18dad7c1f4e68d10/drizzle-kit/src/serializer/studio.ts#L533-L569","documentation":"Thrown during Studio relation extraction when the `referencedTable` on a relation is not an instance of `PgTable`, `MySqlTable`, `SQLiteTable`, or `SingleStoreTable`. The serializer walks each relation's target table to find its schema; an unrecognized table class means the dialect is one Studio's relation extractor does not handle, or a cross-dialect/corrupted table object reached the extractor.","triggerScenarios":"Loading a schema that mixes table classes from unsupported dialects, or passing a custom/subclassed table into `extractTablesRelationalConfig` whose `referencedTable` is none of the four supported base classes. In practice this fires when an internal upgrade changes table internals or when a non-standard dialect is used.","commonSituations":"After upgrading drizzle-orm/drizzle-kit to mismatched versions, the `is(refTable, PgTable)` instance checks fail because the class identity changed across packages. Also seen with experimental dialects not yet supported by Studio.","solutions":["Align drizzle-orm and drizzle-kit to the same version (`pnpm update drizzle-orm drizzle-kit`).","Ensure the schema only uses tables from a single supported dialect (pg/mysql/sqlite/singlestore).","If using an experimental/new dialect, wait for Studio support or avoid the Relations API for those tables."],"exampleFix":"// before - mismatched versions\n\"drizzle-orm\": \"1.0.0\", \"drizzle-kit\": \"0.30.0\"\n// after\n\"drizzle-orm\": \"1.0.0\", \"drizzle-kit\": \"1.0.0\"","handlingStrategy":"type-guard","validationCode":"// Ensure drizzle-orm and drizzle-kit versions match before Studio start\nimport pkg from './package.json';\nfunction assertVersionAlign() {\n  const orm = pkg.dependencies['drizzle-orm'];\n  const kit = (pkg.devDependencies ?? pkg.dependencies)['drizzle-kit'];\n  if (!orm || !kit) throw new Error('Missing drizzle-orm/drizzle-kit');\n}","typeGuard":"import { is } from 'drizzle-orm';\nimport { PgTable } from 'drizzle-orm/pg-core';\nimport { MySqlTable } from 'drizzle-orm/mysql-core';\nimport { SQLiteTable } from 'drizzle-orm/sqlite-core';\nimport { SingleStoreTable } from 'drizzle-orm/singlestore-core';\n\nfunction isSupportedRefTable(t: unknown): boolean {\n  return is(t, PgTable) || is(t, MySqlTable) || is(t, SQLiteTable) || is(t, SingleStoreTable);\n}","tryCatchPattern":"try {\n  studioSchema = prepareStudioSchema(schema);\n} catch (e) {\n  if ((e as Error).message === 'unsupported dialect') {\n    console.error('Align drizzle-orm & drizzle-kit versions, or remove cross-dialect tables');\n  }\n  throw e;\n}","preventionTips":["Pin drizzle-orm and drizzle-kit to the same release line.","Keep a schema to a single supported dialect."],"tags":["drizzle-kit","studio","relations","dialect"],"analyzedSha":"b7862528fd8fc39bc2653a6c18dad7c1f4e68d10","analyzedAt":"2026-08-03T18:11:14.318Z","schemaVersion":2}