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 263692c5_cd3e_9855_ce60_ce25ae4b07ea["init()"] 08a89c6b_073a_a5c7_87b0_8608d1a1a5cd["GenerateUniqueFullName"] 263692c5_cd3e_9855_ce60_ce25ae4b07ea -->|defined in| 08a89c6b_073a_a5c7_87b0_8608d1a1a5cd style 263692c5_cd3e_9855_ce60_ce25ae4b07ea fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
drizzle-seed/src/services/Generators.ts lines 1770–1793
override init({ count, seed }: { count: number; seed: number }) {
const t0 = new Date();
const maxUniqueFullNamesNumber = firstNames.length * lastNames.length;
if (count > maxUniqueFullNamesNumber) {
throw new RangeError(
`count exceeds max number of unique full names(${maxUniqueFullNamesNumber}).`,
);
}
if (this.stringLength !== undefined && this.stringLength < (maxFirstNameLength + maxLastNameLength + 1)) {
throw new Error(
`You can't use full name generator with a db column length restriction of ${this.stringLength}. Set the maximum string length to at least ${
maxFirstNameLength + maxLastNameLength + 1
}.`,
);
}
const rng = prand.xoroshiro128plus(seed);
const fullnameSet = new Set<string>();
this.state = { rng, fullnameSet };
this.timeSpent += (Date.now() - t0.getTime()) / 1000;
}
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 1770.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free