{"id":"af03e1aa47c4df1c","repo":"drizzle-team/drizzle-orm","slug":"count-exceeds-max-number-of-unique-emails-maxuni","errorCode":null,"errorMessage":"count exceeds max number of unique emails(${maxUniqueEmailsNumber}).","messagePattern":"count exceeds max number of unique emails\\((.+?)\\)\\.","errorType":"validation","errorClass":"RangeError","httpStatus":null,"severity":"error","filePath":"drizzle-seed/src/services/Generators.ts","lineNumber":1844,"sourceCode":"\tstatic override readonly entityKind: string = 'GenerateEmail';\n\n\tprivate state: {\n\t\tgenIndicesObj: GenerateUniqueInt;\n\t\tarraysToGenerateFrom: string[][];\n\t} | undefined;\n\tpublic override timeSpent: number = 0;\n\tpublic override isUnique = true;\n\n\toverride init({ count, seed }: { count: number; seed: number }) {\n\t\tsuper.init({ count, seed });\n\n\t\tconst domainsArray = emailDomains;\n\t\tconst adjectivesArray = adjectives;\n\t\tconst namesArray = firstNames;\n\n\t\tconst maxUniqueEmailsNumber = adjectivesArray.length * namesArray.length * domainsArray.length;\n\t\tif (count > maxUniqueEmailsNumber) {\n\t\t\tthrow new RangeError(\n\t\t\t\t`count exceeds max number of unique emails(${maxUniqueEmailsNumber}).`,\n\t\t\t);\n\t\t}\n\n\t\tconst maxEmailLength = maxAdjectiveLength + maxFirstNameLength + maxEmailDomainLength + 2;\n\t\tif (this.stringLength !== undefined && this.stringLength < maxEmailLength) {\n\t\t\tthrow new Error(\n\t\t\t\t`You can't use email generator with a db column length restriction of ${this.stringLength}. Set the maximum string length to at least ${maxEmailLength}.`,\n\t\t\t);\n\t\t}\n\n\t\tconst arraysToGenerateFrom = [adjectivesArray, namesArray, domainsArray];\n\t\tconst genIndicesObj = new GenerateUniqueInt({\n\t\t\tminValue: 0,\n\t\t\tmaxValue: maxUniqueEmailsNumber - 1,\n\t\t});\n\t\tgenIndicesObj.init({ count, seed });\n","sourceCodeStart":1826,"sourceCodeEnd":1862,"githubUrl":"https://github.com/drizzle-team/drizzle-orm/blob/b7862528fd8fc39bc2653a6c18dad7c1f4e68d10/drizzle-seed/src/services/Generators.ts#L1826-L1862","documentation":"Error \"count exceeds max number of unique emails(${maxUniqueEmailsNumber}).\" thrown in drizzle-team/drizzle-orm.","triggerScenarios":"Requesting more unique emails than the email generator can produce.","commonSituations":"Huge unique-email seed counts exceeding maxUniqueEmailsNumber.","solutions":["Reduce the requested unique email 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}