{"id":"b8ac5118173bb831","repo":"drizzle-team/drizzle-orm","slug":"count-exceeds-max-number-of-unique-phone-numbers","errorCode":null,"errorMessage":"count exceeds max number of unique phone numbers(${maxUniquePhoneNumbersCount}).","messagePattern":"count exceeds max number of unique phone numbers\\((.+?)\\)\\.","errorType":"validation","errorClass":"RangeError","httpStatus":null,"severity":"error","filePath":"drizzle-seed/src/services/Generators.ts","lineNumber":1926,"sourceCode":"\t\tlet { generatedDigitsNumbers } = this.params;\n\t\tconst { prefixes, template } = this.params;\n\n\t\tconst rng = prand.xoroshiro128plus(seed);\n\n\t\tif (template !== undefined) {\n\t\t\tif (this.stringLength !== undefined && this.stringLength < template.length) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Length of phone number template is shorter than db column length restriction: ${this.stringLength}. \n\t\t\t\t\tSet the maximum string length to at least ${template.length}.`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst iterArray = [...template.matchAll(/#/g)];\n\t\t\tconst placeholdersCount = iterArray.length;\n\n\t\t\tconst maxUniquePhoneNumbersCount = Math.pow(10, placeholdersCount);\n\t\t\tif (maxUniquePhoneNumbersCount < count) {\n\t\t\t\tthrow new RangeError(\n\t\t\t\t\t`count exceeds max number of unique phone numbers(${maxUniquePhoneNumbersCount}).`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst generatorsMap = new Map<string, GenerateUniqueInt>();\n\t\t\tconst genObj = new GenerateUniqueInt({ minValue: 0, maxValue: maxUniquePhoneNumbersCount - 1 });\n\t\t\tgenObj.init({\n\t\t\t\tcount,\n\t\t\t\tseed,\n\t\t\t});\n\n\t\t\tgeneratorsMap.set(\n\t\t\t\ttemplate,\n\t\t\t\tgenObj,\n\t\t\t);\n\n\t\t\tconst prefixesArray: string[] = [];\n\t\t\tconst generatedDigitsNumbers: number[] = [];","sourceCodeStart":1908,"sourceCodeEnd":1944,"githubUrl":"https://github.com/drizzle-team/drizzle-orm/blob/b7862528fd8fc39bc2653a6c18dad7c1f4e68d10/drizzle-seed/src/services/Generators.ts#L1908-L1944","documentation":"Error \"count exceeds max number of unique phone numbers(${maxUniquePhoneNumbersCount}).\" thrown in drizzle-team/drizzle-orm.","triggerScenarios":"Requesting more unique phone numbers than the template/prefix space allows.","commonSituations":"Few prefixes and short digit templates with a large unique count.","solutions":["Reduce the requested unique phone-number 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}