Home / Function/ init() — drizzle-orm Function Reference

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
  49edeffd_bff3_ade5_1b98_ff32d6b257b4["init()"]
  fee4fb82_30a9_ab8b_b634_e36f5235e99f["GenerateFullName"]
  49edeffd_bff3_ade5_1b98_ff32d6b257b4 -->|defined in| fee4fb82_30a9_ab8b_b634_e36f5235e99f
  style 49edeffd_bff3_ade5_1b98_ff32d6b257b4 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-seed/src/services/Generators.ts lines 1723–1737

	override init({ count, seed }: { count: number; seed: number }) {
		super.init({ count, seed });

		const rng = prand.xoroshiro128plus(seed);

		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
				}.`,
			);
		}

		this.state = { rng };
	}

Domain

Subdomains

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 1723.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free