{"id":"1ce55d48f6a2b2a2","repo":"drizzle-team/drizzle-orm","slug":"maxrepeatedvaluescount-should-be-greater-than-zero","errorCode":null,"errorMessage":"maxRepeatedValuesCount should be greater than zero.","messagePattern":"maxRepeatedValuesCount should be greater than zero\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"drizzle-seed/src/services/Generators.ts","lineNumber":237,"sourceCode":"\t\tif (\n\t\t\tisObject(values[0])\n\t\t\t&& !(values as { weight: number; values: any[] }[]).every((val) => val.values.length !== 0)\n\t\t) {\n\t\t\tthrow new Error('One of weighted values length equals zero.');\n\t\t}\n\n\t\tif (\n\t\t\tmaxRepeatedValuesCount !== undefined && (\n\t\t\t\t(typeof maxRepeatedValuesCount === 'number' && maxRepeatedValuesCount <= 0)\n\t\t\t\t|| (typeof maxRepeatedValuesCount === 'object' && !maxRepeatedValuesCount\n\t\t\t\t\t.every((obj) =>\n\t\t\t\t\t\t(typeof obj.count) === 'number'\n\t\t\t\t\t\t\t? (obj.count as number) > 0\n\t\t\t\t\t\t\t: (obj.count as number[]).every((count) => count > 0)\n\t\t\t\t\t))\n\t\t\t)\n\t\t) {\n\t\t\tthrow new Error('maxRepeatedValuesCount should be greater than zero.');\n\t\t}\n\n\t\tlet allValuesCount = values.length;\n\t\tif (isObject(values[0])) {\n\t\t\tallValuesCount = (values as { values: any[] }[]).reduce((acc, currVal) => acc + currVal.values.length, 0);\n\t\t}\n\n\t\tif (\n\t\t\tnotNull === true\n\t\t\t&& maxRepeatedValuesCount !== undefined\n\t\t\t&& (\n\t\t\t\t(!isObject(values[0]) && typeof maxRepeatedValuesCount === 'number'\n\t\t\t\t\t&& maxRepeatedValuesCount * values.length < count)\n\t\t\t\t|| (isObject(values[0]) && typeof maxRepeatedValuesCount === 'number'\n\t\t\t\t\t&& maxRepeatedValuesCount * allValuesCount < count)\n\t\t\t)\n\t\t) {\n\t\t\tthrow new Error(\"Can't fill notNull column with null values.\");","sourceCodeStart":219,"sourceCodeEnd":255,"githubUrl":"https://github.com/drizzle-team/drizzle-orm/blob/b7862528fd8fc39bc2653a6c18dad7c1f4e68d10/drizzle-seed/src/services/Generators.ts#L219-L255","documentation":"Error \"maxRepeatedValuesCount should be greater than zero.\" thrown in drizzle-team/drizzle-orm.","triggerScenarios":"Setting maxRepeatedValuesCount to zero or a negative number in a drizzle-seed generator.","commonSituations":"Copy-pasted config with 0; computed repetition count that rounded down to zero.","solutions":["Set maxRepeatedValuesCount to a positive integer greater than zero in the generator configuration."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"b7862528fd8fc39bc2653a6c18dad7c1f4e68d10","analyzedAt":"2026-08-03T18:11:14.318Z","schemaVersion":2}