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
  e7bb7ead_27db_e586_431c_367e654ae94a["init()"]
  1eb4cc3b_1b3f_0a33_4f89_0accb688801e["GenerateWeightedCount"]
  e7bb7ead_27db_e586_431c_367e654ae94a -->|defined in| 1eb4cc3b_1b3f_0a33_4f89_0accb688801e
  b944ea69_4ea2_ead0_df3f_03885521d095["getWeightedIndices()"]
  e7bb7ead_27db_e586_431c_367e654ae94a -->|calls| b944ea69_4ea2_ead0_df3f_03885521d095
  style e7bb7ead_27db_e586_431c_367e654ae94a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-seed/src/services/Generators.ts lines 141–145

	override init({ seed, count }: { count: { weight: number; count: number | number[] }[]; seed: number }) {
		const rng = prand.xoroshiro128plus(seed);
		const weightedIndices = getWeightedIndices(count.map((val) => val.weight));
		this.state = { rng, weightedIndices, weightedCount: count };
	}

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 141.
What does init() call?
init() calls 1 function(s): getWeightedIndices.

Analyze Your Own Codebase

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

Try Supermodel Free