{"id":"3964518b8afae91f","repo":"drizzle-team/drizzle-orm","slug":"count-exceeds-max-number-of-unique-postcodes-max","errorCode":null,"errorMessage":"count exceeds max number of unique postcodes(${maxUniquePostcodeNumber}).","messagePattern":"count exceeds max number of unique postcodes\\((.+?)\\)\\.","errorType":"exception","errorClass":"RangeError","httpStatus":null,"severity":"error","filePath":"drizzle-seed/src/services/Generators.ts","lineNumber":2486,"sourceCode":"export class GenerateUniquePostcode extends AbstractGenerator<{ isUnique?: boolean }> {\n\tstatic override readonly entityKind: string = 'GenerateUniquePostcode';\n\n\tprivate state: {\n\t\trng: prand.RandomGenerator;\n\t\ttemplates: {\n\t\t\ttemplate: string;\n\t\t\tindicesGen: GenerateUniqueInt;\n\t\t\tplaceholdersCount: number;\n\t\t\tcount: number;\n\t\t\tmaxUniquePostcodeNumber: number;\n\t\t}[];\n\t} | undefined;\n\tpublic override isUnique = true;\n\n\toverride init({ count, seed }: { count: number; seed: number }) {\n\t\tconst maxUniquePostcodeNumber = Math.pow(10, 5) + Math.pow(10, 9);\n\t\tif (count > maxUniquePostcodeNumber) {\n\t\t\tthrow new RangeError(\n\t\t\t\t`count exceeds max number of unique postcodes(${maxUniquePostcodeNumber}).`,\n\t\t\t);\n\t\t}\n\n\t\tconst rng = prand.xoroshiro128plus(seed);\n\t\tconst templates = [\n\t\t\t{\n\t\t\t\ttemplate: '#####',\n\t\t\t\tindicesGen: new GenerateUniqueInt({ minValue: 0, maxValue: Math.pow(10, 5) - 1 }),\n\t\t\t\tplaceholdersCount: 5,\n\t\t\t\tcount: 0,\n\t\t\t\tmaxUniquePostcodeNumber: Math.pow(10, 5),\n\t\t\t},\n\t\t\t{\n\t\t\t\ttemplate: '#####-####',\n\t\t\t\tindicesGen: new GenerateUniqueInt({ minValue: 0, maxValue: Math.pow(10, 9) - 1 }),\n\t\t\t\tplaceholdersCount: 9,\n\t\t\t\tcount: 0,","sourceCodeStart":2468,"sourceCodeEnd":2504,"githubUrl":"https://github.com/drizzle-team/drizzle-orm/blob/b7862528fd8fc39bc2653a6c18dad7c1f4e68d10/drizzle-seed/src/services/Generators.ts#L2468-L2504","documentation":"Error \"count exceeds max number of unique postcodes(${maxUniquePostcodeNumber}).\" thrown in drizzle-team/drizzle-orm.","triggerScenarios":"Requesting more unique postcodes than the generator can produce.","commonSituations":"Unique postcode column exceeding maxUniquePostcodeNumber.","solutions":["Reduce the requested unique postcode 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}