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

Relationship Graph

Source Code

drizzle-seed/src/services/Generators.ts lines 2423–2437

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

		const rng = prand.xoroshiro128plus(seed);
		const templates = ['#####', '#####-####'];

		const maxPostcodeLength = Math.max(...templates.map((template) => template.length));
		if (this.stringLength !== undefined && this.stringLength < maxPostcodeLength) {
			throw new Error(
				`You can't use postcode generator with a db column length restriction of ${this.stringLength}. Set the maximum string length to at least ${maxPostcodeLength}.`,
			);
		}

		this.state = { rng, templates };
	}

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

Analyze Your Own Codebase

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

Try Supermodel Free