Home / Function/ mock() — drizzle-orm Function Reference

mock() — drizzle-orm Function Reference

Architecture documentation for the mock() function in driver.ts from the drizzle-orm codebase.

Entity Profile

Dependency Diagram

graph TD
  f3d99c01_2cf7_3063_3808_089afded7ac8["mock()"]
  a31a3294_138f_5fe3_66a6_78efb3064274["driver.ts"]
  f3d99c01_2cf7_3063_3808_089afded7ac8 -->|defined in| a31a3294_138f_5fe3_66a6_78efb3064274
  068740e8_2543_b6bc_c68c_e62bdd7764f1["construct()"]
  f3d99c01_2cf7_3063_3808_089afded7ac8 -->|calls| 068740e8_2543_b6bc_c68c_e62bdd7764f1
  style f3d99c01_2cf7_3063_3808_089afded7ac8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-orm/src/neon-http/driver.ts lines 229–235

	export function mock<TSchema extends Record<string, unknown> = Record<string, never>>(
		config?: DrizzleConfig<TSchema>,
	): NeonHttpDatabase<TSchema> & {
		$client: '$client is not available on drizzle.mock()';
	} {
		return construct({} as any, config) as any;
	}

Domain

Subdomains

Calls

Frequently Asked Questions

What does mock() do?
mock() is a function in the drizzle-orm codebase, defined in drizzle-orm/src/neon-http/driver.ts.
Where is mock() defined?
mock() is defined in drizzle-orm/src/neon-http/driver.ts at line 229.
What does mock() call?
mock() calls 1 function(s): construct.

Analyze Your Own Codebase

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

Try Supermodel Free