init() — drizzle-orm Function Reference
Architecture documentation for the init() function in Generators.ts from the drizzle-orm codebase.
Entity Profile
Dependency Diagram
graph TD 8be07dbd_4b5a_4f76_d0da_85b6b6c1001e["init()"] 7e8301fc_1ec4_03fb_a032_6914b978fd21["GenerateUniqueCity"] 8be07dbd_4b5a_4f76_d0da_85b6b6c1001e -->|defined in| 7e8301fc_1ec4_03fb_a032_6914b978fd21 style 8be07dbd_4b5a_4f76_d0da_85b6b6c1001e fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
drizzle-seed/src/services/Generators.ts lines 2382–2397
override init({ count, seed }: { count: number; seed: number }) {
if (count > cityNames.length) {
throw new Error('count exceeds max number of unique cities.');
}
if (this.stringLength !== undefined && this.stringLength < maxCityNameLength) {
throw new Error(
`You can't use city generator with a db column length restriction of ${this.stringLength}. Set the maximum string length to at least ${maxCityNameLength}.`,
);
}
const genIndicesObj = new GenerateUniqueInt({ minValue: 0, maxValue: cityNames.length - 1 });
genIndicesObj.init({ count, seed });
this.state = { genIndicesObj };
}
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does init() do?
init() is a function in the drizzle-orm codebase, defined in drizzle-seed/src/services/Generators.ts.
Where is init() defined?
init() is defined in drizzle-seed/src/services/Generators.ts at line 2382.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free