{"id":"d7333cd1855ede99","repo":"drizzle-team/drizzle-orm","slug":"column-with-type-col-basecolumn-columntype-is","errorCode":null,"errorMessage":"column with type ${col.baseColumn!.columnType} is not supported for now.","messagePattern":"column with type (.+?) is not supported for now\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"drizzle-seed/src/services/SeedService.ts","lineNumber":515,"sourceCode":"\t\t}\n\n\t\treturn weightedWithCount;\n\t};\n\n\t// TODO: revise serial part generators\n\tselectGeneratorForPostgresColumn = (\n\t\ttable: Table,\n\t\tcol: Column,\n\t) => {\n\t\tconst pickGenerator = (table: Table, col: Column) => {\n\t\t\t// ARRAY\n\t\t\tif (col.columnType.match(/\\[\\w*]/g) !== null && col.baseColumn !== undefined) {\n\t\t\t\tconst baseColumnGen = this.selectGeneratorForPostgresColumn(\n\t\t\t\t\ttable,\n\t\t\t\t\tcol.baseColumn!,\n\t\t\t\t) as AbstractGenerator;\n\t\t\t\tif (baseColumnGen === undefined) {\n\t\t\t\t\tthrow new Error(`column with type ${col.baseColumn!.columnType} is not supported for now.`);\n\t\t\t\t}\n\n\t\t\t\t// const getBaseColumnDataType = (baseColumn: Column) => {\n\t\t\t\t// \tif (baseColumn.baseColumn !== undefined) {\n\t\t\t\t// \t\treturn getBaseColumnDataType(baseColumn.baseColumn);\n\t\t\t\t// \t}\n\n\t\t\t\t// \treturn baseColumn.dataType;\n\t\t\t\t// };\n\t\t\t\t// const baseColumnDataType = getBaseColumnDataType(col.baseColumn);\n\n\t\t\t\tconst generator = new generatorsMap.GenerateArray[0]({ baseColumnGen, size: col.size });\n\t\t\t\t// generator.baseColumnDataType = baseColumnDataType;\n\n\t\t\t\treturn generator;\n\t\t\t}\n\n\t\t\t// ARRAY for studio","sourceCodeStart":497,"sourceCodeEnd":533,"githubUrl":"https://github.com/drizzle-team/drizzle-orm/blob/b7862528fd8fc39bc2653a6c18dad7c1f4e68d10/drizzle-seed/src/services/SeedService.ts#L497-L533","documentation":"In selectGeneratorForPostgresColumn, when a column is a Postgres array (columnType matches [/\\[\\w*]/]) with a defined baseColumn, the resolver recurses to find a generator for the base (element) type. If the base column type is unsupported and returns undefined, the array generator cannot be constructed and it throws.","triggerScenarios":"A Postgres array column whose element type has no generator (e.g. tsvector[], custom_type[], bit varying[]) and no refinement is supplied for the column.","commonSituations":"Schema with typed arrays of exotic Postgres types; using array of a UDT or domain that drizzle-seed cannot resolve.","solutions":["Provide a refinement generator for the array column so the auto-resolver is bypassed.","Change the array's element type to a supported primitive (text, integer, etc.).","Make the column nullable and leave it unrefined so it defaults to null."],"exampleFix":"// before\nkeywords: customType('keywords').array()\n// after — refine with a generator\nrefinements = {\n  myTable: {\n    columns: {\n      keywords: { generator: generators.array({ values: ['a','b','c'] }) }\n    }\n  }\n};","handlingStrategy":"validation","validationCode":"// Check whether a Postgres array column's base type is supported.\nconst SUPPORTED_SCALAR_TYPES = ['serial','integer','smallint','bigint','varchar','text','boolean','date','timestamp','numeric','real','double','json','jsonb','uuid','interval'];\nfunction isArrayBaseSupported(columnType: string): boolean {\n  if (!columnType.match(/\\[\\w*\\]/)) return true; // not an array\n  const baseType = columnType.replace(/\\[\\w*\\]/g, '');\n  return SUPPORTED_SCALAR_TYPES.some((t) => baseType.includes(t));\n}\n// If false, supply a refinement generator for the column.","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use arrays of standard scalar types (text[], integer[]) for seedable columns.","Provide refinement generators for arrays of custom or exotic types.","Make unsupported array columns nullable so they default to null."],"tags":["array","postgres","unsupported-type","base-column"],"analyzedSha":"b7862528fd8fc39bc2653a6c18dad7c1f4e68d10","analyzedAt":"2026-08-03T18:11:14.318Z","schemaVersion":2}