generate() — drizzle-orm Function Reference
Architecture documentation for the generate() function in Generators.ts from the drizzle-orm codebase.
Entity Profile
Dependency Diagram
graph TD 78d60b06_8075_885e_3119_393908410b63["generate()"] 75664d9b_4bcd_ac81_49ff_103a6117d024["GenerateTime"] 78d60b06_8075_885e_3119_393908410b63 -->|defined in| 75664d9b_4bcd_ac81_49ff_103a6117d024 style 78d60b06_8075_885e_3119_393908410b63 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
drizzle-seed/src/services/Generators.ts lines 923–942
generate() {
if (this.state === undefined) {
throw new Error('state is not defined.');
}
const anchorDateTime = new Date('2024-05-08T12:00:00.000Z');
const oneDayInMilliseconds = 86400000;
let date = new Date();
let milliseconds: number;
[milliseconds, this.state.rng] = prand.uniformIntDistribution(
-oneDayInMilliseconds,
oneDayInMilliseconds,
this.state.rng,
);
date = new Date(date.setTime(anchorDateTime.getTime() + milliseconds));
return date.toISOString().replace(/(\d{4}-\d{2}-\d{2}T)|(\.\d{3}Z)/g, '');
}
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does generate() do?
generate() is a function in the drizzle-orm codebase, defined in drizzle-seed/src/services/Generators.ts.
Where is generate() defined?
generate() is defined in drizzle-seed/src/services/Generators.ts at line 923.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free