{"id":"42722dccc717ec26","repo":"drizzle-team/drizzle-orm","slug":"count-exceeds-max-number-of-unique-intervals-max","errorCode":null,"errorMessage":"count exceeds max number of unique intervals(${maxUniqueIntervalsNumber})","messagePattern":"count exceeds max number of unique intervals\\((.+?)\\)","errorType":"validation","errorClass":"RangeError","httpStatus":null,"severity":"error","filePath":"drizzle-seed/src/services/Generators.ts","lineNumber":1388,"sourceCode":"\t\tlet fieldsToGenerate: string[] = allFields;\n\n\t\tif (this.params.fields !== undefined && this.params.fields?.includes(' to ')) {\n\t\t\tconst tokens = this.params.fields.split(' to ');\n\t\t\tconst endIdx = allFields.indexOf(tokens[1]!);\n\t\t\tfieldsToGenerate = allFields.slice(0, endIdx + 1);\n\t\t} else if (this.params.fields !== undefined) {\n\t\t\tconst endIdx = allFields.indexOf(this.params.fields);\n\t\t\tfieldsToGenerate = allFields.slice(0, endIdx + 1);\n\t\t}\n\n\t\tlet maxUniqueIntervalsNumber = 1;\n\t\tfor (const field of fieldsToGenerate) {\n\t\t\tconst from = this.config[field]!.from, to = this.config[field]!.to;\n\t\t\tmaxUniqueIntervalsNumber *= from - to + 1;\n\t\t}\n\n\t\tif (count > maxUniqueIntervalsNumber) {\n\t\t\tthrow new RangeError(`count exceeds max number of unique intervals(${maxUniqueIntervalsNumber})`);\n\t\t}\n\n\t\tconst rng = prand.xoroshiro128plus(seed);\n\t\tconst intervalSet = new Set<string>();\n\t\tthis.state = { rng, fieldsToGenerate, intervalSet };\n\t}\n\n\tgenerate() {\n\t\tif (this.state === undefined) {\n\t\t\tthrow new Error('state is not defined.');\n\t\t}\n\n\t\tlet interval, numb: number;\n\n\t\tfor (;;) {\n\t\t\tinterval = '';\n\n\t\t\tfor (const field of this.state.fieldsToGenerate) {","sourceCodeStart":1370,"sourceCodeEnd":1406,"githubUrl":"https://github.com/drizzle-team/drizzle-orm/blob/b7862528fd8fc39bc2653a6c18dad7c1f4e68d10/drizzle-seed/src/services/Generators.ts#L1370-L1406","documentation":"Error \"count exceeds max number of unique intervals(${maxUniqueIntervalsNumber})\" thrown in drizzle-team/drizzle-orm.","triggerScenarios":"Requesting more unique date/timestamp intervals than the configured interval range can yield.","commonSituations":"Unique datetime columns with a tight date range and a large row count.","solutions":["Widen the interval range, increase the interval length limits, or reduce the requested unique count."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"b7862528fd8fc39bc2653a6c18dad7c1f4e68d10","analyzedAt":"2026-08-03T18:11:14.318Z","schemaVersion":2}