{"id":"c83de6fde579314f","repo":"drizzle-team/drizzle-orm","slug":"count-exceeds-max-number-of-unique-first-names","errorCode":null,"errorMessage":"count exceeds max number of unique first names.","messagePattern":"count exceeds max number of unique first names\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"drizzle-seed/src/services/Generators.ts","lineNumber":1611,"sourceCode":"\n\t\t[idx, this.state.rng] = prand.uniformIntDistribution(0, firstNames.length - 1, this.state.rng);\n\t\treturn firstNames[idx] as string;\n\t}\n}\n\nexport class GenerateUniqueFirstName extends AbstractGenerator<{\n\tisUnique?: boolean;\n}> {\n\tstatic override readonly entityKind: string = 'GenerateUniqueFirstName';\n\n\tprivate state: {\n\t\tgenIndicesObj: GenerateUniqueInt;\n\t} | undefined;\n\tpublic override isUnique = true;\n\n\toverride init({ count, seed }: { count: number; seed: number }) {\n\t\tif (count > firstNames.length) {\n\t\t\tthrow new Error('count exceeds max number of unique first names.');\n\t\t}\n\n\t\tif (this.stringLength !== undefined && this.stringLength < maxFirstNameLength) {\n\t\t\tthrow new Error(\n\t\t\t\t`You can't use first name generator with a db column length restriction of ${this.stringLength}. Set the maximum string length to at least ${maxFirstNameLength}.`,\n\t\t\t);\n\t\t}\n\n\t\tconst genIndicesObj = new GenerateUniqueInt({ minValue: 0, maxValue: firstNames.length - 1 });\n\t\tgenIndicesObj.init({ count, seed });\n\n\t\tthis.state = { genIndicesObj };\n\t}\n\n\tgenerate() {\n\t\t// names dataset contains about 30000 unique names.\n\t\tif (this.state === undefined) {\n\t\t\tthrow new Error('state is not defined.');","sourceCodeStart":1593,"sourceCodeEnd":1629,"githubUrl":"https://github.com/drizzle-team/drizzle-orm/blob/b7862528fd8fc39bc2653a6c18dad7c1f4e68d10/drizzle-seed/src/services/Generators.ts#L1593-L1629","documentation":"Error \"count exceeds max number of unique first names.\" thrown in drizzle-team/drizzle-orm.","triggerScenarios":"Requesting more unique first names than the generator's first-name pool contains.","commonSituations":"Very large seed counts on a unique first-name column.","solutions":["Reduce the requested unique first-name count or drop the unique constraint."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"b7862528fd8fc39bc2653a6c18dad7c1f4e68d10","analyzedAt":"2026-08-03T18:11:14.318Z","schemaVersion":2}