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
  3915bbb4_b291_020b_cb13_c1e2ef7b701a["init()"]
  5324eb87_a82c_a88f_864b_d7d43a82461c["GenerateSelfRelationsValuesFromArray"]
  3915bbb4_b291_020b_cb13_c1e2ef7b701a -->|defined in| 5324eb87_a82c_a88f_864b_d7d43a82461c
  style 3915bbb4_b291_020b_cb13_c1e2ef7b701a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-seed/src/services/Generators.ts lines 415–424

	override init({ count, seed }: { count: number; seed: number }) {
		let rng = prand.xoroshiro128plus(seed);

		// generate 15-40 % values with the same value as reference column
		let percent = 30;
		[percent, rng] = prand.uniformIntDistribution(20, 40, rng);
		const firstValuesCount = Math.floor((percent / 100) * count), firstValues: (string | number | boolean)[] = [];

		this.state = { rng, firstValuesCount, firstValues };
	}

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

Analyze Your Own Codebase

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

Try Supermodel Free