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
  36efee29_bea2_da6e_974e_e77e924fb9b3["init()"]
  5043a731_a89f_e117_34c8_0f660eefd9d6["GenerateNumber"]
  36efee29_bea2_da6e_974e_e77e924fb9b3 -->|defined in| 5043a731_a89f_e117_34c8_0f660eefd9d6
  style 36efee29_bea2_da6e_974e_e77e924fb9b3 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-seed/src/services/Generators.ts lines 483–506

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

		let { minValue, maxValue, precision } = this.params;
		if (precision === undefined) {
			precision = 100;
		}

		if (maxValue === undefined) {
			maxValue = precision * 1000;
		} else {
			maxValue *= precision;
		}

		if (minValue === undefined) {
			minValue = -maxValue;
		} else {
			minValue *= precision;
		}

		const rng = prand.xoroshiro128plus(seed);

		this.state = { rng, minValue, maxValue, precision };
	}

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

Analyze Your Own Codebase

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

Try Supermodel Free