{"id":"2e61d7717ddaad00","repo":"drizzle-team/drizzle-orm","slug":"count-exceeds-max-number-of-unique-integers-in-giv","errorCode":null,"errorMessage":"count exceeds max number of unique integers in given range(min, max), try to make range wider.","messagePattern":"count exceeds max number of unique integers in given range\\(min, max\\), try to make range wider\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"drizzle-seed/src/services/Generators.ts","lineNumber":679,"sourceCode":"\n\toverride init({ count, seed }: { count: number; seed: number }) {\n\t\tconst rng = prand.xoroshiro128plus(seed);\n\t\tlet { minValue, maxValue } = this.params;\n\n\t\tif (maxValue === undefined) {\n\t\t\tmaxValue = count * 10;\n\t\t}\n\t\tif (minValue === undefined) {\n\t\t\tminValue = -maxValue;\n\t\t}\n\n\t\tconst intervals = [[minValue, maxValue]];\n\n\t\tconst integersCount = new Map();\n\n\t\tif (typeof minValue === 'bigint' && typeof maxValue === 'bigint') {\n\t\t\tif (this.skipCheck === false && maxValue - minValue + BigInt(1) < count) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t'count exceeds max number of unique integers in given range(min, max), try to make range wider.',\n\t\t\t\t);\n\t\t\t}\n\t\t} else if (typeof minValue === 'number' && typeof maxValue === 'number') {\n\t\t\tminValue = minValue >= 0 ? Math.ceil(minValue) : Math.floor(minValue);\n\t\t\tmaxValue = maxValue >= 0 ? Math.floor(maxValue) : Math.ceil(maxValue);\n\t\t\tif (this.skipCheck === false && maxValue - minValue + 1 < count) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t'count exceeds max number of unique integers in given range(min, max), try to make range wider.',\n\t\t\t\t);\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new Error(\n\t\t\t\t'minValue and maxValue should be the same type.',\n\t\t\t);\n\t\t}\n\n\t\tthis.state = { rng, minValue, maxValue, intervals, integersCount };","sourceCodeStart":661,"sourceCodeEnd":697,"githubUrl":"https://github.com/drizzle-team/drizzle-orm/blob/b7862528fd8fc39bc2653a6c18dad7c1f4e68d10/drizzle-seed/src/services/Generators.ts#L661-L697","documentation":"Error \"count exceeds max number of unique integers in given range(min, max), try to make range wider.\" thrown in drizzle-team/drizzle-orm.","triggerScenarios":"generateUniqueInt with count larger than (max - min + 1) for the given integer range.","commonSituations":"Too-narrow min/max range on a unique integer column; large seed count with default range.","solutions":["Widen the (min, max) range or reduce the count of unique integers requested."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"b7862528fd8fc39bc2653a6c18dad7c1f4e68d10","analyzedAt":"2026-08-03T18:11:14.318Z","schemaVersion":2}