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

Relationship Graph

Source Code

drizzle-seed/src/services/Generators.ts lines 2562–2574

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

		const rng = prand.xoroshiro128plus(seed);

		if (this.stringLength !== undefined && this.stringLength < maxStateLength) {
			throw new Error(
				`You can't use state generator with a db column length restriction of ${this.stringLength}. Set the maximum string length to at least ${maxStateLength}.`,
			);
		}

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

Analyze Your Own Codebase

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

Try Supermodel Free