{"id":"8f6b671fd720495b","repo":"drizzle-team/drizzle-orm","slug":"count-exceeds-max-number-of-unique-street-names","errorCode":null,"errorMessage":"count exceeds max number of unique street names(${maxUniqueStreetnamesNumber}).","messagePattern":"count exceeds max number of unique street names\\((.+?)\\)\\.","errorType":"exception","errorClass":"RangeError","httpStatus":null,"severity":"error","filePath":"drizzle-seed/src/services/Generators.ts","lineNumber":2264,"sourceCode":"\n\tprivate state: {\n\t\trng: prand.RandomGenerator;\n\t\tpossStreetNameObjs: {\n\t\t\tindicesGen: GenerateUniqueInt;\n\t\t\tmaxUniqueStreetNamesNumber: number;\n\t\t\tcount: number;\n\t\t\tarraysToChooseFrom: string[][];\n\t\t}[];\n\t} | undefined;\n\tpublic override isUnique = true;\n\n\toverride init({ count, seed }: { count: number; seed: number }) {\n\t\tconst streetNumberStrs = Array.from({ length: 999 }, (_, i) => String(i + 1));\n\t\tconst maxUniqueStreetnamesNumber = streetNumberStrs.length * firstNames.length * streetSuffix.length\n\t\t\t+ streetNumberStrs.length * firstNames.length * streetSuffix.length;\n\n\t\tif (count > maxUniqueStreetnamesNumber) {\n\t\t\tthrow new RangeError(\n\t\t\t\t`count exceeds max number of unique street names(${maxUniqueStreetnamesNumber}).`,\n\t\t\t);\n\t\t}\n\n\t\tconst maxStreetAddressLength = 4 + Math.max(maxFirstNameLength, maxLastNameLength) + 1 + maxStreetSuffixLength;\n\t\tif (this.stringLength !== undefined && this.stringLength < maxStreetAddressLength) {\n\t\t\tthrow new Error(\n\t\t\t\t`You can't use street address generator with a db column length restriction of ${this.stringLength}. Set the maximum string length to at least ${maxStreetAddressLength}.`,\n\t\t\t);\n\t\t}\n\n\t\tconst rng = prand.xoroshiro128plus(seed);\n\t\t// [\"1\", \"2\", ..., \"999\"]\n\n\t\tconst possStreetNameObjs = [\n\t\t\t{\n\t\t\t\tindicesGen: new GenerateUniqueInt({\n\t\t\t\t\tminValue: 0,","sourceCodeStart":2246,"sourceCodeEnd":2282,"githubUrl":"https://github.com/drizzle-team/drizzle-orm/blob/b7862528fd8fc39bc2653a6c18dad7c1f4e68d10/drizzle-seed/src/services/Generators.ts#L2246-L2282","documentation":"Error \"count exceeds max number of unique street names(${maxUniqueStreetnamesNumber}).\" thrown in drizzle-team/drizzle-orm.","triggerScenarios":"Requesting more unique street names than the street-name pool contains.","commonSituations":"Large unique street-name counts exceeding maxUniqueStreetnamesNumber.","solutions":["Reduce the requested unique street-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}